mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 16:57:44 +00:00
ldpd: replace hand-rolled 'for' loop with specialized macro
No intentional functional change. Original author: Kenneth R Westerback <krw@openbsd.org> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
bc6cec21c4
commit
b53f7b86ef
@ -148,9 +148,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);
|
||||
}
|
||||
@ -160,9 +161,10 @@ control_connbypid(pid_t pid)
|
||||
{
|
||||
struct ctl_conn *c;
|
||||
|
||||
for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->iev.ibuf.pid != pid;
|
||||
c = TAILQ_NEXT(c, entry))
|
||||
; /* nothing */
|
||||
TAILQ_FOREACH(c, &ctl_conns, entry) {
|
||||
if (c->iev.ibuf.pid == pid)
|
||||
break;
|
||||
}
|
||||
|
||||
return (c);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user