From 2034dac421494723224d278a9b1eeb17bfcf14dd Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 23 May 2016 14:49:57 +0000 Subject: Call accept_unpause() when any TCP socket is closed. We were calling accept_unpause() only when an LDP session is shut down. But, during the LDP session establishment process, we may have TCP sockets that are not associated with any neighbor. If we close one of these sockets, we must call accept_unpause() too. --- usr.sbin/ldpd/control.c | 4 ++-- usr.sbin/ldpd/packet.c | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'usr.sbin/ldpd') diff --git a/usr.sbin/ldpd/control.c b/usr.sbin/ldpd/control.c index 38b87a4806d..5516b411bc0 100644 --- a/usr.sbin/ldpd/control.c +++ b/usr.sbin/ldpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.17 2015/12/05 13:11:48 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.18 2016/05/23 14:49:56 renato Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -182,8 +182,8 @@ control_close(int fd) event_del(&c->iev.ev); close(c->iev.ibuf.fd); - free(c); accept_unpause(); + free(c); } /* ARGSUSED */ diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c index 484b08f77fe..576616c9e87 100644 --- a/usr.sbin/ldpd/packet.c +++ b/usr.sbin/ldpd/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.41 2015/07/21 04:43:28 renato Exp $ */ +/* $OpenBSD: packet.c,v 1.42 2016/05/23 14:49:56 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto @@ -258,6 +258,7 @@ tcp_close(struct tcp_conn *tcp) evbuf_clear(&tcp->wbuf); event_del(&tcp->rev); close(tcp->fd); + accept_unpause(); free(tcp->rbuf); free(tcp); } @@ -567,8 +568,6 @@ session_close(struct nbr *nbr) nbr_stop_ktimer(nbr); nbr_stop_ktimeout(nbr); - - accept_unpause(); } ssize_t -- cgit v1.2.3