From owner-freebsd-net@FreeBSD.ORG Mon Apr 28 08:26:21 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E9F937B401 for ; Mon, 28 Apr 2003 08:26:21 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58BD543F93 for ; Mon, 28 Apr 2003 08:26:20 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.9/8.12.9) with SMTP id h3SFQR9S046645; Mon, 28 Apr 2003 11:26:34 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Mon, 28 Apr 2003 11:26:24 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Martin Blapp In-Reply-To: <20030418193305.S6156@cvs.imp.ch> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: Implementing SO_BINDTODEVICE X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 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, 28 Apr 2003 15:26:21 -0000 On Fri, 18 Apr 2003, Martin Blapp wrote: > How difficult would it be to implement SO_BINDTODEVICE on FreeBSD ? I > need the to make is possible to run more than one instance of dhclient > on one host with more than one NIC. > > We would need this to support removable devices properly. > > There is a tool called omshell which should be able to change variables > so the interface is added to the lists. Unfortunatly the documentation > is bad and I only found hooks to dhcpd. Hmm. My impression was that dhclient used solely BPF descriptors on FreeBSD to perform interface-specific DHCP client communications, and that SO_BINDTODEVICE was used only in the DHCP server? BPF requires you to specifically identify an interface to bind to, as it's an interface-layer communications primitive. Last time I tried, the only real issue in using dhclient on multiple interfaces was making sure that pid files didn't collide, but that was several years ago, things could easily have changed. What semantics does SO_BINDTODEVICE offer? Normally, IP sockets make IP address binding and routing decisions based on the process optionally specifying IP addresses for local binding, and based on the destination of a connection/transmission. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories