Module Name: src
Committed By: christos
Date: Sat Nov 23 14:20:22 UTC 2013
Modified Files:
src/sys/netinet: in_pcb.c in_pcb_hdr.h raw_ip.c tcp_subr.c tcp_usrreq.c
udp_usrreq.c
src/sys/netinet6: icmp6.c in6_pcb.c raw_ip6.c
Log Message:
convert from CIRCLEQ to TAILQ.
To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/netinet/in_pcb.c
cvs rdiff -u -r1.8 -r1.9 src/sys/netinet/in_pcb_hdr.h
cvs rdiff -u -r1.116 -r1.117 src/sys/netinet/raw_ip.c
cvs rdiff -u -r1.251 -r1.252 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.168 -r1.169 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.190 -r1.191 src/sys/netinet/udp_usrreq.c
cvs rdiff -u -r1.162 -r1.163 src/sys/netinet6/icmp6.c
cvs rdiff -u -r1.123 -r1.124 src/sys/netinet6/in6_pcb.c
cvs rdiff -u -r1.111 -r1.112 src/sys/netinet6/raw_ip6.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netinet/in_pcb.c
diff -u src/sys/netinet/in_pcb.c:1.145 src/sys/netinet/in_pcb.c:1.146
--- src/sys/netinet/in_pcb.c:1.145 Wed Jun 5 15:01:26 2013
+++ src/sys/netinet/in_pcb.c Sat Nov 23 09:20:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb.c,v 1.145 2013/06/05 19:01:26 christos Exp $ */
+/* $NetBSD: in_pcb.c,v 1.146 2013/11/23 14:20:21 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -93,7 +93,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.145 2013/06/05 19:01:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.146 2013/11/23 14:20:21 christos Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -172,7 +172,7 @@ in_pcbinit(struct inpcbtable *table, int
{
static ONCE_DECL(control);
- CIRCLEQ_INIT(&table->inpt_queue);
+ TAILQ_INIT(&table->inpt_queue);
table->inpt_porthashtbl = hashinit(bindhashsize, HASH_LIST, true,
&table->inpt_porthash);
table->inpt_bindhashtbl = hashinit(bindhashsize, HASH_LIST, true,
@@ -218,8 +218,7 @@ in_pcballoc(struct socket *so, void *v)
#endif
so->so_pcb = inp;
s = splnet();
- CIRCLEQ_INSERT_HEAD(&table->inpt_queue, &inp->inp_head,
- inph_queue);
+ TAILQ_INSERT_HEAD(&table->inpt_queue, &inp->inp_head, inph_queue);
LIST_INSERT_HEAD(INPCBHASH_PORT(table, inp->inp_lport), &inp->inp_head,
inph_lhash);
in_pcbstate(inp, INP_ATTACHED);
@@ -602,8 +601,7 @@ in_pcbdetach(void *v)
s = splnet();
in_pcbstate(inp, INP_ATTACHED);
LIST_REMOVE(&inp->inp_head, inph_lhash);
- CIRCLEQ_REMOVE(&inp->inp_table->inpt_queue, &inp->inp_head,
- inph_queue);
+ TAILQ_REMOVE(&inp->inp_table->inpt_queue, &inp->inp_head, inph_queue);
pool_put(&inpcb_pool, inp);
splx(s);
sofree(so); /* drops the socket's lock */
@@ -681,15 +679,13 @@ void
in_pcbnotifyall(struct inpcbtable *table, struct in_addr faddr, int errno,
void (*notify)(struct inpcb *, int))
{
- struct inpcb *inp, *ninp;
+ struct inpcb_hdr *inph, *ninph;
if (in_nullhost(faddr) || notify == 0)
return;
- for (inp = (struct inpcb *)CIRCLEQ_FIRST(&table->inpt_queue);
- inp != (void *)&table->inpt_queue;
- inp = ninp) {
- ninp = (struct inpcb *)CIRCLEQ_NEXT(inp, inp_queue);
+ TAILQ_FOREACH_SAFE(inph, &table->inpt_queue, inph_queue, ninph) {
+ struct inpcb *inp = (struct inpcb *)inph;
if (inp->inp_af != AF_INET)
continue;
if (in_hosteq(inp->inp_faddr, faddr))
@@ -700,14 +696,12 @@ in_pcbnotifyall(struct inpcbtable *table
void
in_pcbpurgeif0(struct inpcbtable *table, struct ifnet *ifp)
{
- struct inpcb *inp, *ninp;
+ struct inpcb_hdr *inph, *ninph;
struct ip_moptions *imo;
int i, gap;
- for (inp = (struct inpcb *)CIRCLEQ_FIRST(&table->inpt_queue);
- inp != (void *)&table->inpt_queue;
- inp = ninp) {
- ninp = (struct inpcb *)CIRCLEQ_NEXT(inp, inp_queue);
+ TAILQ_FOREACH_SAFE(inph, &table->inpt_queue, inph_queue, ninph) {
+ struct inpcb *inp = (struct inpcb *)inph;
if (inp->inp_af != AF_INET)
continue;
imo = inp->inp_moptions;
@@ -741,12 +735,10 @@ void
in_pcbpurgeif(struct inpcbtable *table, struct ifnet *ifp)
{
struct rtentry *rt;
- struct inpcb *inp, *ninp;
+ struct inpcb_hdr *inph, *ninph;
- for (inp = (struct inpcb *)CIRCLEQ_FIRST(&table->inpt_queue);
- inp != (void *)&table->inpt_queue;
- inp = ninp) {
- ninp = (struct inpcb *)CIRCLEQ_NEXT(inp, inp_queue);
+ TAILQ_FOREACH_SAFE(inph, &table->inpt_queue, inph_queue, ninph) {
+ struct inpcb *inp = (struct inpcb *)inph;
if (inp->inp_af != AF_INET)
continue;
if ((rt = rtcache_validate(&inp->inp_route)) != NULL &&
Index: src/sys/netinet/in_pcb_hdr.h
diff -u src/sys/netinet/in_pcb_hdr.h:1.8 src/sys/netinet/in_pcb_hdr.h:1.9
--- src/sys/netinet/in_pcb_hdr.h:1.8 Mon Jun 25 11:28:39 2012
+++ src/sys/netinet/in_pcb_hdr.h Sat Nov 23 09:20:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: in_pcb_hdr.h,v 1.8 2012/06/25 15:28:39 christos Exp $ */
+/* $NetBSD: in_pcb_hdr.h,v 1.9 2013/11/23 14:20:21 christos Exp $ */
/*
* Copyright (C) 2003 WIDE Project.
@@ -73,7 +73,7 @@ struct inpcbpolicy;
struct inpcb_hdr {
LIST_ENTRY(inpcb_hdr) inph_hash;
LIST_ENTRY(inpcb_hdr) inph_lhash;
- CIRCLEQ_ENTRY(inpcb_hdr) inph_queue;
+ TAILQ_ENTRY(inpcb_hdr) inph_queue;
int inph_af; /* address family - AF_INET */
void * inph_ppcb; /* pointer to per-protocol pcb */
int inph_state; /* bind/connect state */
@@ -111,7 +111,7 @@ typedef struct vestigial_hooks {
} vestigial_hooks_t;
struct inpcbtable {
- CIRCLEQ_HEAD(, inpcb_hdr) inpt_queue;
+ TAILQ_HEAD(, inpcb_hdr) inpt_queue;
struct inpcbhead *inpt_porthashtbl;
struct inpcbhead *inpt_bindhashtbl;
struct inpcbhead *inpt_connecthashtbl;
Index: src/sys/netinet/raw_ip.c
diff -u src/sys/netinet/raw_ip.c:1.116 src/sys/netinet/raw_ip.c:1.117
--- src/sys/netinet/raw_ip.c:1.116 Wed Jun 5 15:01:26 2013
+++ src/sys/netinet/raw_ip.c Sat Nov 23 09:20:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip.c,v 1.116 2013/06/05 19:01:26 christos Exp $ */
+/* $NetBSD: raw_ip.c,v 1.117 2013/11/23 14:20:21 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.116 2013/06/05 19:01:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.117 2013/11/23 14:20:21 christos Exp $");
#include "opt_inet.h"
#include "opt_compat_netbsd.h"
@@ -189,7 +189,7 @@ rip_input(struct mbuf *m, ...)
ip->ip_len = ntohs(ip->ip_len) - hlen;
NTOHS(ip->ip_off);
- CIRCLEQ_FOREACH(inph, &rawcbtable.inpt_queue, inph_queue) {
+ TAILQ_FOREACH(inph, &rawcbtable.inpt_queue, inph_queue) {
inp = (struct inpcb *)inph;
if (inp->inp_af != AF_INET)
continue;
@@ -247,14 +247,12 @@ rip_pcbnotify(struct inpcbtable *table,
struct in_addr faddr, struct in_addr laddr, int proto, int errno,
void (*notify)(struct inpcb *, int))
{
- struct inpcb *inp, *ninp;
+ struct inpcb_hdr *inph, *ninph;
int nmatch;
nmatch = 0;
- for (inp = (struct inpcb *)CIRCLEQ_FIRST(&table->inpt_queue);
- inp != (struct inpcb *)&table->inpt_queue;
- inp = ninp) {
- ninp = (struct inpcb *)inp->inp_queue.cqe_next;
+ TAILQ_FOREACH_SAFE(inph, &table->inpt_queue, inph_queue, ninph) {
+ struct inpcb *inp = (struct inpcb *)inph;
if (inp->inp_af != AF_INET)
continue;
if (inp->inp_ip.ip_p && inp->inp_ip.ip_p != proto)
Index: src/sys/netinet/tcp_subr.c
diff -u src/sys/netinet/tcp_subr.c:1.251 src/sys/netinet/tcp_subr.c:1.252
--- src/sys/netinet/tcp_subr.c:1.251 Tue Nov 12 04:02:05 2013
+++ src/sys/netinet/tcp_subr.c Sat Nov 23 09:20:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_subr.c,v 1.251 2013/11/12 09:02:05 kefren Exp $ */
+/* $NetBSD: tcp_subr.c,v 1.252 2013/11/23 14:20:21 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.251 2013/11/12 09:02:05 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.252 2013/11/23 14:20:21 christos Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -1351,7 +1351,7 @@ tcp_drain(void)
/*
* Free the sequence queue of all TCP connections.
*/
- CIRCLEQ_FOREACH(inph, &tcbtable.inpt_queue, inph_queue) {
+ TAILQ_FOREACH(inph, &tcbtable.inpt_queue, inph_queue) {
switch (inph->inph_af) {
case AF_INET:
tp = intotcpcb((struct inpcb *)inph);
Index: src/sys/netinet/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.168 src/sys/netinet/tcp_usrreq.c:1.169
--- src/sys/netinet/tcp_usrreq.c:1.168 Fri Oct 4 12:20:35 2013
+++ src/sys/netinet/tcp_usrreq.c Sat Nov 23 09:20:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_usrreq.c,v 1.168 2013/10/04 16:20:35 christos Exp $ */
+/* $NetBSD: tcp_usrreq.c,v 1.169 2013/11/23 14:20:21 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -95,7 +95,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.168 2013/10/04 16:20:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.169 2013/11/23 14:20:21 christos Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -1396,10 +1396,6 @@ sysctl_inpcblist(SYSCTLFN_ARGS)
struct sockaddr_in6 *in6;
const struct in6pcb *in6p;
#endif
- /*
- * sysctl_data is const, but CIRCLEQ_FOREACH can't use a const
- * struct inpcbtable pointer, so we have to discard const. :-/
- */
struct inpcbtable *pcbtbl = __UNCONST(rnode->sysctl_data);
const struct inpcb_hdr *inph;
struct tcpcb *tp;
@@ -1439,7 +1435,7 @@ sysctl_inpcblist(SYSCTLFN_ARGS)
mutex_enter(softnet_lock);
- CIRCLEQ_FOREACH(inph, &pcbtbl->inpt_queue, inph_queue) {
+ TAILQ_FOREACH(inph, &pcbtbl->inpt_queue, inph_queue) {
#ifdef INET
inp = (const struct inpcb *)inph;
#endif
Index: src/sys/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.190 src/sys/netinet/udp_usrreq.c:1.191
--- src/sys/netinet/udp_usrreq.c:1.190 Wed Jun 5 15:01:26 2013
+++ src/sys/netinet/udp_usrreq.c Sat Nov 23 09:20:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: udp_usrreq.c,v 1.190 2013/06/05 19:01:26 christos Exp $ */
+/* $NetBSD: udp_usrreq.c,v 1.191 2013/11/23 14:20:21 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.190 2013/06/05 19:01:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.191 2013/11/23 14:20:21 christos Exp $");
#include "opt_inet.h"
#include "opt_compat_netbsd.h"
@@ -766,7 +766,7 @@ udp4_realinput(struct sockaddr_in *src,
/*
* Locate pcb(s) for datagram.
*/
- CIRCLEQ_FOREACH(inph, &udbtable.inpt_queue, inph_queue) {
+ TAILQ_FOREACH(inph, &udbtable.inpt_queue, inph_queue) {
inp = (struct inpcb *)inph;
if (inp->inp_af != AF_INET)
continue;
@@ -911,7 +911,7 @@ udp6_realinput(int af, struct sockaddr_i
/*
* Locate pcb(s) for datagram.
*/
- CIRCLEQ_FOREACH(inph, &udbtable.inpt_queue, inph_queue) {
+ TAILQ_FOREACH(inph, &udbtable.inpt_queue, inph_queue) {
in6p = (struct in6pcb *)inph;
if (in6p->in6p_af != AF_INET6)
continue;
Index: src/sys/netinet6/icmp6.c
diff -u src/sys/netinet6/icmp6.c:1.162 src/sys/netinet6/icmp6.c:1.163
--- src/sys/netinet6/icmp6.c:1.162 Wed Jun 5 15:01:26 2013
+++ src/sys/netinet6/icmp6.c Sat Nov 23 09:20:22 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: icmp6.c,v 1.162 2013/06/05 19:01:26 christos Exp $ */
+/* $NetBSD: icmp6.c,v 1.163 2013/11/23 14:20:22 christos Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.162 2013/06/05 19:01:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.163 2013/11/23 14:20:22 christos Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -1878,7 +1878,7 @@ icmp6_rip6_input(struct mbuf **mp, int o
return (IPPROTO_DONE);
}
- CIRCLEQ_FOREACH(inph, &raw6cbtable.inpt_queue, inph_queue) {
+ TAILQ_FOREACH(inph, &raw6cbtable.inpt_queue, inph_queue) {
in6p = (struct in6pcb *)inph;
if (in6p->in6p_af != AF_INET6)
continue;
Index: src/sys/netinet6/in6_pcb.c
diff -u src/sys/netinet6/in6_pcb.c:1.123 src/sys/netinet6/in6_pcb.c:1.124
--- src/sys/netinet6/in6_pcb.c:1.123 Wed Jun 5 15:01:26 2013
+++ src/sys/netinet6/in6_pcb.c Sat Nov 23 09:20:22 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_pcb.c,v 1.123 2013/06/05 19:01:26 christos Exp $ */
+/* $NetBSD: in6_pcb.c,v 1.124 2013/11/23 14:20:22 christos Exp $ */
/* $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.123 2013/06/05 19:01:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.124 2013/11/23 14:20:22 christos Exp $");
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -184,7 +184,7 @@ in6_pcballoc(struct socket *so, void *v)
}
#endif /* IPSEC */
s = splnet();
- CIRCLEQ_INSERT_HEAD(&table->inpt_queue, (struct inpcb_hdr*)in6p,
+ TAILQ_INSERT_HEAD(&table->inpt_queue, (struct inpcb_hdr*)in6p,
inph_queue);
LIST_INSERT_HEAD(IN6PCBHASH_PORT(table, in6p->in6p_lport),
&in6p->in6p_head, inph_lhash);
@@ -611,7 +611,7 @@ in6_pcbdetach(struct in6pcb *in6p)
s = splnet();
in6_pcbstate(in6p, IN6P_ATTACHED);
LIST_REMOVE(&in6p->in6p_head, inph_lhash);
- CIRCLEQ_REMOVE(&in6p->in6p_table->inpt_queue, &in6p->in6p_head,
+ TAILQ_REMOVE(&in6p->in6p_table->inpt_queue, &in6p->in6p_head,
inph_queue);
pool_put(&in6pcb_pool, in6p);
splx(s);
@@ -667,7 +667,7 @@ in6_pcbnotify(struct inpcbtable *table,
void *cmdarg, void (*notify)(struct in6pcb *, int))
{
struct rtentry *rt;
- struct in6pcb *in6p, *nin6p;
+ struct inpcb_hdr *inph, *ninph;
struct sockaddr_in6 sa6_src;
const struct sockaddr_in6 *sa6_dst;
u_int16_t fport = fport_arg, lport = lport_arg;
@@ -706,11 +706,8 @@ in6_pcbnotify(struct inpcbtable *table,
}
errno = inet6ctlerrmap[cmd];
- for (in6p = (struct in6pcb *)CIRCLEQ_FIRST(&table->inpt_queue);
- in6p != (void *)&table->inpt_queue;
- in6p = nin6p) {
- nin6p = (struct in6pcb *)CIRCLEQ_NEXT(in6p, in6p_queue);
-
+ TAILQ_FOREACH_SAFE(inph, &table->inpt_queue, inph_queue, ninph) {
+ struct in6pcb *in6p = (struct in6pcb *)inph;
if (in6p->in6p_af != AF_INET6)
continue;
@@ -810,14 +807,12 @@ in6_pcbnotify(struct inpcbtable *table,
void
in6_pcbpurgeif0(struct inpcbtable *table, struct ifnet *ifp)
{
- struct in6pcb *in6p, *nin6p;
+ struct inpcb_hdr *inph, *ninph;
struct ip6_moptions *im6o;
struct in6_multi_mship *imm, *nimm;
- for (in6p = (struct in6pcb *)CIRCLEQ_FIRST(&table->inpt_queue);
- in6p != (void *)&table->inpt_queue;
- in6p = nin6p) {
- nin6p = (struct in6pcb *)CIRCLEQ_NEXT(in6p, in6p_queue);
+ TAILQ_FOREACH_SAFE(inph, &table->inpt_queue, inph_queue, ninph) {
+ struct in6pcb *in6p = (struct in6pcb *)inph;
if (in6p->in6p_af != AF_INET6)
continue;
@@ -852,12 +847,10 @@ void
in6_pcbpurgeif(struct inpcbtable *table, struct ifnet *ifp)
{
struct rtentry *rt;
- struct in6pcb *in6p, *nin6p;
+ struct inpcb_hdr *inph, *ninph;
- for (in6p = (struct in6pcb *)CIRCLEQ_FIRST(&table->inpt_queue);
- in6p != (void *)&table->inpt_queue;
- in6p = nin6p) {
- nin6p = (struct in6pcb *)CIRCLEQ_NEXT(in6p, in6p_queue);
+ TAILQ_FOREACH_SAFE(inph, &table->inpt_queue, inph_queue, ninph) {
+ struct in6pcb *in6p = (struct in6pcb *)inph;
if (in6p->in6p_af != AF_INET6)
continue;
if ((rt = rtcache_validate(&in6p->in6p_route)) != NULL &&
Index: src/sys/netinet6/raw_ip6.c
diff -u src/sys/netinet6/raw_ip6.c:1.111 src/sys/netinet6/raw_ip6.c:1.112
--- src/sys/netinet6/raw_ip6.c:1.111 Wed Jun 5 15:01:26 2013
+++ src/sys/netinet6/raw_ip6.c Sat Nov 23 09:20:22 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: raw_ip6.c,v 1.111 2013/06/05 19:01:26 christos Exp $ */
+/* $NetBSD: raw_ip6.c,v 1.112 2013/11/23 14:20:22 christos Exp $ */
/* $KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.111 2013/06/05 19:01:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.112 2013/11/23 14:20:22 christos Exp $");
#include "opt_ipsec.h"
@@ -177,7 +177,7 @@ rip6_input(struct mbuf **mp, int *offp,
return IPPROTO_DONE;
}
- CIRCLEQ_FOREACH(inph, &raw6cbtable.inpt_queue, inph_queue) {
+ TAILQ_FOREACH(inph, &raw6cbtable.inpt_queue, inph_queue) {
in6p = (struct in6pcb *)inph;
if (in6p->in6p_af != AF_INET6)
continue;