From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 20 15:58:54 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E7B2A139 for ; Sat, 20 Jul 2013 15:58:53 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [IPv6:2a00:1450:400c:c03::22b]) by mx1.freebsd.org (Postfix) with ESMTP id 7009499A for ; Sat, 20 Jul 2013 15:58:53 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id q55so768082wes.2 for ; Sat, 20 Jul 2013 08:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=g2FpI4tDidYSek3VO2tSIOno1OfM272FCu6vpVfiWy0=; b=sa/0G+a7U20vfl2WmnjuEzRck52ovv4fdsOKxO0bH77c7uJuMsc1g514MI+XxjRU5u 1E8+CLjlSxeDNQqTmPV97WLZeozO6mG+52a9hTxar+Sy2y+v2KSEBNgtdXpdmxJQbQ6O /BJmhaBFUb5ARD10F7/aR+zm37A7PATqK6pYboNzNxCE9g3/D0zuJeKt3kUHMVgg/gEp N9srvrAPiqiC6asWyQkuyjjItT5ZNWhbutXIljKTfe9wX5iC0rhzLSxW8vMncGRVqnBn fJm6dsdxblwTVKAvA4/NHkHAw40MJNPDniQP0qHrCp7Y77qRSoffE3WyYwv8VTcz2Hp/ SBQg== MIME-Version: 1.0 X-Received: by 10.194.157.99 with SMTP id wl3mr14911846wjb.76.1374335932478; Sat, 20 Jul 2013 08:58:52 -0700 (PDT) Received: by 10.180.187.162 with HTTP; Sat, 20 Jul 2013 08:58:52 -0700 (PDT) In-Reply-To: <9921.1374330712@server1.tristatelogic.com> References: <9921.1374330712@server1.tristatelogic.com> Date: Sat, 20 Jul 2013 17:58:52 +0200 Message-ID: Subject: Re: bin/176713: [patch] nc(1) closes network socket too soon From: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= To: "Ronald F. Guilmette" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jul 2013 15:58:54 -0000 On Sat, Jul 20, 2013 at 4:31 PM, Ronald F. Guilmette wrote: > > > Could someone please take a look at this bug report (bin/176713) and > also at the simple patch that I provided to fix the problem? > > This is quite a serious problem, and my PR has been pending with no > action since Wed, 6 Mar 2013. > > > Regards, > rfg > > > P.S. Please note that in reality, I do not believe that it is necessary > to add a new -q option in order to preserve backwards compatability, > however > I proposed one because in my experience there is always going to be some > purist who will claim that *any* change in semantics, however small or > helpful, in *any* software ``may'' break something. In reality, the > problem in this can most easily be solved simply by removing the one > statement: > > shutdown(nfd, SHUT_WR); > > entirely from the source, rather than making it conditional on -q, as I > suggested in my PR, bin/176713. > It seems to work for me: Old version: $ echo 193.0.6.139 | nc whois.ripe.net 43 % This is the RIPE Database query service. % The objects are in RPSL format. % % The RIPE Database is subject to Terms and Conditions. % See http://www.ripe.net/db/support/db-terms-conditions.pdf with the patched version: echo 193.0.6.139 | ./nc -q whois.ripe.net 43 % This is the RIPE Database query service. % The objects are in RPSL format. % % The RIPE Database is subject to Terms and Conditions. % See http://www.ripe.net/db/support/db-terms-conditions.pdf % Note: this output has been filtered. % To receive output for a database update, use the "-B" flag. % Information related to '193.0.0.0 - 193.0.7.255' % Abuse contact for '193.0.0.0 - 193.0.7.255' is 'abuse@ripe.net' inetnum: 193.0.0.0 - 193.0.7.255 netname: RIPE-NCC descr: RIPE Network Coordination Centre org: ORG-RIEN1-RIPE descr: Amsterdam, Netherlands remarks: Used for RIPE NCC infrastructure. country: NL admin-c: JDR-RIPE admin-c: BRD-RIPE tech-c: OPS4-RIPE status: ASSIGNED PI source: RIPE # Filtered mnt-by: RIPE-NCC-MNT mnt-lower: RIPE-NCC-MNT organisation: ORG-RIEN1-RIPE org-name: Reseaux IP Europeens Network Coordination Centre (RIPE NCC) org-type: RIR descr: RIPE NCC Operations address: Reseaux IP Europeens Network Coordination Centre (RIPE NCC) P.O. Box 10096 1016 EB Amsterdam Netherlands phone: +31205354444 fax-no: +31205354445 admin-c: AP110-RIPE admin-c: MENN1-RIPE abuse-c: ops4-ripe mnt-ref: RIPE-NCC-MNT mnt-ref: RIPE-NCC-HM-MNT mnt-by: RIPE-NCC-HM-MNT source: RIPE # Filtered role: RIPE NCC Operations address: Singel 258 address: 1016 AB Amsterdam address: The Netherlands phone: +31 20 535 4444 fax-no: +31 20 535 4445 abuse-mailbox: abuse@ripe.net admin-c: JDR-RIPE admin-c: BRD-RIPE tech-c: GL7321-RIPE tech-c: JA47 tech-c: MENN1-RIPE tech-c: EMIL-RIPE tech-c: RCO-RIPE tech-c: APZ-RIPE tech-c: CNAG-RIPE tech-c: RPM-RIPE tech-c: SO2011-RIPE tech-c: RH5357-RIPE tech-c: DCW-RIPE tech-c: FMUL-RIPE nic-hdl: OPS4-RIPE mnt-by: RIPE-NCC-MNT source: RIPE # Filtered person: Brian Riddle address: IT Manager address: RIPE NCC - Operations address: Singel 258 address: 1016AB Amsterdam address: The Netherlands phone: +31 20 535 4444 fax-no: +31 20 535 4445 nic-hdl: BRD-RIPE source: RIPE # Filtered mnt-by: RIPE-NCC-MNT person: Jochem de Ruig address: RIPE NCC address: Singel 258 address: 1016AB Amsterdam address: The Netherlands phone: +31 20 535 4444 fax-no: +31 20 535 4445 nic-hdl: JDR-RIPE source: RIPE # Filtered mnt-by: RIPE-NCC-MNT % Information related to '193.0.0.0/21AS3333' route: 193.0.0.0/21 descr: RIPE-NCC origin: AS3333 mnt-by: RIPE-NCC-MNT source: RIPE # Filtered % This query was served by the RIPE Database Query Service version 1.66.3 (WHOIS2) Tested on: FreeBSD hammer 9.1-RELEASE-p3 FreeBSD 9.1-RELEASE-p3 #0: Mon Apr 29 18:27:25 UTC 2013 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 > > P.P.S. I have just realized that yet one more critical enhancement for > nc is called for, and I will be filing a separate and additional PR for > that soon. I hope that someone will be able to take a look at that as > soon as it is filed. > Just out of curiosity. What is it about? > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >