bgpd: update mp_nexthop field in case mp-bgp entry is created

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>
This commit is contained in:
Philippe Guibert 2017-01-20 14:02:49 +01:00
parent 3da6fcd557
commit 061e9fdea5

View 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)