summaryrefslogtreecommitdiffstats
path: root/usr.sbin/npppd
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2017-01-09 14:04:31 +0000
committerkrw <krw@openbsd.org>2017-01-09 14:04:31 +0000
commit4ff7cad5c173774706eddccb3a70ba75a37073dd (patch)
tree58d9ca12a39ad2cd35e790cc1e3bac8c944fa1ac /usr.sbin/npppd
parentWhen acting as 11n hostap, send Microsoft WME parameters to clients so (diff)
downloadwireguard-openbsd-4ff7cad5c173774706eddccb3a70ba75a37073dd.tar.xz
wireguard-openbsd-4ff7cad5c173774706eddccb3a70ba75a37073dd.zip
Replace hand-rolled for(;;) traversal of ctl_conns TAILQ with
TAILQ_FOREACH(). No intentional functional change. ok reyk@
Diffstat (limited to 'usr.sbin/npppd')
-rw-r--r--usr.sbin/npppd/npppd/control.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/npppd/npppd/control.c b/usr.sbin/npppd/npppd/control.c
index e4374736de0..acb06cab031 100644
--- a/usr.sbin/npppd/npppd/control.c
+++ b/usr.sbin/npppd/npppd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.6 2016/03/22 02:27:20 yasuoka Exp $ */
+/* $OpenBSD: control.c,v 1.7 2017/01/09 14:04:31 krw Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -204,9 +204,10 @@ control_connbyfd(int fd)
{
struct ctl_conn *c;
- for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->iev.ibuf.fd != fd;
- c = TAILQ_NEXT(c, entry))
- ; /* nothing */
+ TAILQ_FOREACH(c, &ctl_conns, entry) {
+ if (c->iev.ibuf.fd == fd)
+ break;
+ }
return (c);
}