summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c36
1 files changed, 18 insertions, 18 deletions
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);
}
OpenPOWER on IntegriCloud