summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-03-15 09:58:31 +0000
committerrwatson <rwatson@FreeBSD.org>2009-03-15 09:58:31 +0000
commit038bfe209eeb1f951b217069a584edbcc92d0f2c (patch)
treecd3527457fd5c0f562c209d613115359c71177a9 /sys/netinet/in_pcb.c
parent9fedeedb8d3b7b5964f22521c2fa9bf23fcfa02d (diff)
downloadFreeBSD-src-038bfe209eeb1f951b217069a584edbcc92d0f2c.zip
FreeBSD-src-038bfe209eeb1f951b217069a584edbcc92d0f2c.tar.gz
Correct a number of evolved problems with inp_vflag and inp_flags:
certain flags that should have been in inp_flags ended up in inp_vflag, meaning that they were inconsistently locked, and in one case, interpreted. Move the following flags from inp_vflag to gaps in the inp_flags space (and clean up the inp_flags constants to make gaps more obvious to future takers): INP_TIMEWAIT INP_SOCKREF INP_ONESBCAST INP_DROPPED Some aspects of this change have no effect on kernel ABI at all, as these are UDP/TCP/IP-internal uses; however, netstat and sockstat detect INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this into account. MFC after: 1 week (or after dependencies are MFC'd) Reviewed by: bz
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 6703c88..a10da084 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -384,7 +384,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp,
* This entire block sorely needs a rewrite.
*/
if (t &&
- ((t->inp_vflag & INP_TIMEWAIT) == 0) &&
+ ((t->inp_flags & INP_TIMEWAIT) == 0) &&
(so->so_type != SOCK_STREAM ||
ntohl(t->inp_faddr.s_addr) == INADDR_ANY) &&
(ntohl(sin->sin_addr.s_addr) != INADDR_ANY ||
@@ -397,7 +397,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp,
}
t = in_pcblookup_local(pcbinfo, sin->sin_addr,
lport, wild, cred);
- if (t && (t->inp_vflag & INP_TIMEWAIT)) {
+ if (t && (t->inp_flags & INP_TIMEWAIT)) {
/*
* XXXRW: If an incpb has had its timewait
* state recycled, we treat the address as
@@ -1031,7 +1031,7 @@ in_pcbdrop(struct inpcb *inp)
INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo);
INP_WLOCK_ASSERT(inp);
- inp->inp_vflag |= INP_DROPPED;
+ inp->inp_flags |= INP_DROPPED;
if (inp->inp_flags & INP_INHASHLIST) {
struct inpcbport *phd = inp->inp_phd;
@@ -1818,6 +1818,22 @@ db_print_inpflags(int inp_flags)
db_printf("%sIN6P_AUTOFLOWLABEL", comma ? ", " : "");
comma = 1;
}
+ if (inp_flags & INP_TIMEWAIT) {
+ db_printf("%sINP_TIMEWAIT", comma ? ", " : "");
+ comma = 1;
+ }
+ if (inp_flags & INP_ONESBCAST) {
+ db_printf("%sINP_ONESBCAST", comma ? ", " : "");
+ comma = 1;
+ }
+ if (inp_flags & INP_DROPPED) {
+ db_printf("%sINP_DROPPED", comma ? ", " : "");
+ comma = 1;
+ }
+ if (inp_flags & INP_SOCKREF) {
+ db_printf("%sINP_SOCKREF", comma ? ", " : "");
+ comma = 1;
+ }
if (inp_flags & IN6P_RFC2292) {
db_printf("%sIN6P_RFC2292", comma ? ", " : "");
comma = 1;
@@ -1846,22 +1862,6 @@ db_print_inpvflag(u_char inp_vflag)
db_printf("%sINP_IPV6PROTO", comma ? ", " : "");
comma = 1;
}
- if (inp_vflag & INP_TIMEWAIT) {
- db_printf("%sINP_TIMEWAIT", comma ? ", " : "");
- comma = 1;
- }
- if (inp_vflag & INP_ONESBCAST) {
- db_printf("%sINP_ONESBCAST", comma ? ", " : "");
- comma = 1;
- }
- if (inp_vflag & INP_DROPPED) {
- db_printf("%sINP_DROPPED", comma ? ", " : "");
- comma = 1;
- }
- if (inp_vflag & INP_SOCKREF) {
- db_printf("%sINP_SOCKREF", comma ? ", " : "");
- comma = 1;
- }
}
void
OpenPOWER on IntegriCloud