diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2021-10-21 15:17:12 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2022-03-27 14:51:00 +0200 |
| commit | bc9b1cbfae30d2b06198ee6d26a12a541f7e79a9 (patch) | |
| tree | 4bbde8edab3871717a077d7afce57e52e77e6b38 /zebra/zebra_rnh.c | |
| parent | 47fd8abae1d27330b20a640cd1a8db6f6b497ba2 (diff) | |
zebra: check other SAFIs when removing gone client
When a client disconnects, we need to check & remove NHT entries for
other SAFIs too. Otherwise we crash later trying to access stale data.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_rnh.c')
| -rw-r--r-- | zebra/zebra_rnh.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 4d5336120d..f3f48b52ae 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -1337,7 +1337,7 @@ static void print_rnh(struct route_node *rn, struct vty *vty) vty_out(vty, "\n"); } -static int zebra_cleanup_rnh_client(vrf_id_t vrf_id, afi_t afi, +static int zebra_cleanup_rnh_client(vrf_id_t vrf_id, afi_t afi, safi_t safi, struct zserv *client) { struct route_table *ntable; @@ -1352,7 +1352,7 @@ static int zebra_cleanup_rnh_client(vrf_id_t vrf_id, afi_t afi, zebra_route_string(client->proto), afi2str(afi)); } - ntable = get_rnh_table(vrf_id, afi, SAFI_UNICAST); + ntable = get_rnh_table(vrf_id, afi, safi); if (!ntable) { zlog_debug("cleanup_rnh_client: rnh table not found"); return -1; @@ -1377,9 +1377,14 @@ static int zebra_client_cleanup_rnh(struct zserv *client) RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) { zvrf = vrf->info; if (zvrf) { - zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP, client); + zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP, + SAFI_UNICAST, client); + zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP, + SAFI_MULTICAST, client); zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP6, - client); + SAFI_UNICAST, client); + zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP6, + SAFI_MULTICAST, client); } } |
