From 038bfe209eeb1f951b217069a584edbcc92d0f2c Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 15 Mar 2009 09:58:31 +0000 Subject: 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 --- sys/netinet6/in6_pcb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/netinet6') diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 79cb213..79e79cb 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -197,7 +197,7 @@ in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam, &sin6->sin6_addr, lport, INPLOOKUP_WILDCARD, cred); if (t && - ((t->inp_vflag & INP_TIMEWAIT) == 0) && + ((t->inp_flags & INP_TIMEWAIT) == 0) && (so->so_type != SOCK_STREAM || IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || @@ -215,7 +215,7 @@ in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam, sin.sin_addr, lport, INPLOOKUP_WILDCARD, cred); if (t && - ((t->inp_vflag & + ((t->inp_flags & INP_TIMEWAIT) == 0) && (so->so_type != SOCK_STREAM || ntohl(t->inp_faddr.s_addr) == @@ -227,7 +227,7 @@ in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam, } t = in6_pcblookup_local(pcbinfo, &sin6->sin6_addr, lport, wild, cred); - if (t && (reuseport & ((t->inp_vflag & INP_TIMEWAIT) ? + if (t && (reuseport & ((t->inp_flags & INP_TIMEWAIT) ? intotw(t)->tw_so_options : t->inp_socket->so_options)) == 0) return (EADDRINUSE); @@ -238,7 +238,7 @@ in6_pcbbind(register struct inpcb *inp, struct sockaddr *nam, in6_sin6_2_sin(&sin, sin6); 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) { if ((reuseport & intotw(t)->tw_so_options) == 0 && (ntohl(t->inp_laddr.s_addr) != -- cgit v1.1