diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-12-08 07:36:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-08 07:36:44 -0500 |
| commit | 4a2ece949e5ff82d9c3caf7273d31be9a3b3e93c (patch) | |
| tree | bb95ec504dd1323eff96a7677e8fb4072fc3b2da /zebra/zapi_msg.c | |
| parent | c659e1c349dd3679014330174464d3d84f65d23f (diff) | |
| parent | 4d60d9e2b4690bc0f1c84dd68b8b25c5c523e39a (diff) | |
Merge pull request #14964 from pguibert6WIND/nhg_del_in_queue
zebra: enqueue NHG_DEL in rib_nhg meta queue
Diffstat (limited to 'zebra/zapi_msg.c')
| -rw-r--r-- | zebra/zapi_msg.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 2d1614ca54..761eafeb13 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1959,20 +1959,19 @@ static void zread_nhg_del(ZAPI_HANDLER_ARGS) return; } - /* - * Delete the received nhg id - */ - nhe = zebra_nhg_proto_del(api_nhg.id, api_nhg.proto); + /* Create a temporary nhe */ + nhe = zebra_nhg_alloc(); + nhe->id = api_nhg.id; + nhe->type = api_nhg.proto; + nhe->zapi_instance = client->instance; + nhe->zapi_session = client->session_id; + + /* Sanity check - Empty nexthop and group */ + nhe->nhg.nexthop = NULL; + + /* Enqueue to workqueue for processing */ + rib_queue_nhe_del(nhe); - if (nhe) { - zebra_nhg_decrement_ref(nhe); - zsend_nhg_notify(api_nhg.proto, client->instance, - client->session_id, api_nhg.id, - ZAPI_NHG_REMOVED); - } else - zsend_nhg_notify(api_nhg.proto, client->instance, - client->session_id, api_nhg.id, - ZAPI_NHG_REMOVE_FAIL); /* Stats */ client->nhg_del_cnt++; } |
