Robin <(E-Mail Removed)> wrote:
> This is a "getlocaladdr" problem.
>
> I've implemented a "virtual applikation server" that will take packets and
> send them to another host based on port numbers, thus working as both
> client and server to make a session work (like a man in the middle)..
You know about the Linux Virtual Server component of 2.6 kernels?
> The problem is to support this funktionality on a multihomed host (a host
> with more than one network card).. since I don't know what source address
> to use when sending packets.
Follow this psuedocode:
for every network device that is UP:
create a socket for this device
store the devices source address
add it to a list of sockets to select on.
select on all of the sockets waiting for readablity
use the stored address for the source address.
Alternatively, you may be able to use recvmsg and sendmsg, but I don't
know if that would work with raw IP
--
Cameron Kerr
(E-Mail Removed) :
http://nzgeeks.org/cameron/
Empowered by Perl!