diff options
Diffstat (limited to 'usr.sbin/npppd/npppd/control.c')
-rw-r--r-- | usr.sbin/npppd/npppd/control.c | 9 |
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); } |