aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-06 19:24:06 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-08 17:05:14 -0400
commitb57ae01a8a8446dbbed7365c9b05aef1fc6dea20 (patch)
tree14e18d9c67111e2fe44bad96b062794f3c14c98d /net/ipv4/ip_output.c
parent6e869138101bc607e4780187210b79d531f9b2ce (diff)
ipv4: Use cork flow in ip_queue_xmit()
All invokers of ip_queue_xmit() must make certain that the socket is locked. All of SCTP, TCP, DCCP, and L2TP now make sure this is the case. Therefore we can use the cork flow during output route lookup in ip_queue_xmit() when the socket route check fails. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r--net/ipv4/ip_output.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 0a2f49a442e8..4ba26d4040ed 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -317,6 +317,7 @@ int ip_queue_xmit(struct sk_buff *skb)
317 struct sock *sk = skb->sk; 317 struct sock *sk = skb->sk;
318 struct inet_sock *inet = inet_sk(sk); 318 struct inet_sock *inet = inet_sk(sk);
319 struct ip_options_rcu *inet_opt; 319 struct ip_options_rcu *inet_opt;
320 struct flowi4 *fl4;
320 struct rtable *rt; 321 struct rtable *rt;
321 struct iphdr *iph; 322 struct iphdr *iph;
322 int res; 323 int res;
@@ -331,9 +332,9 @@ int ip_queue_xmit(struct sk_buff *skb)
331 goto packet_routed; 332 goto packet_routed;
332 333
333 /* Make sure we can route this packet. */ 334 /* Make sure we can route this packet. */
335 fl4 = &inet->cork.fl.u.ip4;
334 rt = (struct rtable *)__sk_dst_check(sk, 0); 336 rt = (struct rtable *)__sk_dst_check(sk, 0);
335 if (rt == NULL) { 337 if (rt == NULL) {
336 struct flowi4 fl4;
337 __be32 daddr; 338 __be32 daddr;
338 339
339 /* Use correct destination address if we have options. */ 340 /* Use correct destination address if we have options. */
@@ -345,7 +346,7 @@ int ip_queue_xmit(struct sk_buff *skb)
345 * keep trying until route appears or the connection times 346 * keep trying until route appears or the connection times
346 * itself out. 347 * itself out.
347 */ 348 */
348 rt = ip_route_output_ports(sock_net(sk), &fl4, sk, 349 rt = ip_route_output_ports(sock_net(sk), fl4, sk,
349 daddr, inet->inet_saddr, 350 daddr, inet->inet_saddr,
350 inet->inet_dport, 351 inet->inet_dport,
351 inet->inet_sport, 352 inet->inet_sport,