I want to bind to non-local IP and send/receive UDP packets.
But when I try to connect to remote end I get an error (although bind itself
is successful).
I examined the udp_connect and tcp_v4_connect and I found an
interesting difference between them.
In udp_connect:
err = ip_route_connect(&rt, usin->sin_addr.s_addr, sk->saddr,
sk->ip_tos|sk->localroute, sk->bound_dev_if);
^^^^^^^^^^^
(1)
but in tcp_v4_connect:
tmp = ip_route_connect(&rt, nexthop, sk->saddr,
RT_TOS(sk->ip_tos)|RTO_CONN|sk->localroute, sk->bound_dev_if);
^^^^^^^^^^^^^^^^^^^^^^^^^^^
(2)
If I see it right, this difference is used only in the ip_route_output_slow
function when it checks whether I can connect or not.
The question is whether there will be any problem if I rewrite (1) to (2)? I
tried doing this and seems to work fine.
Is there any reason not to do this?
Any help is appreciated.
-- PGP ID 0x8D143771, /C5 95 43 F8 6F 19 E8 29 53 5E 96 61 05 63 42 D0 GPG ID ABA0E8B2, 45CF B559 8281 8091 8469 CACD DB71 AEFC ABA0 E8B2The best things in life are free, but the expensive ones are still worth a look. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/