]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes a bug in IPv6 BGP next hop processing.
authorOndrej Zajicek <santiago@crfreenet.org>
Tue, 16 Apr 2013 15:40:44 +0000 (17:40 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 16 Apr 2013 15:40:44 +0000 (17:40 +0200)
BGP next hop attributes with empty link-local IPv6 addresses were not
handled properly.

Thanks to Sergey Popovich for the bugfix.

proto/bgp/packets.c

index cfa37fb5d2e944082882408ea0354ed084404082..f2e03f8759cf24660e5a38962547382d54824ea5 100644 (file)
@@ -820,7 +820,7 @@ bgp_set_next_hop(struct bgp_proto *p, rta *a)
   ip_addr *nexthop = (ip_addr *) nh->u.ptr->data;
 
 #ifdef IPV6
-  int second = (nh->u.ptr->length == NEXT_HOP_LENGTH);
+  int second = (nh->u.ptr->length == NEXT_HOP_LENGTH) && ipa_nonzero(nexthop[1]);
 
   /* First address should not be link-local, but may be zero in direct mode */
   if (ipa_has_link_scope(*nexthop))