NetBSD Problem Report #9929

Received: (qmail 8495 invoked from network); 19 Apr 2000 02:58:35 -0000
Message-Id: <200004190258.e3J2wUi06383@itojun.org>
Date: Wed, 19 Apr 2000 11:58:30 +0900 (JST)
From: itojun@itojun.org
Reply-To: itojun@itojun.org
To: gnats-bugs@gnats.netbsd.org
Subject: pcap_lookupdev picks up interfaces that are not attached to BPF
X-Send-Pr-Version: 3.95

>Number:         9929
>Category:       lib
>Synopsis:       pcap_lookupdev picks up interfaces that are not attached to BPF
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 19 02:59:00 +0000 2000
>Closed-Date:    
>Last-Modified:  Tue Jun 06 02:03:59 +0000 2000
>Originator:     Jun-ichiro itojun Hagino
>Release:        1.4X
>Organization:
	itojun.org
>Environment:
NetBSD starfruit.itojun.org 1.4X NetBSD 1.4X (STARFRUIT) #182: Mon Apr 17 00:15:03 JST 2000     itojun@starfruit.itojun.org:/usr/home/itojun/NetBSD/src/sys/arch/i386/compile/STARFRUIT i386

>Description:
	from manpage for pcap_lookupdev(3) :
 >       pcap_lookupdev()  returns  a  pointer  to a network device
 >       suitable for use with  pcap_open_live()  and  pcap_lookup-
 >       net().   If there is an error, NULL is returned and errbuf
 >       is filled in with with an appropriate error message.

	however, pcap_lookupdev() picks up interfaces that do not call
	bpfattach().  it looks unsuitable for me to pick up an interface
	that will fail on pcap_open_live().

>How-To-Repeat:
	on laptop,
	# tcpdump -n
	tcpdump will pick up eon0 as interface, and since eon0 does not
	call bpfattach, it will fail.

>Fix:
	try calling pcap_open_live() in pcap_lookupdev() loop, return only if
	pcap_open_live() is successful.

	the bug is actually from LBL libpcap.  we should fix it for libpcap in
	tcpdump.org (where libpcap is maintained now) and then bring it
	back to netbsd-current.
>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.