aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorOctavian Purdila <octavian.purdila@intel.com>2014-06-25 10:09:54 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-27 18:53:35 -0400
commitfb7b37a7f3d6f7b7ba05ee526fee96810d5b92a8 (patch)
tree9749a1ad29bee83b3adaaa41759e9c6b72536691 /net/ipv4/tcp_ipv4.c
parent16bea70aa7302b6f3bf3502d5a0efb4ea2ce4712 (diff)
tcp: add init_cookie_seq method to tcp_request_sock_ops
Move the specific IPv4/IPv6 cookie sequence initialization to a new method in tcp_request_sock_ops in preparation for unifying tcp_v4_conn_request and tcp_v6_conn_request. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index f86a86b30d20..8c69e44c287b 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1264,6 +1264,9 @@ static const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
1264 .calc_md5_hash = tcp_v4_md5_hash_skb, 1264 .calc_md5_hash = tcp_v4_md5_hash_skb,
1265#endif 1265#endif
1266 .init_req = tcp_v4_init_req, 1266 .init_req = tcp_v4_init_req,
1267#ifdef CONFIG_SYN_COOKIES
1268 .cookie_init_seq = cookie_v4_init_sequence,
1269#endif
1267}; 1270};
1268 1271
1269int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) 1272int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
@@ -1331,7 +1334,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1331 TCP_ECN_create_request(req, skb, sock_net(sk)); 1334 TCP_ECN_create_request(req, skb, sock_net(sk));
1332 1335
1333 if (want_cookie) { 1336 if (want_cookie) {
1334 isn = cookie_v4_init_sequence(sk, skb, &req->mss); 1337 isn = cookie_init_sequence(af_ops, sk, skb, &req->mss);
1335 req->cookie_ts = tmp_opt.tstamp_ok; 1338 req->cookie_ts = tmp_opt.tstamp_ok;
1336 } else if (!isn) { 1339 } else if (!isn) {
1337 /* VJ's idea. We save last timestamp seen 1340 /* VJ's idea. We save last timestamp seen