Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jan 2008 16:08:14 +0000
From:      "Bruce M. Simpson" <bms@FreeBSD.org>
To:        Tom Judge <tom@tomjudge.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Programming interface MAC filter without enabling PROMISC on an interface from user space.
Message-ID:  <478B88EE.7090307@FreeBSD.org>
In-Reply-To: <478B7AB7.5010208@tomjudge.com>
References:  <478B7AB7.5010208@tomjudge.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Tom Judge wrote:
> Hi,
>
> I have just started experimenting with OpenLLDP and come across a 
> little bit of a nasty.  When it opens the interface, it puts it into 
> PROMISC mode,  which I don't really want to happen.  Is there any way 
> to add the LLDP MAC address (01-80-C2-00-00-0E) to the interface mac 
> filter from user space, so that the interface does not have to be set 
> to PROMISC?

There *is* an API for this but it's not integrated into pcap or bpf; see 
SIOCADDMULTI and SIOCDELMULTI. There are some issues with doing that 
portably, Windows and Linux do things somewhat differently in this space.

Really we could do with a KPI for this so that the references are 
properly refcounted. If you have other link layer multicast listeners 
it's not guaranteed that the stack will correctly restore the hash 
filters at the driver level if it has to enable ALLMULTI mode.

You almost certainly don't want to set PROMISC if you are ever going to 
do any kind of IP forwarding, although I believe I fixed that historic 
bug whereby the IP layer kept seeing its own packets about a year ago.

later
BMS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?478B88EE.7090307>