From owner-freebsd-current@FreeBSD.ORG Sun Jan 23 17:34:05 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 923CC16A4CE for ; Sun, 23 Jan 2005 17:34:05 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35C1D43D53 for ; Sun, 23 Jan 2005 17:34:03 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.13.1/8.13.1) with ESMTP id j0NHXhTV050138; Sun, 23 Jan 2005 12:33:43 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)j0NHXhTP050135; Sun, 23 Jan 2005 17:33:43 GMT (envelope-from robert@fledge.watson.org) Date: Sun, 23 Jan 2005 17:33:42 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Maxim Konovalov In-Reply-To: <20050123193559.V91742@mp2.macomnet.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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:34:05 -0000 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 tcp_ident_mapping structure, such as validation that the address lengths, etc, are correct? Robert N M Watson