diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2011-01-29 17:10:46 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2011-01-29 17:10:46 +0000 |
commit | 21b724de7ff5906d1e1773902bece35a95628a53 (patch) | |
tree | 1878dc48acba802f565dccead4c5ee69cb4d4b86 /usr.sbin | |
parent | 4a08ef6ef94bc28b0a61b70a9b660a5b60434e65 (diff) |
improve error msg when enforce-neighbor-as is on and the path doesn't
start with the neighbor-as. makes finding the offender easier.
from Sebastian Benoit <benoit-lists at fb12.de>, claudio agrees
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 7285885e55c..c2ea67bd0eb 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.305 2011/01/27 17:19:09 sthen Exp $ */ +/* $OpenBSD: rde.c,v 1.306 2011/01/29 17:10:45 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -858,6 +858,7 @@ rde_update_dispatch(struct imsg *imsg) u_int16_t attrpath_len; u_int16_t nlri_len; u_int8_t aid, prefixlen, safi, subtype; + u_int32_t fas; peer = peer_get(imsg->hdr.peerid); if (peer == NULL) /* unknown peer, cannot happen */ @@ -917,15 +918,17 @@ rde_update_dispatch(struct imsg *imsg) /* enforce remote AS if requested */ if (asp->flags & F_ATTR_ASPATH && - peer->conf.enforce_as == ENFORCE_AS_ON) - if (peer->conf.remote_as != - aspath_neighbor(asp->aspath)) { - log_peer_warnx(&peer->conf, "bad path, " - "enforce neighbor-as enabled"); - rde_update_err(peer, ERR_UPDATE, ERR_UPD_ASPATH, + peer->conf.enforce_as == ENFORCE_AS_ON) { + fas = aspath_neighbor(asp->aspath); + if (peer->conf.remote_as != fas) { + log_peer_warnx(&peer->conf, "bad path, " + "starting with %i, " + "enforce neighbor-as enabled", fas); + rde_update_err(peer, ERR_UPDATE, ERR_UPD_ASPATH, NULL, 0); - goto done; + goto done; } + } rde_reflector(peer, asp); } |