summaryrefslogtreecommitdiff
path: root/zebra/zebra_srte.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_srte.c')
-rw-r--r--zebra/zebra_srte.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/zebra/zebra_srte.c b/zebra/zebra_srte.c
index c0f18dd091..7d95607fcf 100644
--- a/zebra/zebra_srte.c
+++ b/zebra/zebra_srte.c
@@ -384,6 +384,23 @@ int zebra_sr_policy_label_update(mpls_label_t label,
return 0;
}
+static int zebra_srte_client_close_cleanup(struct zserv *client)
+{
+ int sock = client->sock;
+ struct zebra_sr_policy *policy;
+
+ if (!sock)
+ return 0;
+
+ RB_FOREACH (policy, zebra_sr_policy_instance_head,
+ &zebra_sr_policy_instances) {
+ if (policy->sock == sock)
+ zebra_sr_policy_del(policy);
+ }
+ return 1;
+}
+
void zebra_srte_init(void)
{
+ hook_register(zserv_client_close, zebra_srte_client_close_cleanup);
}