diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-07 01:30:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-08 18:28:28 -0400 |
commit | ea4fc0d6193ff56fcef39b0d2210d402a7acb5f0 (patch) | |
tree | 175b9bca17331112f7aa7c6340b69320426f750b /net/ipv4/ip_output.c | |
parent | d9d8da805dcb503ef8ee49918a94d49085060f23 (diff) |
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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 14ee1e47720c..b88ee5fdcbca 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -327,12 +327,12 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl) | |||
327 | */ | 327 | */ |
328 | rcu_read_lock(); | 328 | rcu_read_lock(); |
329 | inet_opt = rcu_dereference(inet->inet_opt); | 329 | inet_opt = rcu_dereference(inet->inet_opt); |
330 | fl4 = &fl->u.ip4; | ||
330 | rt = skb_rtable(skb); | 331 | rt = skb_rtable(skb); |
331 | if (rt != NULL) | 332 | if (rt != NULL) |
332 | goto packet_routed; | 333 | goto packet_routed; |
333 | 334 | ||
334 | /* Make sure we can route this packet. */ | 335 | /* Make sure we can route this packet. */ |
335 | fl4 = &fl->u.ip4; | ||
336 | rt = (struct rtable *)__sk_dst_check(sk, 0); | 336 | rt = (struct rtable *)__sk_dst_check(sk, 0); |
337 | if (rt == NULL) { | 337 | if (rt == NULL) { |
338 | __be32 daddr; | 338 | __be32 daddr; |
@@ -360,7 +360,7 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl) | |||
360 | skb_dst_set_noref(skb, &rt->dst); | 360 | skb_dst_set_noref(skb, &rt->dst); |
361 | 361 | ||
362 | packet_routed: | 362 | packet_routed: |
363 | if (inet_opt && inet_opt->opt.is_strictroute && rt->rt_dst != rt->rt_gateway) | 363 | if (inet_opt && inet_opt->opt.is_strictroute && fl4->daddr != rt->rt_gateway) |
364 | goto no_route; | 364 | goto no_route; |
365 | 365 | ||
366 | /* OK, we know where to send it, allocate and build IP header. */ | 366 | /* OK, we know where to send it, allocate and build IP header. */ |
@@ -374,8 +374,8 @@ packet_routed: | |||
374 | iph->frag_off = 0; | 374 | iph->frag_off = 0; |
375 | iph->ttl = ip_select_ttl(inet, &rt->dst); | 375 | iph->ttl = ip_select_ttl(inet, &rt->dst); |
376 | iph->protocol = sk->sk_protocol; | 376 | iph->protocol = sk->sk_protocol; |
377 | iph->saddr = rt->rt_src; | 377 | iph->saddr = fl4->saddr; |
378 | iph->daddr = rt->rt_dst; | 378 | iph->daddr = fl4->daddr; |
379 | /* Transport layer set skb->h.foo itself. */ | 379 | /* Transport layer set skb->h.foo itself. */ |
380 | 380 | ||
381 | if (inet_opt && inet_opt->opt.optlen) { | 381 | if (inet_opt && inet_opt->opt.optlen) { |