diff options
author | 2017-01-09 14:04:31 +0000 | |
---|---|---|
committer | 2017-01-09 14:04:31 +0000 | |
commit | 4ff7cad5c173774706eddccb3a70ba75a37073dd (patch) | |
tree | 58d9ca12a39ad2cd35e790cc1e3bac8c944fa1ac /usr.sbin/switchd | |
parent | When acting as 11n hostap, send Microsoft WME parameters to clients so (diff) | |
download | wireguard-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/switchd')
-rw-r--r-- | usr.sbin/switchd/control.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/switchd/control.c b/usr.sbin/switchd/control.c index b1b23d3ca48..0fdcf4ae19e 100644 --- a/usr.sbin/switchd/control.c +++ b/usr.sbin/switchd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.5 2016/10/12 19:07:42 reyk Exp $ */ +/* $OpenBSD: control.c,v 1.6 2017/01/09 14:04:31 krw Exp $ */ /* * Copyright (c) 2010-2016 Reyk Floeter <reyk@openbsd.org> @@ -262,9 +262,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); } |