I am creating a little udp port forwarder/duplicator. I want the source address of the packet to be the same when i "resend" the packet. So I want the final recieving machine to think it got the packet from the original sender, not the forwarding computer. I do not wish to use iptables as iptables will only forward the packet to 1 address, not 2. I receive some data and then get ready to send it. I will show some code below, assume code declares all the needed values currectly and I assume that on a linux kernel 2.2 this will work:

memcpy((char *) sa.sin_zero, &local_sa, 8);
int wr = sendto( rsd, buf, buf_len, \
((source || transparent_proxy) ? MSG_PROXY : 0), \
(struct sockaddr *) &sa, sizeof(sa));
I am trying to get this to work on 2.4 or 2.6. When I run this code with transparent_proxy set nothing gets sent. When transparent_proxy is not set the packet sends correctly, only it says the source is the computer which forwards the packet. I have notaced when looking through the ipv4 code for 2.4 and 2.6 MSG_PROXY is no longer used. So I assume there is a totaly different way of setting the source address of the packet. I have been trying to work it out for awhile but havn't got it yet.

Sorry this msg might be a little short and sweet and lacking info, but I will assume that anybody who knows the info I want to know will be able to answer my question by just seeing the MSG_PROXY flag in sendto :P (Coz I assume MSG_PROXY isn't used in 2.4 and 2.6). But then again I might be wrong.

Thanks everyone!

Let me know if you need more info ...