summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_nhg.h
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-07-25 19:27:59 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-25 17:13:41 +0200
commit8dbc800f42797105b53fd385eb57ac30bc372d7d (patch)
tree8702bb8ef891fd054b4551f10211ecf933a0a5ab /zebra/zebra_nhg.h
parentzebra: TODO for handling upper level nhe_id passing (diff)
downloadfrr-8dbc800f42797105b53fd385eb57ac30bc372d7d.tar.xz
frr-8dbc800f42797105b53fd385eb57ac30bc372d7d.zip
zebra: Prevent duplication and overflow in nhe2grp
The kernel does not allow duplicate IDs in the same group, but we are perfectly find with it internally if two different nexthops resolve the the same nexthop (default route for instance). So, we have to handle this when we get ready to install. Further, pass the max group size in the arguments to ensure we don't overflow. Don't actually think this is possible due to multipath checking in nexthop_active_update() but better to be safe. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_nhg.h')
-rw-r--r--zebra/zebra_nhg.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/zebra_nhg.h b/zebra/zebra_nhg.h
index 0be821267..e06d415b2 100644
--- a/zebra/zebra_nhg.h
+++ b/zebra/zebra_nhg.h
@@ -236,8 +236,8 @@ extern int nexthop_active_update(struct route_node *rn, struct route_entry *re);
extern int zebra_nhg_re_update_ref(struct route_entry *re,
struct nhg_hash_entry *nhe);
-extern uint8_t zebra_nhg_nhe2grp(struct nh_grp *grp,
- struct nhg_hash_entry *nhe);
+extern uint8_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe,
+ int size);
void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe);
void zebra_nhg_uninstall_kernel(struct nhg_hash_entry *nhe);