summaryrefslogtreecommitdiff
path: root/zebra/zebra_ns.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-03-15 23:30:17 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-03-16 10:18:07 -0400
commit47a08aa968e451b81030e010d41da6def3d2c577 (patch)
tree5925cef0e68d5dea5ec91d88dcec8b6c4f042772 /zebra/zebra_ns.c
parente69aa084193bcadc7a48c99c381741e8ff307658 (diff)
zebra: Upon client disconnect remove routes from all tables
It is possible for clients to install routes into tables that they desire. Modify the code to delete these routes from these tables as well. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_ns.c')
-rw-r--r--zebra/zebra_ns.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/zebra/zebra_ns.c b/zebra/zebra_ns.c
index 192e8ad413..2c7b85e614 100644
--- a/zebra/zebra_ns.c
+++ b/zebra/zebra_ns.c
@@ -37,6 +37,7 @@
#include "zebra_netns_notify.h"
#include "zebra_netns_id.h"
#include "zebra_pbr.h"
+#include "rib.h"
extern struct zebra_privs_t zserv_privs;
@@ -162,6 +163,20 @@ struct route_table *zebra_ns_find_table(struct zebra_ns *zns, uint32_t tableid,
return NULL;
}
+unsigned long zebra_ns_score_proto(u_char proto, u_short instance)
+{
+ struct zebra_ns *zns;
+ struct zebra_ns_table *znst;
+ unsigned long cnt = 0;
+
+ zns = zebra_ns_lookup(NS_DEFAULT);
+
+ RB_FOREACH (znst, zebra_ns_table_head, &zns->ns_tables)
+ cnt += rib_score_proto_table(proto, instance, znst->table);
+
+ return cnt;
+}
+
struct route_table *zebra_ns_get_table(struct zebra_ns *zns,
struct zebra_vrf *zvrf, uint32_t tableid,
afi_t afi)