Index: src/sys/netinet/in_pcb.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/in_pcb.h,v retrieving revision 1.76.2.3 diff -u -r1.76.2.3 in_pcb.h --- src/sys/netinet/in_pcb.h 31 Jan 2005 23:26:35 -0000 1.76.2.3 +++ src/sys/netinet/in_pcb.h 24 Feb 2005 04:34:24 -0000 @@ -242,6 +242,7 @@ mtx_init(&(inp)->inp_mtx, (d), (t), MTX_DEF | MTX_RECURSE | MTX_DUPOK) #define INP_LOCK_DESTROY(inp) mtx_destroy(&(inp)->inp_mtx) #define INP_LOCK(inp) mtx_lock(&(inp)->inp_mtx) +#define INP_TRYLOCK(inp) mtx_trylock(&(inp)->inp_mtx) #define INP_UNLOCK(inp) mtx_unlock(&(inp)->inp_mtx) #define INP_LOCK_ASSERT(inp) do { \ mtx_assert(&(inp)->inp_mtx, MA_OWNED); \ Index: src/sys/netinet/tcp_subr.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_subr.c,v retrieving revision 1.201.2.14 diff -u -r1.201.2.14 tcp_subr.c --- src/sys/netinet/tcp_subr.c 19 Feb 2005 15:32:30 -0000 1.201.2.14 +++ src/sys/netinet/tcp_subr.c 24 Feb 2005 04:34:24 -0000 @@ -806,7 +806,13 @@ LIST_FOREACH(inpb, tcbinfo.listhead, inp_list) { if (inpb->inp_vflag & INP_TIMEWAIT) continue; - INP_LOCK(inpb); + /* + * XXX dwhite -- Don't block on inpb in case someone + * is holding it; we can deadlock since we've got Giant + * and they could take an interrupt or something. + */ + if (INP_TRYLOCK(inpb) == 0) + continue; if ((tcpb = intotcpcb(inpb)) != NULL) { while ((te = LIST_FIRST(&tcpb->t_segq)) != NULL) {