[PATCH] [TPROXY] fill struct flowi->flags in udp_sendmsg()

Balazs Scheidler bazsi at balabit.hu
Tue Nov 18 16:26:32 CET 2008


    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 at balabit.hu>
---
 net/ipv4/udp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

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 } } };
-- 
1.5.4.3


--=-p0V9RhGOkeWqOYCaCRYJ
Content-Disposition: attachment; filename=0002-TPROXY-supply-a-struct-flowi-flags-argument-in-in.patch
Content-Type: application/mbox; name=0002-TPROXY-supply-a-struct-flowi-flags-argument-in-in.patch
Content-Transfer-Encoding: 7bit



More information about the tproxy mailing list