diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2012-01-08 15:28:27 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2012-01-08 15:31:34 +0100 |
commit | 53ffbff39f054e1302fb296327b9bb1b4f88226c (patch) | |
tree | 6e0f21ac671dd1cf35d7a3322a89ebb304b0c2c6 /proto/bgp/attrs.c | |
parent | eb1451a3a0c45a4cc62dd0f1f3c3157ec38e2f8e (diff) |
Implements support for link-local addresses in BGP.
Thanks Matthias Schiffer for the original patch.
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r-- | proto/bgp/attrs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 93c1f6d6..5a368783 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -1001,10 +1001,13 @@ bgp_update_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p } /* iBGP -> keep next_hop, eBGP multi-hop -> use source_addr, - eBGP single-hop -> keep next_hop if on the same iface */ + * eBGP single-hop -> keep next_hop if on the same iface. + * If the next_hop is zero (i.e. link-local), keep only if on the same iface. + */ a = ea_find(e->attrs->eattrs, EA_CODE(EAP_BGP, BA_NEXT_HOP)); if (a && !p->cf->next_hop_self && - (p->is_internal || (p->neigh && (e->attrs->iface == p->neigh->iface)))) + ((p->is_internal && ipa_nonzero(*((ip_addr *) a->u.ptr->data))) || + (p->neigh && (e->attrs->iface == p->neigh->iface)))) { /* Leave the original next hop attribute, will check later where does it point */ } |