From owner-freebsd-net@FreeBSD.ORG Mon Jan 14 17:13:17 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3835A16A41B for ; Mon, 14 Jan 2008 17:13:17 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id E798113C442 for ; Mon, 14 Jan 2008 17:13:16 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id ACFEE84EEF; Mon, 14 Jan 2008 12:13:16 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 14 Jan 2008 12:13:16 -0500 X-Sasl-enc: 1kLVZRIGGd2d+fm/vRFFDryCCTEQIQ4lgN+sgiYULg47 1200330796 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id 4300F2A072; Mon, 14 Jan 2008 12:13:16 -0500 (EST) Message-ID: <478B982B.304@FreeBSD.org> Date: Mon, 14 Jan 2008 17:13:15 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.6 (X11/20070928) MIME-Version: 1.0 To: Tom Judge References: <478B7AB7.5010208@tomjudge.com> <478B88EE.7090307@FreeBSD.org> <478B9020.3000402@tomjudge.com> In-Reply-To: <478B9020.3000402@tomjudge.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Programming interface MAC filter without enabling PROMISC on an interface from user space. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2008 17:13:17 -0000 Tom Judge wrote: > Thanks for the response. I have a quick grep of the src tree to find > an example of this being used and only found the following from > wpa_supplicant and I have a few questions: > > * I am presuming that this will do what I want, am I correct? Yes, it will attempt to add the given link layer multicast group to the ifnet's underlying device driver. > > * If I was only ever to add the address to an interface an never > delete it would this cause any problems? I.e. when lldpd ends, or is > restarted and tries to add the address again? SIOCADDMULTI is very low level, no resource tracking is performed; I changed its semantics to only allow one userland opener so that in-kernel refcounting would work, as there is no per-process or per-client resource tracking -- so it's a really good idea to clean up after it. > > * Alternatively is there a way to query the filter to ask what > addresses it is currently programmed for? Nope, there is no userland or kernel API for that unless you hack up the driver. cheers BMS