diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2009-03-15 09:58:31 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2009-03-15 09:58:31 +0000 |
commit | ad71fe3c3507be642a5eff21e7ae843414a62232 (patch) | |
tree | cd3527457fd5c0f562c209d613115359c71177a9 /sys/netinet/in_pcb.c | |
parent | 1723a06485c9a7319c877007ff4d8a2dd584d92c (diff) | |
download | src-ad71fe3c3507be642a5eff21e7ae843414a62232.tar.gz src-ad71fe3c3507be642a5eff21e7ae843414a62232.zip |
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
Notes
Notes:
svn path=/head/; revision=189848
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 6703c88c8257..a10da084b874 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 |