summaryrefslogtreecommitdiffstats
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
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@
-rw-r--r--sbin/iked/control.c9
-rw-r--r--usr.sbin/httpd/control.c9
-rw-r--r--usr.sbin/ldapd/control.c9
-rw-r--r--usr.sbin/npppd/npppd/control.c9
-rw-r--r--usr.sbin/ntpd/control.c9
-rw-r--r--usr.sbin/relayd/control.c9
-rw-r--r--usr.sbin/switchd/control.c9
-rw-r--r--usr.sbin/vmd/control.c9
8 files changed, 40 insertions, 32 deletions
diff --git a/sbin/iked/control.c b/sbin/iked/control.c
index 94f4dbc7329..ed8713716db 100644
--- a/sbin/iked/control.c
+++ b/sbin/iked/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.22 2016/09/04 16:55:43 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.23 2017/01/09 14:04:31 krw Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -215,9 +215,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);
}
diff --git a/usr.sbin/httpd/control.c b/usr.sbin/httpd/control.c
index 153e9290a3c..3f3302ffd2a 100644
--- a/usr.sbin/httpd/control.c
+++ b/usr.sbin/httpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.11 2016/09/01 10:59:38 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.12 2017/01/09 14:04:31 krw Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -181,9 +181,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);
}
diff --git a/usr.sbin/ldapd/control.c b/usr.sbin/ldapd/control.c
index ce25b20f400..05c13b5c609 100644
--- a/usr.sbin/ldapd/control.c
+++ b/usr.sbin/ldapd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.13 2016/01/17 08:13:34 landry Exp $ */
+/* $OpenBSD: control.c,v 1.14 2017/01/09 14:04:31 krw Exp $ */
/*
* Copyright (c) 2010 Martin Hedenfalk <martin@bzero.se>
@@ -163,9 +163,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);
}
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);
}
diff --git a/usr.sbin/ntpd/control.c b/usr.sbin/ntpd/control.c
index a9a3941a7ca..e726b8e574f 100644
--- a/usr.sbin/ntpd/control.c
+++ b/usr.sbin/ntpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.11 2016/09/14 13:20:16 rzalamena Exp $ */
+/* $OpenBSD: control.c,v 1.12 2017/01/09 14:04:31 krw Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -142,9 +142,10 @@ control_connbyfd(int fd)
{
struct ctl_conn *c;
- for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->ibuf.fd != fd;
- c = TAILQ_NEXT(c, entry))
- ; /* nothing */
+ TAILQ_FOREACH(c, &ctl_conns, entry) {
+ if (c->ibuf.fd == fd)
+ break;
+ }
return (c);
}
diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c
index 57a9a515b16..04bb2c853d4 100644
--- a/usr.sbin/relayd/control.c
+++ b/usr.sbin/relayd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.54 2016/09/26 16:25:16 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.55 2017/01/09 14:04:31 krw Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -181,9 +181,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);
}
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);
}
diff --git a/usr.sbin/vmd/control.c b/usr.sbin/vmd/control.c
index d370254f8e8..af0a2d1da10 100644
--- a/usr.sbin/vmd/control.c
+++ b/usr.sbin/vmd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.9 2016/10/12 19:10:03 reyk Exp $ */
+/* $OpenBSD: control.c,v 1.10 2017/01/09 14:04:31 krw Exp $ */
/*
* Copyright (c) 2010-2015 Reyk Floeter <reyk@openbsd.org>
@@ -249,9 +249,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);
}