summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_nexthop.h
diff options
context:
space:
mode:
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>2017-08-17 08:19:58 +0200
committerMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>2017-08-17 08:19:58 +0200
commitdb0e1937ca356d8181b2d2e8856159e3ea80d87f (patch)
tree790c6dbf69464f9671d0a16d250a50df99b753e4 /bgpd/bgp_nexthop.h
parentzebra: Use neigh_list instead of neigh_refcnt for zebra_mac and zebra_neigh b... (diff)
downloadfrr-db0e1937ca356d8181b2d2e8856159e3ea80d87f.tar.xz
frr-db0e1937ca356d8181b2d2e8856159e3ea80d87f.zip
bgpd: Ignore EVPN routes from CLAG peer when VNI comes up
There are two parts to this commit: 1. create a database of self tunnel-ip for used in martian nexthop check In a CLAG setup, the tunnel-ip (VNI UP) notification comes before the clag-anycast-ip comes up in the system. This was causing our self next hop check to fail and we were instaling routes with martian nexthop in zebra. We need to keep this info in a seperate database for all local tunnel-ip. This database will be used in parallel with the self next hop database to martian nexthop checks. 2. When a local VNI comes up, update the tunnel-ip database and filter routes in the RD table if necessary In case of EVPN we might receive routes from clag peer before the clag-anycast ip and VNI is up on the system. We will store the routes in the RD table for later processing. When VNI comes UP, we loop thorugh all the routes and install them in zebra if required. However, we were missing the martian nexthop check in this code path. From now onwards, when a VNI comes UP, we will first update the tunnel-ip database We then loop through all the routes in RD table and apply martian next hop filter if required. Things not covered in this commit but are required: This processing is needed in general when an address becomes a connected address. We need to loop through all the routes in BGP and apply martian nexthop filter if necessary. This will be taken care in a seperate bug Ticket:CM-17271/CM-16911 Reviewed By: ccr-6542 Testing Done: Manual Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_nexthop.h')
-rw-r--r--bgpd/bgp_nexthop.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/bgpd/bgp_nexthop.h b/bgpd/bgp_nexthop.h
index 37dad577c..b482778fd 100644
--- a/bgpd/bgp_nexthop.h
+++ b/bgpd/bgp_nexthop.h
@@ -66,6 +66,18 @@ struct bgp_nexthop_cache {
struct bgp *bgp;
};
+/* BGP own address structure */
+struct bgp_addr {
+ struct in_addr addr;
+ int refcnt;
+};
+
+/* Own tunnel-ip address structure */
+struct tip_addr {
+ struct in_addr addr;
+ int refcnt;
+};
+
extern int bgp_nexthop_lookup(afi_t, struct peer *peer, struct bgp_info *,
int *, int *);
extern void bgp_connected_add(struct bgp *bgp, struct connected *c);
@@ -82,5 +94,9 @@ extern void bgp_scan_finish(struct bgp *bgp);
extern void bgp_scan_vty_init(void);
extern void bgp_address_init(struct bgp *bgp);
extern void bgp_address_destroy(struct bgp *bgp);
+extern void bgp_tip_add(struct bgp *bgp, struct in_addr *tip);
+extern void bgp_tip_del(struct bgp *bgp, struct in_addr *tip);
+extern void bgp_tip_hash_init(struct bgp *bgp);
+extern void bgp_tip_hash_destroy(struct bgp *bgp);
#endif /* _QUAGGA_BGP_NEXTHOP_H */