summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2018-05-07 12:04:26 -0700
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-05-11 08:02:42 -0400
commit450e362d2a3b417ff1ba48cbb24d3ed0393352ac (patch)
treebc22e28c6b66c6ee751db41e5da5b11c799b4e7a
parent528cd74fd326517b2c9d941c9e9803c6c8d17515 (diff)
bgpd: Set NEXT_HOP attribute for EVPN imported routes
Ensure that when EVPN routes are imported into a VRF as IPv4 routes, the NEXT_HOP attribute is set. In the absence of this, this attribute is currently not generated when advertising the route to peers in the VRF. It is to be noted that the source route (the EVPN route) will only have the MP_REACH_NLRI attribute that contains the next hop in it. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_evpn.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c
index 02dd64f1a3..a0cd9edb0e 100644
--- a/bgpd/bgp_evpn.c
+++ b/bgpd/bgp_evpn.c
@@ -1819,12 +1819,15 @@ static int install_evpn_route_entry_in_vrf(struct bgp *bgp_vrf,
/* EVPN routes currently only support a IPv4 next hop which corresponds
* to the remote VTEP. When importing into a VRF, if it is IPv6 host
- * route, we have to convert the next hop to an IPv4-mapped address
- * for the rest of the code to flow through.
+ * or prefix route, we have to convert the next hop to an IPv4-mapped
+ * address for the rest of the code to flow through. In the case of IPv4,
+ * make sure to set the flag for next hop attribute.
*/
bgp_attr_dup(&attr, parent_ri->attr);
if (afi == AFI_IP6)
evpn_convert_nexthop_to_ipv6(&attr);
+ else
+ attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_NEXT_HOP);
/* Check if route entry is already present. */
for (ri = rn->info; ri; ri = ri->next)