[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DUB123-W366C1804B97909DA64C0F9ED3E0@phx.gbl>
Date: Fri, 23 May 2014 12:49:24 +0200
From: Lukas Tribus <luky-37@...mail.com>
To: Florian Westphal <fw@...len.de>,
Niels Möller <nisse@...thpole.se>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Jonas Bonn <jonas@...thpole.se>
Subject: RE: What's the right way to use a *large* number of source
addresses?
>> 3. Just set the desired local address with the bind call. Currently,
>> this gives an EADDRNOTAVAIL error, so the first step would be some
>> option to allow arbitrary source addresses.
>
> See 'Making non-local sockets work' in Documentation/networking/tproxy.txt
Yes, its a simple as setting IP_FREEBIND and then binding to the specific
source IP.
setsockopt(fd, SOL_IP, IP_FREEBIND, &one, sizeof(one))
You don't need to specify the interface. Just make sure your network
routes the return traffic back to your box.
Works for IPv6 as well (3.3+).
Lukas
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists