DragonFly BSD
DragonFly submit List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: tcpdrop(8) for DragonFly


From: "Andre Nathan" <andre@xxxxxxxxxxxxxxx>
Date: Sun, 14 Nov 2004 01:30:46 -0200 (BRST)

Matthew Dillon said:
>     Heh, documentation is fairly lacking considering how new the code
>     is.

When I mentioned documentation I was actually expecting pointers to
comments in the code or something :)

>     BUT, I don't think you have to do that.  I think all you need to
>     do to disconnect a TCP connection is to call soshutdown() on the
>     socket, which you can do directly.  soshutdown() calls
so_pru_shutdown()
>     which does all the messaging.

OK, I updated the patch but I used soabort(). I tried both soshutdown()
and sodisconnect(), but they leave the connection in one of the *_WAIT TCP
states.

soabort() will call so_pru_abort(), which sends a message containing a
pointer to tcp_usr_abort(), which finally calls tcp_drop(), so it seems to
be the correct way to do it.

>     There is one more issue, and that is how to safely operating on sockets
>     owned by other processes.  The socket structure is not ref-counted so
>     there's a race between finding and operating on the socket via the
>     sysctl, and the program that owns the socket trying to close it at the
>     same time.

I still need to think about this one... so far, no ideas :\


Andre



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]