From owner-freebsd-bugs@FreeBSD.ORG Fri May 14 17:50:04 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B4461065674 for ; Fri, 14 May 2010 17:50:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 395FF8FC15 for ; Fri, 14 May 2010 17:50:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o4EHo4eP035431 for ; Fri, 14 May 2010 17:50:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o4EHo4HC035429; Fri, 14 May 2010 17:50:04 GMT (envelope-from gnats) Resent-Date: Fri, 14 May 2010 17:50:04 GMT Resent-Message-Id: <201005141750.o4EHo4HC035429@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Boris Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6EF1065673 for ; Fri, 14 May 2010 17:48:15 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id CECDC8FC12 for ; Fri, 14 May 2010 17:48:15 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o4EHmFqg050760 for ; Fri, 14 May 2010 17:48:15 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o4EHmFGw050757; Fri, 14 May 2010 17:48:15 GMT (envelope-from nobody) Message-Id: <201005141748.o4EHmFGw050757@www.freebsd.org> Date: Fri, 14 May 2010 17:48:15 GMT From: Boris To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/146592: [PATCH] libpcap 1.0.0 doesn't have error message for nonexistent interface X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2010 17:50:04 -0000 >Number: 146592 >Category: misc >Synopsis: [PATCH] libpcap 1.0.0 doesn't have error message for nonexistent interface >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri May 14 17:50:03 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Boris >Release: 8.0-RELEASE-p2 >Organization: Kochergin >Environment: FreeBSD peer 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #2: Mon Feb 22 23:18:53 EST 2010 root@peer:/usr/obj/usr/src/sys/PEER i386 >Description: libpcap 1.0.0, found in FreeBSD 8.0 and CURRENT, does not notify a user if the device they tried to open (via BPF) does not exist. With older versions, one gets: # tcpdump -i something tcpdump: BIOCSETIF: no: Device not configured With 1.0.0, one gets: # tcpdump -i something tcpdump: The current version of libpcap, 1.1.1, fixes the problem, but I don't know if there are plans to incorporate it into the base system anytime soon. The attached patch fixes the problem in libpcap 1.0.0. >How-To-Repeat: >Fix: Patch attached with submission follows: --- /usr/src/contrib/libpcap/pcap-bpf.c.orig 2010-05-14 13:20:41.000000000 -0400 +++ /usr/src/contrib/libpcap/pcap-bpf.c 2010-05-14 13:35:31.000000000 -0400 @@ -1601,6 +1601,14 @@ if (errno != ENOBUFS) { status = check_setif_failure(p, errno); + if (errno == ENXIO) { + snprintf(p->errbuf, + PCAP_ERRBUF_SIZE, + "BIOCSETIF: %s: %s", + p->opt.source, + pcap_strerror(errno)); + status = PCAP_ERROR_NO_SUCH_DEVICE; + } goto bad; } } >Release-Note: >Audit-Trail: >Unformatted: