Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Aug 2000 18:59:50 +0300
From:      Nimrod Mesika <nimrodm@bezeqint.net>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Can a tcp client use bind to force which interface is to be used?
Message-ID:  <20000815185950.A1403@localhost.bsd.net.il>
In-Reply-To: <20000814185251.11423.qmail@camelot.bitart.com>; from gerti@bitart.com on Mon, Aug 14, 2000 at 01:52:50PM -0500
References:  <20000814185251.11423.qmail@camelot.bitart.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 14, 2000 at 01:52:50PM -0500, Gerd Knops wrote:
> Hi everyone,
> 
> Looking through Stevens this questions doesn't seem to be answered:
> 
> If I use bind() for an outbound socket connection to set the source  
> IP-address, does this mean that the interface associated with that  
> IP-address is used (as opposed to the interface dictated by the routing  
> table for the given target IP)?
> 

Yes you can. 

For an example, see the /usr/src/sbin/ping/ping.c (the -s option of
ping).

-- 
Nimrod.
http://www.geocities.com/rodd_27


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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