[tproxy] tproxy for UDP
valmikam at gmail.com
Thu May 29 06:25:30 CEST 2008
I have a tproxy setup with linux 2.6.24 (Ubuntu 8.04 Hardy) that I
have been using successfully for a TCP proxy scenario.
When I use the same setup for UDP scenario, I am having trouble with
sendto() function. Here is what I am doing:
- Create a UDP socket
- Set IP_TRANSPARENT flag (19)
- Bind to a foreign IP address and port#
All of the above steps work OK. "netstat -an" confirms that the udp
socket is indeed bound to the foriegn address.
However, when I do a sendto() to another host, the sendto() call fails
with EINVAL. I have ensured that my code is correct by using the same
code with bind() to a local address. It works OK.
I did look at the net/socket.c net/ipv4/udp.c and none of the EINVAL
scenarios seem to obviously apply.
Can someone help me out on this one? Did anyone see this issue before?
More information about the tproxy