diff options
author | yasuoka <yasuoka@openbsd.org> | 2016-03-22 02:27:20 +0000 |
---|---|---|
committer | yasuoka <yasuoka@openbsd.org> | 2016-03-22 02:27:20 +0000 |
commit | 9774ffa7c5f3cf5bcf760402491d1c6c900c007e (patch) | |
tree | cdd186b31cdf5fd196dc8829ff7f1c1b1b858376 /usr.sbin/npppd | |
parent | Remove defines for unsupported chips, add V5TEJ and remove incorrect (diff) | |
download | wireguard-openbsd-9774ffa7c5f3cf5bcf760402491d1c6c900c007e.tar.xz wireguard-openbsd-9774ffa7c5f3cf5bcf760402491d1c6c900c007e.zip |
Cleanup control sockets in control_cleanup().
Diff from Yuuichi Someya.
Diffstat (limited to 'usr.sbin/npppd')
-rw-r--r-- | usr.sbin/npppd/npppd/control.c | 8 |
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); |