]> git.puffer.fish Git - matthieu/frr.git/commitdiff
BGP: Fix nexthop setting for default originate
authorvivek <vivek@cumulusnetworks.com>
Tue, 10 May 2016 16:29:25 +0000 (09:29 -0700)
committervivek <vivek@cumulusnetworks.com>
Tue, 10 May 2016 16:29:25 +0000 (09:29 -0700)
The nexthop setting for IPv6 default origination was incorrect, resulting in
the same (incorrect) IPv6 link-local nexthop being advertised to multiple
peers. The issue was also present for IPv4 default origination when IPv4
routes are advertised with IPv6 nextops (RFC 5549).

For default origination, we should just reset the nexthop when forming the
update for the update-group and let the outbound update/nexthop setting code
set it correctly.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-10623
Reviewed By: CCR-4677
Testing Done: Manual, bgp-min

bgpd/bgp_updgrp_adv.c

index 27597bf4280e97e3242d52cf3444427907474819..e3c4beb3009068b894ee3349ddb6688ae0a905ac 100644 (file)
@@ -704,7 +704,6 @@ subgroup_default_originate (struct update_subgroup *subgrp, int withdraw)
   bgp_attr_default_set (&attr, BGP_ORIGIN_IGP);
   aspath = attr.aspath;
   attr.local_pref = bgp->default_local_pref;
-  memcpy (&attr.nexthop, &peer->nexthop.v4, IPV4_MAX_BYTELEN);
 
   if (afi == AFI_IP)
     str2prefix ("0.0.0.0/0", &p);
@@ -716,19 +715,13 @@ subgroup_default_originate (struct update_subgroup *subgrp, int withdraw)
       str2prefix ("::/0", &p);
 
       /* IPv6 global nexthop must be included. */
-      memcpy (&ae->mp_nexthop_global, &peer->nexthop.v6_global,
-             IPV6_MAX_BYTELEN);
       ae->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL;
 
       /* If the peer is on shared nextwork and we have link-local
          nexthop set it. */
       if (peer->shared_network
          && !IN6_IS_ADDR_UNSPECIFIED (&peer->nexthop.v6_local))
-       {
-         memcpy (&ae->mp_nexthop_local, &peer->nexthop.v6_local,
-                 IPV6_MAX_BYTELEN);
-         ae->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL;
-       }
+        ae->mp_nexthop_len = BGP_ATTR_NHLEN_IPV6_GLOBAL_AND_LL;
     }
 #endif /* HAVE_IPV6 */