aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-06 19:10:41 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-08 16:18:53 -0400
commit2c42758cf6683e9c1657d20dcf2a7edd323d98ca (patch)
tree3428ab729bd16e11941fcb5eb5e4163077eb0e6a /net/dccp/ipv4.c
parent1ab7b6ac2709d0eb05a7144cd0e14faa3a7ea162 (diff)
dccp: Use cork flow in dccp_v4_connect()
Since this is invoked from inet_stream_connect() the socket is locked and therefore this usage is safe. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 36700a46b245..4ac1a728083a 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -45,7 +45,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
45 struct dccp_sock *dp = dccp_sk(sk); 45 struct dccp_sock *dp = dccp_sk(sk);
46 __be16 orig_sport, orig_dport; 46 __be16 orig_sport, orig_dport;
47 __be32 daddr, nexthop; 47 __be32 daddr, nexthop;
48 struct flowi4 fl4; 48 struct flowi4 *fl4;
49 struct rtable *rt; 49 struct rtable *rt;
50 int err; 50 int err;
51 struct ip_options_rcu *inet_opt; 51 struct ip_options_rcu *inet_opt;
@@ -70,7 +70,8 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
70 70
71 orig_sport = inet->inet_sport; 71 orig_sport = inet->inet_sport;
72 orig_dport = usin->sin_port; 72 orig_dport = usin->sin_port;
73 rt = ip_route_connect(&fl4, nexthop, inet->inet_saddr, 73 fl4 = &inet->cork.fl.u.ip4;
74 rt = ip_route_connect(fl4, nexthop, inet->inet_saddr,
74 RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, 75 RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,
75 IPPROTO_DCCP, 76 IPPROTO_DCCP,
76 orig_sport, orig_dport, sk, true); 77 orig_sport, orig_dport, sk, true);
@@ -83,10 +84,10 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
83 } 84 }
84 85
85 if (inet_opt == NULL || !inet_opt->opt.srr) 86 if (inet_opt == NULL || !inet_opt->opt.srr)
86 daddr = fl4.daddr; 87 daddr = fl4->daddr;
87 88
88 if (inet->inet_saddr == 0) 89 if (inet->inet_saddr == 0)
89 inet->inet_saddr = fl4.saddr; 90 inet->inet_saddr = fl4->saddr;
90 inet->inet_rcv_saddr = inet->inet_saddr; 91 inet->inet_rcv_saddr = inet->inet_saddr;
91 92
92 inet->inet_dport = usin->sin_port; 93 inet->inet_dport = usin->sin_port;
@@ -106,7 +107,7 @@ int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
106 if (err != 0) 107 if (err != 0)
107 goto failure; 108 goto failure;
108 109
109 rt = ip_route_newports(&fl4, rt, orig_sport, orig_dport, 110 rt = ip_route_newports(fl4, rt, orig_sport, orig_dport,
110 inet->inet_sport, inet->inet_dport, sk); 111 inet->inet_sport, inet->inet_dport, sk);
111 if (IS_ERR(rt)) { 112 if (IS_ERR(rt)) {
112 rt = NULL; 113 rt = NULL;