提交 538de0e0 编写于 作者: D David S. Miller

ipv4: Use flowi4_init_output() in ip_send_reply()

Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e79d9bc7
...@@ -1474,16 +1474,14 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar ...@@ -1474,16 +1474,14 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
} }
{ {
struct flowi4 fl4 = { struct flowi4 fl4;
.flowi4_oif = arg->bound_dev_if,
.daddr = daddr, flowi4_init_output(&fl4, arg->bound_dev_if, 0,
.saddr = rt->rt_spec_dst, RT_TOS(ip_hdr(skb)->tos),
.flowi4_tos = RT_TOS(ip_hdr(skb)->tos), RT_SCOPE_UNIVERSE, sk->sk_protocol,
.fl4_sport = tcp_hdr(skb)->dest, ip_reply_arg_flowi_flags(arg),
.fl4_dport = tcp_hdr(skb)->source, daddr, rt->rt_spec_dst,
.flowi4_proto = sk->sk_protocol, tcp_hdr(skb)->source, tcp_hdr(skb)->dest);
.flowi4_flags = ip_reply_arg_flowi_flags(arg),
};
security_skb_classify_flow(skb, flowi4_to_flowi(&fl4)); security_skb_classify_flow(skb, flowi4_to_flowi(&fl4));
rt = ip_route_output_key(sock_net(sk), &fl4); rt = ip_route_output_key(sock_net(sk), &fl4);
if (IS_ERR(rt)) if (IS_ERR(rt))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册