From: Quentin Young Date: Wed, 1 Aug 2018 19:38:41 +0000 (+0000) Subject: zebra: ensure cleanup of rib on client close X-Git-Tag: frr-6.1-dev~111^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a580357a871c862d52a1d4c933edcc694b746848;p=matthieu%2Ffrr.git zebra: ensure cleanup of rib on client close Socket should be closed in zserv_client_free() and nowhere else. Credit to Mark Stapp for catching this one. Signed-off-by: Quentin Young --- diff --git a/zebra/zserv.c b/zebra/zserv.c index fa501b187d..4960ba03a6 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -576,6 +576,7 @@ static void zserv_client_free(struct zserv *client) unsigned long nroutes; close(client->sock); + nroutes = rib_score_proto(client->proto, client->instance); zlog_notice( "client %d disconnected. %lu %s routes removed from the rib", @@ -621,12 +622,6 @@ void zserv_close_client(struct zserv *client) zlog_debug("Closing client '%s'", zebra_route_string(client->proto)); - /* if file descriptor is still open, close it */ - if (client->sock > 0) { - close(client->sock); - client->sock = -1; - } - thread_cancel_event(zebrad.master, client); THREAD_OFF(client->t_cleanup);