summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/rib.h2
-rw-r--r--zebra/zebra_ns.c15
-rw-r--r--zebra/zebra_ns.h2
-rw-r--r--zebra/zebra_rib.c6
4 files changed, 23 insertions, 2 deletions
diff --git a/zebra/rib.h b/zebra/rib.h
index 0ee89e015a..b5d8c6e8eb 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -329,6 +329,8 @@ extern void rib_sweep_route(void);
extern void rib_close_table(struct route_table *);
extern void rib_init(void);
extern unsigned long rib_score_proto(u_char proto, u_short instance);
+extern unsigned long rib_score_proto_table(u_char proto, u_short instance,
+ struct route_table *table);
extern void rib_queue_add(struct route_node *rn);
extern void meta_queue_free(struct meta_queue *mq);
extern int zebra_rib_labeled_unicast(struct route_entry *re);
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)
diff --git a/zebra/zebra_ns.h b/zebra/zebra_ns.h
index 19ecba1f0e..f6b8f5f9b3 100644
--- a/zebra/zebra_ns.h
+++ b/zebra/zebra_ns.h
@@ -90,4 +90,6 @@ extern struct route_table *zebra_ns_get_table(struct zebra_ns *zns,
struct zebra_vrf *zvrf,
uint32_t tableid, afi_t afi);
int zebra_ns_config_write(struct vty *vty, struct ns *ns);
+
+unsigned long zebra_ns_score_proto(u_char proto, u_short instance);
#endif
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 26dd48733e..35c74daea5 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2803,8 +2803,8 @@ void rib_sweep_route(void)
}
/* Remove specific by protocol routes from 'table'. */
-static unsigned long rib_score_proto_table(u_char proto, u_short instance,
- struct route_table *table)
+unsigned long rib_score_proto_table(u_char proto, u_short instance,
+ struct route_table *table)
{
struct route_node *rn;
struct route_entry *re;
@@ -2841,6 +2841,8 @@ unsigned long rib_score_proto(u_char proto, u_short instance)
proto, instance,
zvrf->table[AFI_IP6][SAFI_UNICAST]);
+ cnt += zebra_ns_score_proto(proto, instance);
+
return cnt;
}