Message ID | 6afd3db7f90a6e8637f3f97607422abb8997c64b.1227023129.git.bazsi@balabit.hu |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Balazs Scheidler <bazsi@balabit.hu> Date: Tue, 18 Nov 2008 16:26:32 +0100 > udp_sendmsg() didn't fill struct flowi->flags, which means that > the route lookup would fail for non-local IPs even if the > IP_TRANSPARENT sockopt was set. > > This prevents sendto() to work properly for UDP sockets, whereas > bind(foreign-ip) + connect() + send() worked fine. > > Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> Applied to net-2.6 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index cf02701..98c1fd0 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -633,6 +633,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, .saddr = saddr, .tos = tos } }, .proto = sk->sk_protocol, + .flags = inet_sk_flowi_flags(sk), .uli_u = { .ports = { .sport = inet->sport, .dport = dport } } };
udp_sendmsg() didn't fill struct flowi->flags, which means that the route lookup would fail for non-local IPs even if the IP_TRANSPARENT sockopt was set. This prevents sendto() to work properly for UDP sockets, whereas bind(foreign-ip) + connect() + send() worked fine. Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> --- net/ipv4/udp.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)