Re: IP Masq weirdness

kuznet@ms2.inr.ac.ru
Mon, 18 Oct 1999 22:15:44 +0400 (MSK DST)


Hello!

> ums->maddr = ip_masq_select_addr(dev, rt->rt_gateway,
> RT_SCOPE_UNIVERSE);
...
> Doesn't this look up the output device, then choose an address for the local
> connection from the device list, but base it on the gateway instead of the
> destination? Is that correct?

No, it is _not_ correct! As I understand this algo was borrowed from
ip_forward.c without thinking. It must be simply ums->maddr=rt->rt_src
in this case. Even more, as I see, the code loses maddr passed by caller
somewhere and it is just crime...

> It looks like the devinet change will just select the first ip now instead
> of the last (2.2.10). Not sure what that was fixed for.

It was bug. People expected the first address and I expected it too,
only did this silly mistake. 8)8)

Alexey

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/