summaryrefslogtreecommitdiff
path: root/usr.sbin/npppd
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2016-03-22 02:27:21 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2016-03-22 02:27:21 +0000
commitaf4b3a3ba50a282cc95df05f8a9da3fac7031a27 (patch)
tree3d48d4d2272bc1ef58b539bf8b5337a69d186598 /usr.sbin/npppd
parent9f041733662e742dd499b12cdd760f776a1d8b4b (diff)
Cleanup control sockets in control_cleanup().
Diff from Yuuichi Someya.
Diffstat (limited to 'usr.sbin/npppd')
-rw-r--r--usr.sbin/npppd/npppd/control.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/npppd/npppd/control.c b/usr.sbin/npppd/npppd/control.c
index d576be8e1a7..e4374736de0 100644
--- a/usr.sbin/npppd/npppd/control.c
+++ b/usr.sbin/npppd/npppd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.5 2016/03/22 00:36:06 krw Exp $ */
+/* $OpenBSD: control.c,v 1.6 2016/03/22 02:27:20 yasuoka Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -131,8 +131,14 @@ control_listen(struct control_sock *cs)
void
control_cleanup(struct control_sock *cs)
{
+ struct ctl_conn *c, *nc;
+
if (cs->cs_name == NULL)
return;
+
+ TAILQ_FOREACH_SAFE(c, &ctl_conns, entry, nc)
+ control_close(c->iev.ibuf.fd, cs);
+
event_del(&cs->cs_ev);
event_del(&cs->cs_evt);
(void)unlink(cs->cs_name);