From owner-freebsd-current@FreeBSD.ORG Sun Jan 23 17:52:04 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC91A16A4CE; Sun, 23 Jan 2005 17:52:04 +0000 (GMT) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07DA743D1D; Sun, 23 Jan 2005 17:52:04 +0000 (GMT) (envelope-from maxim@macomnet.ru) Received-SPF: pass (mp2.macomnet.net: domain of maxim@macomnet.ru designates 127.0.0.1 as permitted sender) receiver=mp2.macomnet.net; client_ip=127.0.0.1; envelope-from=maxim@macomnet.ru; Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.12.11/8.12.11) with ESMTP id j0NHpvll087796; Sun, 23 Jan 2005 20:51:57 +0300 (MSK) (envelope-from maxim@macomnet.ru) Date: Sun, 23 Jan 2005 20:51:57 +0300 (MSK) From: Maxim Konovalov To: Robert Watson In-Reply-To: Message-ID: <20050123204943.G9933@mp2.macomnet.net> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SpamTest-Info: Profile: Formal (199/050122) X-SpamTest-Info: Profile: Detect Hard (4/030526) X-SpamTest-Info: Profile: SysLog X-SpamTest-Info: Profile: Marking - Keywords (2/030321) X-SpamTest-Status: Not detected X-SpamTest-Version: SMTP-Filter Version 2.0.0 [0124], SpamtestISP/Release cc: current@freebsd.org Subject: Re: OpenBSD's tcpdrop(8) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2005 17:52:04 -0000 On Sun, 23 Jan 2005, 17:33-0000, Robert Watson wrote: > > On Sun, 23 Jan 2005, Maxim Konovalov wrote: > > > I've ported OpenBSD's tcpdrop(8) and a relevant kernel part. > > >From the man page, http://tinyurl.com/4lvo9 > > > > The tcpdrop command drops the TCP connection specified by the local > > address laddr, port lport and the foreign address faddr, port fport. > > > > There are patches for HEAD and RELENG_4: > > > > http://people.freebsd.org/~maxim/diff/tcpdrop.diff > > http://people.freebsd.org/~maxim/diff/tcpdrop.diff-4 > > > > Two questions: do we want to have it in the base system? Does the diff > > look OK (I didn't test IPv6 part)? > > The locking in the 6.x version looked reasonable, although you need to > check to see if the (tp) returned by tcp_drop() is NULL or not and then > conditionally unlock the inpcb if it's non-NULL -- otherwise you might > unlock a free'd inpcb. There doesn't seem to be much validation of the Updated, thanks! > tcp_ident_mapping structure, such as validation that the address lengths, > etc, are correct? Yes, need to consider this part. Thank you, Robert! -- Maxim Konovalov