summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.c6
-rw-r--r--sys/netinet/in.c18
-rw-r--r--sys/netinet/in_pcb.c36
-rw-r--r--sys/netinet/ip_divert.c9
-rw-r--r--sys/netinet/ip_dummynet.c6
-rw-r--r--sys/netinet/ip_encap.c8
-rw-r--r--sys/netinet/ip_fw.c29
-rw-r--r--sys/netinet/ip_icmp.c4
-rw-r--r--sys/netinet/ip_input.c2
-rw-r--r--sys/netinet/ip_output.c6
-rw-r--r--sys/netinet/raw_ip.c12
-rw-r--r--sys/netinet/tcp_subr.c8
-rw-r--r--sys/netinet/tcp_timewait.c8
-rw-r--r--sys/netinet/udp_usrreq.c4
14 files changed, 77 insertions, 79 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 94d0c11..7044845 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -136,13 +136,13 @@ arptimer(ignored_arg)
void *ignored_arg;
{
int s = splnet();
- register struct llinfo_arp *la = llinfo_arp.lh_first;
+ register struct llinfo_arp *la = LIST_FIRST(&llinfo_arp);
struct llinfo_arp *ola;
timeout(arptimer, (caddr_t)0, arpt_prune * hz);
while ((ola = la) != 0) {
register struct rtentry *rt = la->la_rt;
- la = la->la_le.le_next;
+ la = LIST_NEXT(la, la_le);
if (rt->rt_expire && rt->rt_expire <= time_second)
arptfree(ola); /* timer has expired, clear */
}
@@ -523,7 +523,7 @@ in_arpinput(m)
op = ntohs(ea->arp_op);
(void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));
(void)memcpy(&itaddr, ea->arp_tpa, sizeof (itaddr));
- for (ia = in_ifaddrhead.tqh_first; ia; ia = ia->ia_link.tqe_next)
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link)
#ifdef BRIDGE
/*
* For a bridge, we want to check the address irrespective
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index f8d591e..f7d575b 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -87,13 +87,13 @@ in_localaddr(in)
register struct in_ifaddr *ia;
if (subnetsarelocal) {
- for (ia = in_ifaddrhead.tqh_first; ia;
- ia = ia->ia_link.tqe_next)
+ for (ia = TAILQ_FIRST(&in_ifaddrhead); ia;
+ ia = TAILQ_NEXT(ia, ia_link))
if ((i & ia->ia_netmask) == ia->ia_net)
return (1);
} else {
- for (ia = in_ifaddrhead.tqh_first; ia;
- ia = ia->ia_link.tqe_next)
+ for (ia = TAILQ_FIRST(&in_ifaddrhead); ia;
+ ia = TAILQ_NEXT(ia, ia_link))
if ((i & ia->ia_subnetmask) == ia->ia_subnet)
return (1);
}
@@ -236,8 +236,8 @@ in_control(so, cmd, data, ifp, p)
* the first one on the interface.
*/
if (ifp)
- for (iap = in_ifaddrhead.tqh_first; iap;
- iap = iap->ia_link.tqe_next)
+ for (iap = TAILQ_FIRST(&in_ifaddrhead); iap;
+ iap = TAILQ_NEXT(iap, ia_link))
if (iap->ia_ifp == ifp) {
if (((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr ==
iap->ia_addr.sin_addr.s_addr) {
@@ -257,7 +257,7 @@ in_control(so, cmd, data, ifp, p)
if (ifp == 0)
return (EADDRNOTAVAIL);
if (ifra->ifra_addr.sin_family == AF_INET) {
- for (oia = ia; ia; ia = ia->ia_link.tqe_next) {
+ for (oia = ia; ia; ia = TAILQ_NEXT(ia, ia_link)) {
if (ia->ia_ifp == ifp &&
ia->ia_addr.sin_addr.s_addr ==
ifra->ifra_addr.sin_addr.s_addr)
@@ -742,8 +742,8 @@ in_broadcast(in, ifp)
* with a broadcast address.
*/
#define ia ((struct in_ifaddr *)ifa)
- for (ifa = ifp->if_addrhead.tqh_first; ifa;
- ifa = ifa->ifa_link.tqe_next)
+ for (ifa = TAILQ_FIRST(&ifp->if_addrhead); ifa;
+ ifa = TAILQ_NEXT(ifa, ifa_link))
if (ifa->ifa_addr->sa_family == AF_INET &&
(in.s_addr == ia->ia_broadaddr.sin_addr.s_addr ||
in.s_addr == ia->ia_netbroadcast.s_addr ||
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 5e3383be..6db09f6 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -394,10 +394,10 @@ in_pcbladdr(inp, nam, plocal_sin)
#define sintosa(sin) ((struct sockaddr *)(sin))
#define ifatoia(ifa) ((struct in_ifaddr *)(ifa))
if (sin->sin_addr.s_addr == INADDR_ANY)
- sin->sin_addr = IA_SIN(in_ifaddrhead.tqh_first)->sin_addr;
+ sin->sin_addr = IA_SIN(TAILQ_FIRST(&in_ifaddrhead))->sin_addr;
else if (sin->sin_addr.s_addr == (u_long)INADDR_BROADCAST &&
- (in_ifaddrhead.tqh_first->ia_ifp->if_flags & IFF_BROADCAST))
- sin->sin_addr = satosin(&in_ifaddrhead.tqh_first->ia_broadaddr)->sin_addr;
+ (TAILQ_FIRST(&in_ifaddrhead)->ia_ifp->if_flags & IFF_BROADCAST))
+ sin->sin_addr = satosin(&TAILQ_FIRST(&in_ifaddrhead)->ia_broadaddr)->sin_addr;
}
if (inp->inp_laddr.s_addr == INADDR_ANY) {
register struct route *ro;
@@ -442,7 +442,7 @@ in_pcbladdr(inp, nam, plocal_sin)
ia = ifatoia(ifa_ifwithnet(sintosa(sin)));
sin->sin_port = fport;
if (ia == 0)
- ia = in_ifaddrhead.tqh_first;
+ ia = TAILQ_FIRST(&in_ifaddrhead);
if (ia == 0)
return (EADDRNOTAVAIL);
}
@@ -459,8 +459,8 @@ in_pcbladdr(inp, nam, plocal_sin)
imo = inp->inp_moptions;
if (imo->imo_multicast_ifp != NULL) {
ifp = imo->imo_multicast_ifp;
- for (ia = in_ifaddrhead.tqh_first; ia;
- ia = ia->ia_link.tqe_next)
+ for (ia = TAILQ_FIRST(&in_ifaddrhead); ia;
+ ia = TAILQ_NEXT(ia, ia_link))
if (ia->ia_ifp == ifp)
break;
if (ia == 0)
@@ -709,7 +709,7 @@ in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify, tcp_sequence,
}
errno = inetctlerrmap[cmd];
s = splnet();
- for (inp = head->lh_first; inp != NULL;) {
+ for (inp = LIST_FIRST(head); inp != NULL;) {
#ifdef INET6
if ((inp->inp_vflag & INP_IPV4) == 0) {
inp = LIST_NEXT(inp, inp_list);
@@ -721,7 +721,7 @@ in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify, tcp_sequence,
(lport && inp->inp_lport != lport) ||
(laddr.s_addr && inp->inp_laddr.s_addr != laddr.s_addr) ||
(fport && inp->inp_fport != fport)) {
- inp = inp->inp_list.le_next;
+ inp = LIST_NEXT(inp, inp_list);
continue;
}
/*
@@ -734,11 +734,11 @@ in_pcbnotify(head, dst, fport_arg, laddr, lport_arg, cmd, notify, tcp_sequence,
* and TCP port numbers.
*/
if ((tcp_seq_check == 1) && (tcp_seq_vs_sess(inp, tcp_sequence) == 0)) {
- inp = inp->inp_list.le_next;
+ inp = LIST_NEXT(inp, inp_list);
break;
}
oinp = inp;
- inp = inp->inp_list.le_next;
+ inp = LIST_NEXT(inp, inp_list);
if (notify)
(*notify)(oinp, errno);
}
@@ -819,7 +819,7 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
* matches the local address and port we're looking for.
*/
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
+ LIST_FOREACH(inp, head, inp_hash) {
#ifdef INET6
if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
@@ -849,7 +849,7 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
*/
porthash = &pcbinfo->porthashbase[INP_PCBPORTHASH(lport,
pcbinfo->porthashmask)];
- for (phd = porthash->lh_first; phd != NULL; phd = phd->phd_hash.le_next) {
+ LIST_FOREACH(phd, porthash, phd_hash) {
if (phd->phd_port == lport)
break;
}
@@ -858,8 +858,8 @@ in_pcblookup_local(pcbinfo, laddr, lport_arg, wild_okay)
* Port is in use by one or more PCBs. Look for best
* fit.
*/
- for (inp = phd->phd_pcblist.lh_first; inp != NULL;
- inp = inp->inp_portlist.le_next) {
+ for (inp = LIST_FIRST(&phd->phd_pcblist); inp != NULL;
+ inp = LIST_NEXT(inp, inp_portlist)) {
wildcard = 0;
#ifdef INET6
if ((inp->inp_vflag & INP_IPV4) == 0)
@@ -909,7 +909,7 @@ in_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard,
* First look for an exact match.
*/
head = &pcbinfo->hashbase[INP_PCBHASH(faddr.s_addr, lport, fport, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
+ LIST_FOREACH(inp, head, inp_hash) {
#ifdef INET6
if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
@@ -931,7 +931,7 @@ in_pcblookup_hash(pcbinfo, faddr, fport_arg, laddr, lport_arg, wildcard,
#endif /* defined(INET6) */
head = &pcbinfo->hashbase[INP_PCBHASH(INADDR_ANY, lport, 0, pcbinfo->hashmask)];
- for (inp = head->lh_first; inp != NULL; inp = inp->inp_hash.le_next) {
+ LIST_FOREACH(inp, head, inp_hash) {
#ifdef INET6
if ((inp->inp_vflag & INP_IPV4) == 0)
continue;
@@ -998,7 +998,7 @@ in_pcbinshash(inp)
/*
* Go through port list and look for a head for this lport.
*/
- for (phd = pcbporthash->lh_first; phd != NULL; phd = phd->phd_hash.le_next) {
+ LIST_FOREACH(phd, pcbporthash, phd_hash) {
if (phd->phd_port == inp->inp_lport)
break;
}
@@ -1060,7 +1060,7 @@ in_pcbremlists(inp)
LIST_REMOVE(inp, inp_hash);
LIST_REMOVE(inp, inp_portlist);
- if (phd->phd_pcblist.lh_first == NULL) {
+ if (LIST_FIRST(&phd->phd_pcblist) == NULL) {
LIST_REMOVE(phd, phd_hash);
free(phd, M_PCB);
}
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;
}
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c
index 8060437..c0d436e 100644
--- a/sys/netinet/ip_dummynet.c
+++ b/sys/netinet/ip_dummynet.c
@@ -1282,7 +1282,7 @@ dummynet_flush()
s = splimp() ;
/* remove all references to pipes ...*/
- for (chain= ip_fw_chain.lh_first ; chain; chain = chain->chain.le_next)
+ for (chain= LIST_FIRST(&ip_fw_chain) ; chain; chain = LIST_NEXT(chain, chain))
chain->rule->pipe_ptr = NULL ;
/* prevent future matches... */
p = all_pipes ;
@@ -1658,7 +1658,7 @@ delete_pipe(struct dn_pipe *p)
else
a->next = b->next ;
/* remove references to this pipe from the ip_fw rules. */
- for (chain = ip_fw_chain.lh_first ; chain; chain = chain->chain.le_next)
+ for (chain = LIST_FIRST(&ip_fw_chain) ; chain; chain = LIST_NEXT(chain, chain))
if (chain->rule->pipe_ptr == &(b->fs))
chain->rule->pipe_ptr = NULL ;
@@ -1692,7 +1692,7 @@ delete_pipe(struct dn_pipe *p)
else
a->next = b->next ;
/* remove references to this flow_set from the ip_fw rules. */
- for (chain = ip_fw_chain.lh_first; chain; chain = chain->chain.le_next)
+ LIST_FOREACH(chain, &ip_fw_chain, chain)
if (chain->rule->pipe_ptr == b)
chain->rule->pipe_ptr = NULL ;
diff --git a/sys/netinet/ip_encap.c b/sys/netinet/ip_encap.c
index 7cb8058..7d623ea 100644
--- a/sys/netinet/ip_encap.c
+++ b/sys/netinet/ip_encap.c
@@ -153,7 +153,7 @@ encap4_input(m, va_alist)
match = NULL;
matchprio = 0;
- for (ep = LIST_FIRST(&encaptab); ep; ep = LIST_NEXT(ep, chain)) {
+ LIST_FOREACH(ep, &encaptab, chain) {
if (ep->af != AF_INET)
continue;
if (ep->proto >= 0 && ep->proto != proto)
@@ -249,7 +249,7 @@ encap6_input(mp, offp, proto)
match = NULL;
matchprio = 0;
- for (ep = LIST_FIRST(&encaptab); ep; ep = LIST_NEXT(ep, chain)) {
+ LIST_FOREACH(ep, &encaptab, chain) {
if (ep->af != AF_INET6)
continue;
if (ep->proto >= 0 && ep->proto != proto)
@@ -333,7 +333,7 @@ encap_attach(af, proto, sp, sm, dp, dm, psw, arg)
}
/* check if anyone have already attached with exactly same config */
- for (ep = LIST_FIRST(&encaptab); ep; ep = LIST_NEXT(ep, chain)) {
+ LIST_FOREACH(ep, &encaptab, chain) {
if (ep->af != af)
continue;
if (ep->proto != proto)
@@ -428,7 +428,7 @@ encap_detach(cookie)
const struct encaptab *ep = cookie;
struct encaptab *p;
- for (p = LIST_FIRST(&encaptab); p; p = LIST_NEXT(p, chain)) {
+ LIST_FOREACH(p, &encaptab, chain) {
if (p == ep) {
LIST_REMOVE(p, chain);
free(p, M_NETADDR); /*XXX*/
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index 1aefb7a..19dfb74 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -473,8 +473,7 @@ iface_match(struct ifnet *ifp, union ip_fw_if *ifu, int byname)
} else if (ifu->fu_via_ip.s_addr != 0) { /* Zero == wildcard */
struct ifaddr *ia;
- for (ia = ifp->if_addrhead.tqh_first;
- ia != NULL; ia = ia->ifa_link.tqe_next) {
+ TAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
if (ia->ifa_addr == NULL)
continue;
if (ia->ifa_addr->sa_family != AF_INET)
@@ -904,10 +903,10 @@ lookup_next_rule(struct ip_fw_chain *me)
int rule = me->rule->fw_skipto_rule ; /* guess... */
if ( (me->rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_SKIPTO )
- for (chain = me->chain.le_next; chain ; chain = chain->chain.le_next )
+ for (chain = LIST_NEXT(me, chain); chain ; chain = LIST_NEXT(chain, chain) )
if (chain->rule->fw_number >= rule)
return chain ;
- return me->chain.le_next ; /* failure or not a skipto */
+ return LIST_NEXT(me, chain) ; /* failure or not a skipto */
}
/*
@@ -1462,7 +1461,7 @@ flush_rule_ptrs()
{
struct ip_fw_chain *fcp ;
- for (fcp = ip_fw_chain.lh_first; fcp; fcp = fcp->chain.le_next) {
+ LIST_FOREACH(fcp, &ip_fw_chain, chain) {
fcp->rule->next_rule_ptr = NULL ;
}
}
@@ -1501,7 +1500,7 @@ add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
s = splnet();
- if (chainptr->lh_first == 0) {
+ if (LIST_FIRST(chainptr) == 0) {
LIST_INSERT_HEAD(chainptr, fwc, chain);
splx(s);
return(0);
@@ -1509,7 +1508,7 @@ add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
/* If entry number is 0, find highest numbered rule and add 100 */
if (ftmp->fw_number == 0) {
- for (fcp = LIST_FIRST(chainptr); fcp; fcp = LIST_NEXT(fcp, chain)) {
+ LIST_FOREACH(fcp, chainptr, chain) {
if (fcp->rule->fw_number != (u_short)-1)
nbr = fcp->rule->fw_number;
else
@@ -1521,7 +1520,7 @@ add_entry(struct ip_fw_head *chainptr, struct ip_fw *frwl)
}
/* Got a valid number; now insert it, keeping the list ordered */
- for (fcp = LIST_FIRST(chainptr); fcp; fcp = LIST_NEXT(fcp, chain)) {
+ LIST_FOREACH(fcp, chainptr, chain) {
if (fcp->rule->fw_number > ftmp->fw_number) {
if (fcpl) {
LIST_INSERT_AFTER(fcpl, fwc, chain);
@@ -1583,7 +1582,7 @@ zero_entry(struct ip_fw *frwl)
if (frwl == 0) {
s = splnet();
- for (fcp = LIST_FIRST(&ip_fw_chain); fcp; fcp = LIST_NEXT(fcp, chain)) {
+ LIST_FOREACH(fcp, &ip_fw_chain, chain) {
fcp->rule->fw_bcnt = fcp->rule->fw_pcnt = 0;
fcp->rule->fw_loghighest = fcp->rule->fw_logamount;
fcp->rule->timestamp = 0;
@@ -1598,7 +1597,7 @@ zero_entry(struct ip_fw *frwl)
* same number, so we don't stop after finding the first
* match if zeroing a specific entry.
*/
- for (fcp = LIST_FIRST(&ip_fw_chain); fcp; fcp = LIST_NEXT(fcp, chain))
+ LIST_FOREACH(fcp, &ip_fw_chain, chain)
if (frwl->fw_number == fcp->rule->fw_number) {
s = splnet();
while (fcp && frwl->fw_number == fcp->rule->fw_number) {
@@ -1637,7 +1636,7 @@ resetlog_entry(struct ip_fw *frwl)
if (frwl == 0) {
s = splnet();
counter = 0;
- for (fcp = LIST_FIRST(&ip_fw_chain); fcp; fcp = LIST_NEXT(fcp, chain))
+ LIST_FOREACH(fcp, &ip_fw_chain, chain)
fcp->rule->fw_loghighest = fcp->rule->fw_pcnt +
fcp->rule->fw_logamount;
splx(s);
@@ -1650,7 +1649,7 @@ resetlog_entry(struct ip_fw *frwl)
* same number, so we don't stop after finding the first
* match if zeroing a specific entry.
*/
- for (fcp = LIST_FIRST(&ip_fw_chain); fcp; fcp = LIST_NEXT(fcp, chain))
+ LIST_FOREACH(fcp, &ip_fw_chain, chain)
if (frwl->fw_number == fcp->rule->fw_number) {
s = splnet();
while (fcp && frwl->fw_number == fcp->rule->fw_number) {
@@ -1889,9 +1888,9 @@ ip_fw_ctl(struct sockopt *sopt)
s = splnet();
remove_dyn_rule(NULL, 1 /* force delete */);
splx(s);
- for (fcp = ip_fw_chain.lh_first;
+ for (fcp = LIST_FIRST(&ip_fw_chain);
fcp != 0 && fcp->rule->fw_number != IPFW_DEFAULT_RULE;
- fcp = ip_fw_chain.lh_first) {
+ fcp = LIST_FIRST(&ip_fw_chain)) {
s = splnet();
LIST_REMOVE(fcp, chain);
#ifdef DUMMYNET
@@ -1987,7 +1986,7 @@ ip_fw_init(void)
add_entry(&ip_fw_chain, &default_rule))
panic("ip_fw_init");
- ip_fw_default_rule = ip_fw_chain.lh_first ;
+ ip_fw_default_rule = LIST_FIRST(&ip_fw_chain) ;
printf("IP packet filtering initialized, "
#ifdef IPDIVERT
"divert enabled, "
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index d1694bf..98758ca 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -631,7 +631,7 @@ icmp_reflect(m)
* or anonymous), use the address which corresponds
* to the incoming interface.
*/
- for (ia = in_ifaddrhead.tqh_first; ia; ia = ia->ia_link.tqe_next) {
+ TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) {
if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr)
break;
if (ia->ia_ifp && (ia->ia_ifp->if_flags & IFF_BROADCAST) &&
@@ -647,7 +647,7 @@ icmp_reflect(m)
* and was received on an interface with no IP address.
*/
if (ia == (struct in_ifaddr *)0)
- ia = in_ifaddrhead.tqh_first;
+ ia = TAILQ_FIRST(&in_ifaddrhead);
t = IA_SIN(ia)->sin_addr;
ip->ip_src = t;
ip->ip_ttl = MAXTTL;
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index c73db86..7552234 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -391,7 +391,7 @@ iphack:
*/
m0 = m;
pfh = pfil_hook_get(PFIL_IN, &inetsw[ip_protox[IPPROTO_IP]].pr_pfh);
- for (; pfh; pfh = pfh->pfil_link.tqe_next)
+ for (; pfh; pfh = TAILQ_NEXT(pfh, pfil_link))
if (pfh->pfil_func) {
rv = pfh->pfil_func(ip, hlen,
m->m_pkthdr.rcvif, 0, &m0);
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 1b19fd7..00147da 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -314,8 +314,8 @@ ip_output(m0, opt, ro, flags, imo)
if (ip->ip_src.s_addr == INADDR_ANY) {
register struct in_ifaddr *ia1;
- for (ia1 = in_ifaddrhead.tqh_first; ia1;
- ia1 = ia1->ia_link.tqe_next)
+ for (ia1 = TAILQ_FIRST(&in_ifaddrhead); ia1;
+ ia1 = TAILQ_NEXT(ia1, ia_link))
if (ia1->ia_ifp == ifp) {
ip->ip_src = IA_SIN(ia1)->sin_addr;
break;
@@ -441,7 +441,7 @@ sendit:
*/
m1 = m;
pfh = pfil_hook_get(PFIL_OUT, &inetsw[ip_protox[IPPROTO_IP]].pr_pfh);
- for (; pfh; pfh = pfh->pfil_link.tqe_next)
+ for (; pfh; pfh = TAILQ_NEXT(pfh, pfil_link))
if (pfh->pfil_func) {
rv = pfh->pfil_func(ip, hlen, ifp, 1, &m1);
if (rv) {
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 0342d39..a6e850f 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -385,8 +385,8 @@ rip_ctlinput(cmd, sa, vip)
switch (cmd) {
case PRC_IFDOWN:
- for (ia = in_ifaddrhead.tqh_first; ia;
- ia = ia->ia_link.tqe_next) {
+ for (ia = TAILQ_FIRST(&in_ifaddrhead); ia;
+ ia = TAILQ_NEXT(ia, ia_link)) {
if (ia->ia_ifa.ifa_addr == sa
&& (ia->ia_flags & IFA_ROUTE)) {
/*
@@ -406,8 +406,8 @@ rip_ctlinput(cmd, sa, vip)
break;
case PRC_IFUP:
- for (ia = in_ifaddrhead.tqh_first; ia;
- ia = ia->ia_link.tqe_next) {
+ for (ia = TAILQ_FIRST(&in_ifaddrhead); ia;
+ ia = TAILQ_NEXT(ia, ia_link)) {
if (ia->ia_ifa.ifa_addr == sa)
break;
}
@@ -609,8 +609,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
return ENOMEM;
s = splnet();
- for (inp = ripcbinfo.listhead->lh_first, i = 0; inp && i < n;
- inp = inp->inp_list.le_next) {
+ for (inp = LIST_FIRST(ripcbinfo.listhead), i = 0; inp && i < n;
+ inp = LIST_NEXT(inp, inp_list)) {
if (inp->inp_gencnt <= gencnt)
inp_list[i++] = inp;
}
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 5b1db4f..0da8440 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -749,8 +749,8 @@ tcp_drain()
* where we're really low on mbufs, this is potentially
* usefull.
*/
- for (inpb = tcbinfo.listhead->lh_first; inpb;
- inpb = inpb->inp_list.le_next) {
+ for (inpb = LIST_FIRST(tcbinfo.listhead); inpb;
+ inpb = LIST_NEXT(inpb, inp_list)) {
if ((tcpb = intotcpcb(inpb))) {
while ((te = LIST_FIRST(&tcpb->t_segq))
!= NULL) {
@@ -841,8 +841,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
return ENOMEM;
s = splnet();
- for (inp = tcbinfo.listhead->lh_first, i = 0; inp && i < n;
- inp = inp->inp_list.le_next) {
+ for (inp = LIST_FIRST(tcbinfo.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;
}
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index 5b1db4f..0da8440 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -749,8 +749,8 @@ tcp_drain()
* where we're really low on mbufs, this is potentially
* usefull.
*/
- for (inpb = tcbinfo.listhead->lh_first; inpb;
- inpb = inpb->inp_list.le_next) {
+ for (inpb = LIST_FIRST(tcbinfo.listhead); inpb;
+ inpb = LIST_NEXT(inpb, inp_list)) {
if ((tcpb = intotcpcb(inpb))) {
while ((te = LIST_FIRST(&tcpb->t_segq))
!= NULL) {
@@ -841,8 +841,8 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
return ENOMEM;
s = splnet();
- for (inp = tcbinfo.listhead->lh_first, i = 0; inp && i < n;
- inp = inp->inp_list.le_next) {
+ for (inp = LIST_FIRST(tcbinfo.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;
}
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 5ddcecc..5c92f62 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -560,8 +560,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS)
return ENOMEM;
s = splnet();
- for (inp = udbinfo.listhead->lh_first, i = 0; inp && i < n;
- inp = inp->inp_list.le_next) {
+ for (inp = LIST_FIRST(udbinfo.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