diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-04-03 13:33:55 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-04-03 13:33:55 +0000 |
commit | d67aff8ec432c4f2d1e0c1acf831f238931c2429 (patch) | |
tree | 0e7eebbe527dc5fd1f35a85c1b0904a72115d6b2 /sys/netinet/in_pcb.c | |
parent | 4586157b3a5cbeff0a6e0878ab9a029cdd7f0704 (diff) | |
download | FreeBSD-src-d67aff8ec432c4f2d1e0c1acf831f238931c2429.zip FreeBSD-src-d67aff8ec432c4f2d1e0c1acf831f238931c2429.tar.gz |
Change inp_ppcb from caddr_t to void *, fix/remove associated related
casts.
Consistently use intotw() to cast inp_ppcb pointers to struct tcptw *
pointers.
Consistently use intotcpcb() to cast inp_ppcb pointers to struct tcpcb *
pointers.
Don't assign tp to the results to intotcpcb() during variable declation
at the top of functions, as that is before the asserts relating to
locking have been performed. Do this later in the function after
appropriate assertions have run to allow that operation to be conisdered
safe.
MFC after: 3 months
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 2941dfc..212092c 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -865,6 +865,7 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr, u_int lport_arg, int wild_okay) { struct inpcb *inp; + struct tcptw *tw; #ifdef INET6 int matchwild = 3 + INP_LOOKUP_MAPPED_PCB_COST; #else @@ -948,9 +949,10 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct in_addr laddr, * are clogging up needed local ports. */ if ((inp->inp_vflag & INP_TIMEWAIT) != 0) { - if (tcp_twrecycleable((struct tcptw *)inp->inp_ppcb)) { + tw = intotw(inp); + if (tcp_twrecycleable(tw)) { INP_LOCK(inp); - tcp_twclose((struct tcptw *)inp->inp_ppcb, 0); + tcp_twclose(tw, 0); match = NULL; goto retrylookup; } |