]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: update mp_nexthop field in case mp-bgp entry is created
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 20 Jan 2017 13:02:49 +0000 (14:02 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 14 Feb 2017 12:58:59 +0000 (13:58 +0100)
In case a manual set of MPLS, ENCAP, or EVPN entry is set, then the
nexthop attribute localted in attr->extra structure must be changed too.
In standard cases, where IPv4 IGP nexthop address is picked up, the same
address ie chosen.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_route.c

index 6d8336032fe3d4564f64b609916a836c86d77629..e303cbb644a4dbdf7db7b5d7afa1a8937e61129a 100644 (file)
@@ -4006,6 +4006,14 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
   attr.med = bgp_static->igpmetric;
   attr.flag |= ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC);
 
+  if ((safi == SAFI_EVPN) || (safi == SAFI_MPLS_VPN) || (safi == SAFI_ENCAP))
+    {
+      if (bgp_static->igpnexthop.s_addr)
+        {
+          bgp_attr_extra_get (&attr)->mp_nexthop_global_in = bgp_static->igpnexthop;
+          bgp_attr_extra_get (&attr)->mp_nexthop_len = IPV4_MAX_BYTELEN;
+        }
+    }
   if(afi == AFI_L2VPN)
     {
       if (bgp_static->gatewayIp.family == AF_INET)