summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2019-03-08 15:34:09 -0800
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2019-03-13 15:49:51 -0700
commit2f04c4f033a5efce6f9cb3b4bbeec40ba2292785 (patch)
tree17e1b334fe4463d288385d3d7f85d68c9e9072c7
parent50b9931b0aca6d5198761065306bfca625c50b12 (diff)
bgp: fix misc evpn prefix match problems caused by using incorrect prefixlen
The evpn route prefix len was being hardcoded to 224 bits while the length of a mac-ip addr is actually 288. Because of this many problems were seen in the evpn-tests. The sample below is from a test that does a vm-move to verify extended-evpn-mac-mobility - IP1-M1 => IP2->M1. You can see two local neighs but only one was inserted into the per-vni route table. root@TORC11:~# net show evpn arp vni 1001 |grep "2001:fee1:0:1::10\|2001:fee1:0:1::11" 2001:fee1:0:1::10 local active 00:54:6f:7c:74:64 2001:fee1:0:1::11 local active 00:54:6f:7c:74:64 root@TORC11:~# net show bgp l2vpn evpn route vni 1001 |grep "2001:fee1:0:1::10\|2001:fee1:0:1::11" *> [2]:[0]:[48]:[00:54:6f:7c:74:64]:[128]:[2001:fee1:0:1::11] root@TORC11:~# Similarly other traffic loss problems were seen because of one prefix updating another prefix's route. I think the 224-bits came from the packet format definition of type-2 routes. However the way FRR maintains the key is very different than the format in the packet so it seems best to just sizeof the addr. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_evpn_private.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/bgpd/bgp_evpn_private.h b/bgpd/bgp_evpn_private.h
index c7f2671b78..785139865e 100644
--- a/bgpd/bgp_evpn_private.h
+++ b/bgpd/bgp_evpn_private.h
@@ -30,8 +30,9 @@
#define RT_ADDRSTRLEN 28
-/* EVPN prefix lengths. This reprsent the sizeof struct prefix_evpn */
-#define EVPN_ROUTE_PREFIXLEN 224
+/* EVPN prefix lengths. This represents the sizeof struct evpn_addr
+ * in bits */
+#define EVPN_ROUTE_PREFIXLEN (sizeof(struct evpn_addr) * 8)
/* EVPN route types. */
typedef enum {