diff options
| author | Stephen Worley <sworley@cumulusnetworks.com> | 2019-02-25 18:18:07 -0500 |
|---|---|---|
| committer | Stephen Worley <sworley@cumulusnetworks.com> | 2019-10-25 11:13:36 -0400 |
| commit | d9f5b2f50f53d625986dbd47cd12778c9f841f0c (patch) | |
| tree | 8ecb06f5a9bc83505ed4b4eaa61754eb76238573 /zebra/zebra_rib.c | |
| parent | 8b5bdc8bdfdb95d5e22ccb8733dbd35c84f3f79d (diff) | |
zebra: Add functionality to parse RTM_NEWNEXTHOP and RTM_DELNEXTHOP messages
Add the functionality to parse new nexthop group messages
from the kernel and insert them into the appropriate hash
tables. Parsing is done at startup between interface and
interface address lookup. Add functionality to parse
changes to nexthops we already have. Add functionality
to parse delete nexthop messages from the kernel and
remove them from our table.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index c8684c1a93..3b3bf921bc 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2411,8 +2411,9 @@ void rib_unlink(struct route_node *rn, struct route_entry *re) if (dest->selected_fib == re) dest->selected_fib = NULL; - zebra_nhg_release(re); + zebra_nhg_decrement_ref(re->nhe); + // TODO: We need to hold on nh's until refcnt is 0 right? nexthops_free(re->ng->nexthop); nexthop_group_delete(&re->ng); nexthops_free(re->fib_ng.nexthop); @@ -2658,7 +2659,8 @@ int rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p, if (src_p) apply_mask_ipv6(src_p); - zebra_nhg_find(re->ng, re); + re->nhe = zebra_nhg_find(re->ng, re->vrf_id, 0); + re->nhe->refcnt++; /* Set default distance by route type. */ if (re->distance == 0) re->distance = route_distance(re->type); |
