summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-02-04 13:13:25 +0000
committerphk <phk@FreeBSD.org>2001-02-04 13:13:25 +0000
commite87f7a15ad62e1dd25061ddb301662e809692c2c (patch)
tree5f0ba9ebd57fbfd6e13f2b9403d96e9bfae48d8f /sys/netinet/ip_divert.c
parentf3b4fbe35f6e8e9d09f742c114281d8e9984d135 (diff)
downloadFreeBSD-src-e87f7a15ad62e1dd25061ddb301662e809692c2c.zip
FreeBSD-src-e87f7a15ad62e1dd25061ddb301662e809692c2c.tar.gz
Mechanical change to use <sys/queue.h> macro API instead of
fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 04e931a..df5ec22 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -174,8 +174,7 @@ divert_packet(struct mbuf *m, int incoming, int port)
KASSERT((m->m_flags & M_PKTHDR), ("%s: !PKTHDR", __FUNCTION__));
/* Find IP address for receive interface */
- for (ifa = m->m_pkthdr.rcvif->if_addrhead.tqh_first;
- ifa != NULL; ifa = ifa->ifa_link.tqe_next) {
+ TAILQ_FOREACH(ifa, &m->m_pkthdr.rcvif->if_addrhead, ifa_link) {
if (ifa->ifa_addr == NULL)
continue;
if (ifa->ifa_addr->sa_family != AF_INET)
@@ -216,7 +215,7 @@ divert_packet(struct mbuf *m, int incoming, int port)
/* Put packet on socket queue, if any */
sa = NULL;
nport = htons((u_int16_t)port);
- for (inp = divcb.lh_first; inp != NULL; inp = inp->inp_list.le_next) {
+ LIST_FOREACH(inp, &divcb, inp_list) {
if (inp->inp_lport == nport)
sa = inp->inp_socket;
}
@@ -491,8 +490,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
return ENOMEM;
s = splnet();
- for (inp = divcbinfo.listhead->lh_first, i = 0; inp && i < n;
- inp = inp->inp_list.le_next) {
+ for (inp = LIST_FIRST(divcbinfo.listhead), i = 0; inp && i < n;
+ inp = LIST_NEXT(inp, inp_list)) {
if (inp->inp_gencnt <= gencnt && !prison_xinpcb(req->p, inp))
inp_list[i++] = inp;
}
OpenPOWER on IntegriCloud