diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-04-29 18:58:24 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-04-29 18:58:24 +0200 |
commit | 4827b69ff43661f4f34d437999b0edaac76f7355 (patch) | |
tree | 4e36a37b04fa4ba6bf363887fe4ecc65016e7fee /proto/bgp/attrs.c | |
parent | ad440a570b37e8674ef35f3a18df48f0eb2579eb (diff) | |
download | bird-4827b69ff43661f4f34d437999b0edaac76f7355.tar bird-4827b69ff43661f4f34d437999b0edaac76f7355.zip |
Fixes BGP IPv6 link local next hop handling.
When sending 'third party' BGP update, Bird used bogus link local
addresses instead of addresses it received before.
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r-- | proto/bgp/attrs.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 9a247de..585bfd1 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -786,13 +786,13 @@ bgp_create_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p put_u16(z+2, p->local_as); } - z = bgp_set_attr_wa(ea->attrs+2, pool, BA_NEXT_HOP, sizeof(ip_addr)); + z = bgp_set_attr_wa(ea->attrs+2, pool, BA_NEXT_HOP, NEXT_HOP_LENGTH); if (p->cf->next_hop_self || !p->is_internal || rta->dest != RTD_ROUTER) - *(ip_addr *)z = p->source_addr; + set_next_hop(z, p->source_addr); else - *(ip_addr *)z = e->attrs->gw; + set_next_hop(z, e->attrs->gw); bgp_set_attr(ea->attrs+3, BA_LOCAL_PREF, 0); @@ -862,7 +862,8 @@ bgp_update_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p else { /* Need to create new one */ - bgp_attach_attr_ip(attrs, pool, BA_NEXT_HOP, p->source_addr); + byte *b = bgp_attach_attr_wa(attrs, pool, BA_NEXT_HOP, NEXT_HOP_LENGTH); + set_next_hop(b, p->source_addr); } if (rr) |