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

ipv4: Don't use rt->rt_{src,dst} in ip_queue_xmit().

Now we can pick it out of the provided flow key.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d9d8da80
...@@ -327,12 +327,12 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl) ...@@ -327,12 +327,12 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)
*/ */
rcu_read_lock(); rcu_read_lock();
inet_opt = rcu_dereference(inet->inet_opt); inet_opt = rcu_dereference(inet->inet_opt);
fl4 = &fl->u.ip4;
rt = skb_rtable(skb); rt = skb_rtable(skb);
if (rt != NULL) if (rt != NULL)
goto packet_routed; goto packet_routed;
/* Make sure we can route this packet. */ /* Make sure we can route this packet. */
fl4 = &fl->u.ip4;
rt = (struct rtable *)__sk_dst_check(sk, 0); rt = (struct rtable *)__sk_dst_check(sk, 0);
if (rt == NULL) { if (rt == NULL) {
__be32 daddr; __be32 daddr;
...@@ -360,7 +360,7 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl) ...@@ -360,7 +360,7 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)
skb_dst_set_noref(skb, &rt->dst); skb_dst_set_noref(skb, &rt->dst);
packet_routed: packet_routed:
if (inet_opt && inet_opt->opt.is_strictroute && rt->rt_dst != rt->rt_gateway) if (inet_opt && inet_opt->opt.is_strictroute && fl4->daddr != rt->rt_gateway)
goto no_route; goto no_route;
/* OK, we know where to send it, allocate and build IP header. */ /* OK, we know where to send it, allocate and build IP header. */
...@@ -374,8 +374,8 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl) ...@@ -374,8 +374,8 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)
iph->frag_off = 0; iph->frag_off = 0;
iph->ttl = ip_select_ttl(inet, &rt->dst); iph->ttl = ip_select_ttl(inet, &rt->dst);
iph->protocol = sk->sk_protocol; iph->protocol = sk->sk_protocol;
iph->saddr = rt->rt_src; iph->saddr = fl4->saddr;
iph->daddr = rt->rt_dst; iph->daddr = fl4->daddr;
/* Transport layer set skb->h.foo itself. */ /* Transport layer set skb->h.foo itself. */
if (inet_opt && inet_opt->opt.optlen) { if (inet_opt && inet_opt->opt.optlen) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册