Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Aug 2002 16:27:23 +0400
From:      Vlad Skvortsov <vss@smarts-gsm.ru>
To:        freebsd-questions@freebsd.org
Subject:   INADDR_ANY and assigning source address of outgoing packets
Message-ID:  <20020827162723.W96508@smarts-gsm.ru>

next in thread | raw e-mail | index | archive | help
	[please CC: me]

	Hi !

	This question is related to my previous posting. I've digged into
that problem and half-solved it. My solution is not complete due to some
unconfigurable tools I use that cannot be told to bind() to specified
address before establishing connection.
	I think that in heterogenous complex environments it would be a good
help to administator if there would be a way of establishing some kind of
map/table for source address selection if a socket is unbound.
	For example, in my case this would eliminate all hacks and tricks. I
would just add several entries:
	192.168.0.0/16	->	192.168.0.103
	10.0.0.0/8	->	192.168.0.103
	default		->	193.125.154.4

	(taking in mind that the single rl0 interface has both 192.168.0.103
and 193.125.154.4 configured). 

	The schema would work something like this. If socket is not bound
and connect() is called, then we should use the mapping table shown above to
select source address (of course sanity checks are to be implemented to see
if all addresses in that map table do exist). If there is no default entry
in map table, then use original method of assigning address based on
interfaces configuration.

	Any thoughts ? I think I would be able to try to implement that if this
is considered okay.
-- 
Vlad Skvortsov, vss@smarts-gsm.ru, vss@high.net.ru

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?20020827162723.W96508>