Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195148
b: refs/heads/master
c: ab6e3fe
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 18, 2010
1 parent f890f95 commit b7e86fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a94445c9a5cf5461fb41d80040033b9a8e2a85a
refs/heads/master: ab6e3feba1f1bc3b9418b854da6f481408d243de
9 changes: 7 additions & 2 deletions trunk/net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,12 @@ int ip_queue_xmit(struct sk_buff *skb)
struct ip_options *opt = inet->opt;
struct rtable *rt;
struct iphdr *iph;
int res;

/* Skip all of this if the packet is already routed,
* f.e. by something like SCTP.
*/
rcu_read_lock();
rt = skb_rtable(skb);
if (rt != NULL)
goto packet_routed;
Expand Down Expand Up @@ -359,7 +361,7 @@ int ip_queue_xmit(struct sk_buff *skb)
}
sk_setup_caps(sk, &rt->u.dst);
}
skb_dst_set(skb, dst_clone(&rt->u.dst));
skb_dst_set_noref(skb, &rt->u.dst);

packet_routed:
if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway)
Expand Down Expand Up @@ -391,9 +393,12 @@ int ip_queue_xmit(struct sk_buff *skb)
skb->priority = sk->sk_priority;
skb->mark = sk->sk_mark;

return ip_local_out(skb);
res = ip_local_out(skb);
rcu_read_unlock();
return res;

no_route:
rcu_read_unlock();
IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
kfree_skb(skb);
return -EHOSTUNREACH;
Expand Down

0 comments on commit b7e86fc

Please sign in to comment.