On 10/12/2013 10:27 AM, Maciej Wasilak wrote:
I deploy my protocol like that:
reactor.listenUDP(5683, myapp.MyProtocol(), interface="::")
reactor.run()
The problem is:
1. My server receives a request from remote client (with destination
address being valid global IPv6 address)
2. The server sends a response, but uses different source address
(which is also valid and assigned to local wlan0 interface).
3. Remote host drops the response (destination address of the request
and source address of the response do not match).
It is common for IPv6 interfaces to have multiple global IPv6
addresses - because of privacy reasons (both on Windows and Linux).
My question is - can I read manually the destination address from the
incoming request datagram, and set it as a source address manually in
the outgoing response datagram?
If you pass a specific IP to the interface keyword argument instead of
"::", the UDP port will bind to that specific IP and will only send
datagrams on that IP. You can use netifaces package (e.g. find it on
PyPI) to list all local IPs. So you could do the equivalent of "::" by
binding multiple times, once for each IPv6 address.
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python