]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fix extended next hop handling
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Thu, 12 Apr 2018 14:55:56 +0000 (16:55 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Thu, 12 Apr 2018 14:55:56 +0000 (16:55 +0200)
For IPv4 with extended next hop, we use MP-BGP format and therefore no
independent NEXT_HOP attribute.

Thanks to Arvin Gan for the bugreport.

proto/bgp/attrs.c

index 0f41f818399557a36d23cf3308cd7d9a428a26b5..9003feb2dcc0df2f392cef8d7a85b99ea7fedda8 100644 (file)
@@ -295,7 +295,7 @@ bgp_encode_next_hop(struct bgp_write_state *s, eattr *a, byte *buf, uint size)
    * store it and encode it later by AFI-specific hooks.
    */
 
-  if (s->channel->afi == BGP_AF_IPV4)
+  if ((s->channel->afi == BGP_AF_IPV4) && !s->channel->ext_next_hop)
   {
     ASSERT(a->u.ptr->length == sizeof(ip_addr));