diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-06-08 12:03:49 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-06-08 12:03:49 -0400 |
| commit | 977d7e24fff4e0eef4426bbcc32e491a60815b89 (patch) | |
| tree | 2a33d3bc53c67ef87929de93f6e865fa35e87dbe /zebra/main.c | |
| parent | 99bd15405cbd83aea2c8f71eebeeba11f8be0ec4 (diff) | |
zebra: Prevent crash because nl is NULL on shutdown
When shutting down the main pthread was first closing
the sockets associated with the dplane pthread and
then telling it to shutdown the pthread at a later point
in time. This caused the dplane to crash because the nl
data has been freed already. Change the shutdown order
to stop the dplane pthread *and* then close the sockets.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/main.c')
| -rw-r--r-- | zebra/main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/zebra/main.c b/zebra/main.c index 81a3066445..bd4623be55 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -206,12 +206,17 @@ void zebra_finalize(struct event *dummy) vrf_terminate(); + /* + * Stop dplane thread and finish any cleanup + * This is before the zebra_ns_early_shutdown call + * because sockets that the dplane depends on are closed + * in those functions + */ + zebra_dplane_shutdown(); + ns_walk_func(zebra_ns_early_shutdown, NULL, NULL); zebra_ns_notify_close(); - /* Stop dplane thread and finish any cleanup */ - zebra_dplane_shutdown(); - /* Final shutdown of ns resources */ ns_walk_func(zebra_ns_final_shutdown, NULL, NULL); |
