diff options
author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-07-25 19:27:59 +0200 |
---|---|---|
committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-25 17:13:41 +0200 |
commit | 8dbc800f42797105b53fd385eb57ac30bc372d7d (patch) | |
tree | 8702bb8ef891fd054b4551f10211ecf933a0a5ab /zebra/zebra_nhg.h | |
parent | zebra: TODO for handling upper level nhe_id passing (diff) | |
download | frr-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.h | 4 |
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); |