summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2003-12-21 14:57:20 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2003-12-21 14:57:20 +0000
commit4305e8e49b42418eedda090cbce276f87113e69f (patch)
tree461c4156550866e5cde4ae82a8d5c729fa96ad82
parent6aa7ecedc0a203bcc56e2e1c2e33b99c0a601942 (diff)
use CIRCLEQ* for pcb's; ok deraadt, henning, mcbride, with help from canacar
-rw-r--r--sys/netinet/in_pcb.c16
-rw-r--r--sys/netinet/raw_ip.c6
-rw-r--r--sys/netinet/udp_usrreq.c6
-rw-r--r--sys/netinet6/icmp6.c7
-rw-r--r--sys/netinet6/in6_pcb.c8
-rw-r--r--sys/netinet6/raw_ip6.c7
6 files changed, 20 insertions, 30 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index add245ba2a4..525172c5b34 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.71 2003/12/10 07:22:43 itojun Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.72 2003/12/21 14:57:19 markus Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -591,11 +591,11 @@ in_pcbnotify(table, dst, fport_arg, laddr, lport_arg, errno, notify)
if (faddr.s_addr == INADDR_ANY)
return;
- for (inp = table->inpt_queue.cqh_first;
- inp != (struct inpcb *)&table->inpt_queue;) {
+ for (inp = CIRCLEQ_FIRST(&table->inpt_queue);
+ inp != CIRCLEQ_END(&table->inpt_queue);) {
#ifdef INET6
if (inp->inp_flags & INP_IPV6) {
- inp = inp->inp_queue.cqe_next;
+ inp = CIRCLEQ_NEXT(inp, inp_queue);
continue;
}
#endif
@@ -604,11 +604,11 @@ in_pcbnotify(table, dst, fport_arg, laddr, lport_arg, errno, notify)
inp->inp_fport != fport ||
inp->inp_lport != lport ||
inp->inp_laddr.s_addr != laddr.s_addr) {
- inp = inp->inp_queue.cqe_next;
+ inp = CIRCLEQ_NEXT(inp, inp_queue);
continue;
}
oinp = inp;
- inp = inp->inp_queue.cqe_next;
+ inp = CIRCLEQ_NEXT(inp, inp_queue);
if (notify)
(*notify)(oinp, errno);
}
@@ -642,13 +642,13 @@ in_pcbnotifyall(table, dst, errno, notify)
inp != (struct inpcb *)&table->inpt_queue;) {
#ifdef INET6
if (inp->inp_flags & INP_IPV6) {
- inp = inp->inp_queue.cqe_next;
+ inp = CIRCLEQ_NEXT(inp, inp_queue);
continue;
}
#endif
if (inp->inp_faddr.s_addr != faddr.s_addr ||
inp->inp_socket == 0) {
- inp = inp->inp_queue.cqe_next;
+ inp = CIRCLEQ_NEXT(inp, inp_queue);
continue;
}
oinp = inp;
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 9b9dba7f606..df0cc77c67d 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip.c,v 1.31 2003/12/10 07:22:43 itojun Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.32 2003/12/21 14:57:19 markus Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
@@ -124,9 +124,7 @@ rip_input(struct mbuf *m, ...)
struct socket *last = 0;
ripsrc.sin_addr = ip->ip_src;
- for (inp = rawcbtable.inpt_queue.cqh_first;
- inp != (struct inpcb *)&rawcbtable.inpt_queue;
- inp = inp->inp_queue.cqe_next) {
+ CIRCLEQ_FOREACH(inp, &rawcbtable.inpt_queue, inp_queue) {
#ifdef INET6
if (inp->inp_flags & INP_IPV6)
continue;
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index a338bc6cc30..1658f4ebe2d 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.95 2003/12/10 07:22:43 itojun Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.96 2003/12/21 14:57:19 markus Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -410,9 +410,7 @@ udp_input(struct mbuf *m, ...)
* (Algorithm copied from raw_intr().)
*/
last = NULL;
- for (inp = udbtable.inpt_queue.cqh_first;
- inp != (struct inpcb *)&udbtable.inpt_queue;
- inp = inp->inp_queue.cqe_next) {
+ CIRCLEQ_FOREACH(inp, &udbtable.inpt_queue, inp_queue) {
#ifdef INET6
/* don't accept it if AF does not match */
if (ip6 && !(inp->inp_flags & INP_IPV6))
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 91295bfbf8a..64e36b19772 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.75 2003/10/01 21:41:05 itojun Exp $ */
+/* $OpenBSD: icmp6.c,v 1.76 2003/12/21 14:57:19 markus Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -1907,10 +1907,7 @@ icmp6_rip6_input(mp, off)
/* KAME hack: recover scopeid */
(void)in6_recoverscope(&rip6src, &ip6->ip6_src, m->m_pkthdr.rcvif);
- for (in6p = rawin6pcbtable.inpt_queue.cqh_first;
- in6p != (struct inpcb *)&rawin6pcbtable.inpt_queue;
- in6p = in6p->inp_queue.cqe_next)
- {
+ CIRCLEQ_FOREACH(in6p, &rawin6pcbtable.inpt_queue, inp_queue) {
if (!(in6p->in6p_flags & INP_IPV6))
continue;
if (in6p->in6p_ip6_nxt != IPPROTO_ICMPV6)
diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c
index b11faf5aeac..34f78a97e96 100644
--- a/sys/netinet6/in6_pcb.c
+++ b/sys/netinet6/in6_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_pcb.c,v 1.38 2003/11/04 22:39:38 markus Exp $ */
+/* $OpenBSD: in6_pcb.c,v 1.39 2003/12/21 14:57:19 markus Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -593,9 +593,9 @@ in6_pcbnotify(head, dst, fport_arg, src, lport_arg, cmd, cmdarg, notify)
}
errno = inet6ctlerrmap[cmd];
- for (inp = head->inpt_queue.cqh_first;
- inp != (struct inpcb *)&head->inpt_queue; inp = ninp) {
- ninp = inp->inp_queue.cqe_next;
+ for (inp = CIRCLEQ_FIRST(&head->inpt_queue);
+ inp != CIRCLEQ_END(&head->inpt_queue); inp = ninp) {
+ ninp = CIRCLEQ_NEXT(inp, inp_queue);
if ((inp->inp_flags & INP_IPV6) == 0)
continue;
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index 33c8f977f38..1c25d12dccb 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip6.c,v 1.21 2003/10/01 21:41:05 itojun Exp $ */
+/* $OpenBSD: raw_ip6.c,v 1.22 2003/12/21 14:57:19 markus Exp $ */
/* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */
/*
@@ -176,10 +176,7 @@ rip6_input(mp, offp, proto)
/* KAME hack: recover scopeid */
(void)in6_recoverscope(&rip6src, &ip6->ip6_src, m->m_pkthdr.rcvif);
- for (in6p = rawin6pcbtable.inpt_queue.cqh_first;
- in6p != (struct inpcb *)&rawin6pcbtable.inpt_queue;
- in6p = in6p->inp_queue.cqe_next)
- {
+ CIRCLEQ_FOREACH(in6p, &rawin6pcbtable.inpt_queue, inp_queue) {
if (!(in6p->in6p_flags & INP_IPV6))
continue;
if (in6p->in6p_ip6.ip6_nxt &&