提交 a134f85c 编写于 作者: B Balazs Scheidler 提交者: David S. Miller

TPROXY: fill struct flowi->flags in udp_sendmsg()

    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: NBalazs Scheidler <bazsi@balabit.hu>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b88ed5cc
...@@ -633,6 +633,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -633,6 +633,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
.saddr = saddr, .saddr = saddr,
.tos = tos } }, .tos = tos } },
.proto = sk->sk_protocol, .proto = sk->sk_protocol,
.flags = inet_sk_flowi_flags(sk),
.uli_u = { .ports = .uli_u = { .ports =
{ .sport = inet->sport, { .sport = inet->sport,
.dport = dport } } }; .dport = dport } } };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册