From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Mar 4 08:39:01 2014 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91E0C525 for ; Tue, 4 Mar 2014 08:39:01 +0000 (UTC) Received: from mail.wasikowski.net (unknown [IPv6:2001:6a0:1cb::b]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47CC1253 for ; Tue, 4 Mar 2014 08:39:01 +0000 (UTC) Received: from mail.wasikowski.net (mail.wasikowski.net [IPv6:2001:6a0:1cb::b]) by mail.wasikowski.net (Postfix) with ESMTP id F14D68A2; Tue, 4 Mar 2014 09:38:51 +0100 (CET) X-Virus-Scanned: amavisd-new at wasikowski.net Received: from mail.wasikowski.net ([91.204.91.44]) by mail.wasikowski.net (scan.wasikowski.net [91.204.91.44]) (amavisd-new, port 10026) with ESMTP id BSeZqd1T-p4L; Tue, 4 Mar 2014 09:38:51 +0100 (CET) Received: from [192.168.138.150] (83-144-115-210.static.chello.pl [83.144.115.210]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.wasikowski.net (Postfix) with ESMTPSA id 376D089F; Tue, 4 Mar 2014 09:38:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wasikowski.net; s=default; t=1393922331; bh=0tnsHnsR5gnUDUdHzQc/vgZaeMpzq6LeFGoh4TM1Nrc=; h=Date:From:To:References:In-Reply-To; b=bhIxWNBZtCDzF6P2Rnnf4v5y8DtE9WuDbtLtN2wx01zgRy+ZE1JoWbuMHAr1nB4Gs S9ZbuFgRlYlFValtU1MNEtKxD7zm8d9y4ut/hhhcUT7GHOIsujnkTFNFbYj2e8g+vX Y+px6g2mdPYvkF3C5o0TwcmapuM0DI1Va2j660KyySe3AN0Jj9xEFwV0kd50RPCb1/ stCKE5k8lVYr42Sn3NA8Q+3kuFUxqvR41YUvct5TY3pPolxKNZWnEjh7mugoHI+REL ZxWtB9ugEN2uiQ7/dcKDCeOIphcHrGx/ZsppJVSIGvKRVYy3mH2Lp2nCLS78MBqAAV R1SrRhqW9JnDw== Message-ID: <5315911A.2050403@wasikowski.net> Date: Tue, 04 Mar 2014 09:38:50 +0100 From: =?UTF-8?B?xYF1a2FzeiBXxIVzaWtvd3NraQ==?= User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Ruslan Makhmatkhanov , freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/187240: sysutils/tcplist incompatible with sysutils/lsof References: <201403040810.s248A1HP029270@freefall.freebsd.org> In-Reply-To: <201403040810.s248A1HP029270@freefall.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 08:39:01 -0000 W dniu 2014-03-04 09:10, Ruslan Makhmatkhanov pisze: > The following reply was made to PR ports/187240; it has been noted by GNATS. > > From: Ruslan Makhmatkhanov > To: C Hutchinson > Cc: bug-followup@FreeBSD.org > Subject: Re: ports/187240: sysutils/tcplist incompatible with sysutils/lsof > Date: Tue, 04 Mar 2014 12:00:15 +0400 > > This is a multi-part message in MIME format. > --------------060704030206060703030302 > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > Content-Transfer-Encoding: 7bit > > So, this is proper lsof commandline. It outputs like: > > uid x.x.x.x:10859->y.y.y.y:22 > uid x.x.x.x:16573->y.y.y.y:80 > uid x.x.x.x:19337->y.y.y.y:80 > > and tcplist now fails with: > select: Bad file descriptor > > Looks like the code needs to be updated to modern network stuff. > > -- > Regards, > Ruslan > > T.O.S. Of Reality > > > --------------060704030206060703030302 > Content-Type: text/x-patch; > name="tcplist.diff" > Content-Transfer-Encoding: 7bit > Content-Disposition: attachment; > filename="tcplist.diff" > > Index: files/patch-03 > =================================================================== > --- files/patch-03 (revision 346995) > +++ files/patch-03 (working copy) > @@ -5,7 +5,7 @@ > #else /* !OLDLSOF */ > /* These use the current (as of 3.62W, at least) parameters for lsof */ > -#define LSOFCMD "lsof -nPsli TCP | awk '{print $3,$NF}' | sort | uniq" > -+#define LSOFCMD "lsof -nPsli TCP | awk '{print $3,$(NF - 1)}' | sort | uniq" > ++#define LSOFCMD "lsof -nPls -iTCP | awk '{print $3,$(NF - 1)}' | tail -n+2 | sort | uniq" > #endif /* !OLDLSOF */ > #endif /* LSOFCMD */ Instead of using sort | uniq it's better to use sort -u - one process spawn less. -- best regards, Lukasz Wasikowski