Skip to content

Commit

Permalink
TPROXY: fill struct flowi->flags in udp_sendmsg()
Browse files Browse the repository at this point in the history
    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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
bazsi authored and davem330 committed Nov 20, 2008
1 parent b88ed5c commit a134f85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 } } };
Expand Down

0 comments on commit a134f85

Please sign in to comment.