misc/146592: [PATCH] libpcap 1.0.0 doesn't have error message fo

看板FB_bugs作者時間15年前 (2010/05/15 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
>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: _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
文章代碼(AID): #1BxO_iOF (FB_bugs)