summaryrefslogtreecommitdiff
path: root/bgpd/bgp_attr_evpn.c
diff options
context:
space:
mode:
authorKishore Aramalla <karamalla@vmware.com>2020-02-10 11:38:27 -0800
committerKishore Aramalla <karamalla@vmware.com>2020-02-11 12:36:50 -0800
commitc6ec0c745a77024c0b5690127ebd961493daed3d (patch)
tree3861a7eb9a4902b7b4551d6b7f526dafe323578a /bgpd/bgp_attr_evpn.c
parentf94ed830df98218447f00b97f856de811bfcc4a2 (diff)
bgpd: RFC compliance wrt invalid RMAC, GWIP, ESI and VNI
A route where ESI, GW IP, MAC and Label are all zero at the same time SHOULD be treat-as-withdraw. Invalid MAC addresses are broadcast or multicast MAC addresses. The route MUST be treat-as-withdraw in case of an invalid MAC address. As FRR support Ethernet NVO Tunnels only. Route will be withdrawn when ESI, GW IP and MAC are zero or Invalid MAC Test cases: 1) ET-5 route with valid RMAC extended community 2) ET-5 route no RMAC extended community 3) ET-5 route with Multicast MAC in RMAC extended community 4) ET-5 route with Broadcast MAC in RMAC extended community Signed-off-by: Kishore Aramalla <karamalla@vmware.com>
Diffstat (limited to 'bgpd/bgp_attr_evpn.c')
-rw-r--r--bgpd/bgp_attr_evpn.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/bgpd/bgp_attr_evpn.c b/bgpd/bgp_attr_evpn.c
index 15fa322159..ec9656a98d 100644
--- a/bgpd/bgp_attr_evpn.c
+++ b/bgpd/bgp_attr_evpn.c
@@ -281,3 +281,25 @@ extern int bgp_build_evpn_prefix(int evpn_type, uint32_t eth_tag,
return -1;
return 0;
}
+
+extern bool is_zero_gw_ip(const union gw_addr *gw_ip, const afi_t afi)
+{
+ if (afi == AF_INET6 && IN6_IS_ADDR_UNSPECIFIED(&gw_ip->ipv6))
+ return true;
+
+ if (afi == AF_INET && gw_ip->ipv4.s_addr == INADDR_ANY)
+ return true;
+
+ return false;
+}
+
+extern bool is_zero_esi(const struct eth_segment_id *esi)
+{
+ int i;
+
+ for (i = 0; i < ESI_LEN; i++)
+ if (esi->val[i])
+ return false;
+
+ return true;
+}