diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-27 05:35:52 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2001-06-27 05:35:52 +0000 |
commit | be751fa076cade7b4674f16fd1b05137982ce2ed (patch) | |
tree | 0936c69e34687f0f70654c2059b57c5778e94a71 /sys/netinet/ip_spd.c | |
parent | 7eaf21ab1e2fc8124876db3bd195c465d6f12cc7 (diff) |
Use TAILQ_FOREACH() instead of hand-crafted for loops.
Diffstat (limited to 'sys/netinet/ip_spd.c')
-rw-r--r-- | sys/netinet/ip_spd.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/netinet/ip_spd.c b/sys/netinet/ip_spd.c index 18bceb4aba0..7e9554369be 100644 --- a/sys/netinet/ip_spd.c +++ b/sys/netinet/ip_spd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_spd.c,v 1.35 2001/06/27 04:44:03 angelos Exp $ */ +/* $OpenBSD: ip_spd.c,v 1.36 2001/06/27 05:35:51 angelos Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -681,8 +681,7 @@ ipsp_pending_acquire(struct ipsec_policy *ipo, union sockaddr_union *gw) { struct ipsec_acquire *ipa; - for (ipa = TAILQ_FIRST(&ipo->ipo_acquires); ipa; - ipa = TAILQ_NEXT(ipa, ipa_next)) { + TAILQ_FOREACH (ipa, &ipo->ipo_acquires, ipa_ipo_next) { if (!bcmp(gw, &ipa->ipa_addr, gw->sa.sa_len)) return ipa; } @@ -852,8 +851,7 @@ ipsec_get_acquire(u_int32_t seq) { struct ipsec_acquire *ipa; - for (ipa = TAILQ_FIRST(&ipsec_acquire_head); ipa; - ipa = TAILQ_NEXT(ipa, ipa_next)) + TAILQ_FOREACH (ipa, &ipsec_acquire_head, ipa_ipo_next) if (ipa->ipa_seq == seq) return ipa; |