Socket should be closed in zserv_client_free() and nowhere else.
Credit to Mark Stapp for catching this one.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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",
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);