Index: netinet/in_pcb.c =================================================================== --- netinet/in_pcb.c (revision 224109) +++ netinet/in_pcb.c (working copy) @@ -56,6 +56,7 @@ #ifdef DDB #include #endif +#include #include @@ -268,6 +269,8 @@ inp->inp_lport = 0; return (EAGAIN); } + CTR3(KTR_INPCB, "in_pcbbind: PCB insert %p (%d -> %d)", inp, + ntohs(inp->inp_fport), ntohs(inp->inp_lport)); if (anonport) inp->inp_flags |= INP_ANONPORT; return (0); @@ -578,6 +581,8 @@ inp->inp_lport = 0; return (EAGAIN); } + CTR3(KTR_INPCB, "in_pcbconnect: PCB insert %p (%d -> %d)", inp, + ntohs(inp->inp_fport), ntohs(inp->inp_lport)); } /* Commit the remaining changes. */ @@ -586,6 +591,8 @@ inp->inp_faddr.s_addr = faddr; inp->inp_fport = fport; in_pcbrehash(inp); + CTR3(KTR_INPCB, "in_pcbconnect: PCB rehash %p (%d -> %d)", inp, + ntohs(inp->inp_fport), ntohs(inp->inp_lport)); if (anonport) inp->inp_flags |= INP_ANONPORT; @@ -953,6 +960,8 @@ inp->inp_faddr.s_addr = INADDR_ANY; inp->inp_fport = 0; in_pcbrehash(inp); + CTR3(KTR_INPCB, "in_pcbdisconnect: PCB rehash %p (%d -> %d)", inp, + ntohs(inp->inp_fport), ntohs(inp->inp_lport)); } /* @@ -1123,6 +1132,8 @@ free(phd, M_PCB); } inp->inp_flags &= ~INP_INHASHLIST; + CTR3(KTR_INPCB, "in_pcbdrop: PCB remove %p (%d -> %d)", inp, + ntohs(inp->inp_fport), ntohs(inp->inp_lport)); } } @@ -1600,6 +1611,8 @@ free(phd, M_PCB); } inp->inp_flags &= ~INP_INHASHLIST; + CTR3(KTR_INPCB, "in_pcbremlists: PCB remove %p (%d -> %d)", inp, + ntohs(inp->inp_fport), ntohs(inp->inp_lport)); } LIST_REMOVE(inp, inp_list); pcbinfo->ipi_count--; Index: netinet/tcp_syncache.c =================================================================== --- netinet/tcp_syncache.c (revision 224109) +++ netinet/tcp_syncache.c (working copy) @@ -696,6 +696,8 @@ } goto abort; } + CTR3(KTR_INPCB, "syncache_socket: PCB insert %p (%d -> %d)", inp, + ntohs(inp->inp_fport), ntohs(inp->inp_lport)); #ifdef IPSEC /* Copy old policy into new socket's. */ if (ipsec_copy_policy(sotoinpcb(lso)->inp_sp, inp->inp_sp)) Index: netinet/tcp_usrreq.c =================================================================== --- netinet/tcp_usrreq.c (revision 224109) +++ netinet/tcp_usrreq.c (working copy) @@ -1098,6 +1098,8 @@ return EADDRINUSE; inp->inp_laddr = laddr; in_pcbrehash(inp); + CTR3(KTR_INPCB, "tcp_connect: PCB rehash %p (%d -> %d)", inp, + ntohs(inp->inp_fport), ntohs(inp->inp_lport)); /* * Compute window scaling to request: Index: sys/ktr.h =================================================================== --- sys/ktr.h (revision 224109) +++ sys/ktr.h (working copy) @@ -77,6 +77,8 @@ #define KTR_BUF 0x40000000 /* Buffer cache */ #define KTR_ALL 0x7fffffff +#define KTR_INPCB (KTR_NET) /* Internet PCB operations */ + /* * Trace classes which can be assigned to particular use at compile time * These must remain in high 22 as some assembly code counts on it