Skip to content

Commit ea4fc0d

Browse files
committed
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>
1 parent d9d8da8 commit ea4fc0d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎net/ipv4/ip_output.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,12 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)
327327
*/
328328
rcu_read_lock();
329329
inet_opt = rcu_dereference(inet->inet_opt);
330+
fl4 = &fl->u.ip4;
330331
rt = skb_rtable(skb);
331332
if (rt != NULL)
332333
goto packet_routed;
333334

334335
/* Make sure we can route this packet. */
335-
fl4 = &fl->u.ip4;
336336
rt = (struct rtable *)__sk_dst_check(sk, 0);
337337
if (rt == NULL) {
338338
__be32 daddr;
@@ -360,7 +360,7 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)
360360
skb_dst_set_noref(skb, &rt->dst);
361361

362362
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)
364364
goto no_route;
365365

366366
/* 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)
374374
iph->frag_off = 0;
375375
iph->ttl = ip_select_ttl(inet, &rt->dst);
376376
iph->protocol = sk->sk_protocol;
377-
iph->saddr = rt->rt_src;
378-
iph->daddr = rt->rt_dst;
377+
iph->saddr = fl4->saddr;
378+
iph->daddr = fl4->daddr;
379379
/* Transport layer set skb->h.foo itself. */
380380

381381
if (inet_opt && inet_opt->opt.optlen) {

0 commit comments

Comments
 (0)