Gigi Sullivan wrote:
> So, what you have to do is just this;
> look at destination IP address, use the kernel routing table to
> get the outgoing interface, retrieve the IP address associated with
> it.
Minor problem with this: what if you're routing based on source addresses? If
the outgoing address that you pick influences which route/interface you use,
this won't work.
By far the simplest method is to either a) use the default outgoing route to
that destination and let the kernel fill it in, or b) have the admin specify a
source address via a config file or commandline parm.
Anything else is guesswork and likely a pathological case can be invented for
which it will be wrong.
Chris
--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@xxxxxxxxxxxxxxxxxx
|