Re: tcpdrop(8) for DragonFly

看板DFBSD_submit作者時間21年前 (2004/11/24 20:02), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
On Sun, 14 Nov 2004, Andre Nathan wrote: > Anyway, I hope it's alright now :) If all is fine, I'll work on adding > command line options to tcpdrop(8) so that you can choose which sysctl > it'll use. Sorry for the delay on that... there is a patched tcpdrop at http://andre.people.digirati.com.br/dragonfly/patches/tcpdrop/tcpdrop/ which has two command line options for drop (-d) and shutdown (-s). Drop mode is the default, because I think this will be more used, and well, because of the name of the program... So I guess the pending issue is the race Matt mentioned: > 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. Is the race present even considering that the find/operate code of the sysctl is run at splnet()? Hiten mentioned that the socket would have an associated descriptor, so I guess a test like if (inp->inp_socket->so_state & SS_NOFDREF == 0) /* drop/shutdown */ but i'm not sure if that would solve the problem. Regards, Andre
文章代碼(AID): #11f7X600 (DFBSD_submit)