Sockets stuck in FIN_WAIT_1

Tod McQuillin devin at spamcop.net
Fri May 30 08:37:40 UTC 2008


On Fri, 30 May 2008, Peter Jeremy wrote:

> As a work-around, you could write a cronjob that scans "netstat" and
> temporarily creates an ipfw 'reset' rule that matches each FIN_WAIT_1
> socket

In the past, I've used something like this:

netstat -an | grep FIN_WAIT_1 |
perl -pe 's/.*\s((?:\d+\.){3}\d+)\.(\d+)\s*((?:\d+\.){3}\d+)\.(\d+).*/tcpdrop $1 $2 $3 $4/' |
sh -x

This relies on tcpdrop, included as /usr/sbin/tcpdrop on FreeBSD 6.x; you 
may need to install it from a port on FreeBSD 4.x.
-- 
Tod McQuillin



More information about the freebsd-stable mailing list