aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-06-04 21:30:43 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-07 18:19:52 -0400
commitb80c0e78582d4a3a004dc1ade4eb06babc6a4eea (patch)
treef2dda925e65212d4baacaa01a8b85f462a35b753 /net/ipv6
parent13ea657806cf73b379a0109f7042182f47c351a7 (diff)
tcp: get_cookie_sock() consolidation
IPv4 and IPv6 share same implementation of get_cookie_sock(), and there is no point inlining it. We add tcp_ prefix to the common helper name and export it. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/syncookies.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 21bc2eb53c57..0909f4e0d53c 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -41,23 +41,6 @@ static __u16 const msstab[] = {
41 9000 - 60, 41 9000 - 60,
42}; 42};
43 43
44static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
45 struct request_sock *req,
46 struct dst_entry *dst)
47{
48 struct inet_connection_sock *icsk = inet_csk(sk);
49 struct sock *child;
50
51 child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst);
52 if (child) {
53 atomic_set(&req->rsk_refcnt, 1);
54 inet_csk_reqsk_queue_add(sk, req, child);
55 } else {
56 reqsk_free(req);
57 }
58 return child;
59}
60
61static DEFINE_PER_CPU(__u32 [16 + 5 + SHA_WORKSPACE_WORDS], 44static DEFINE_PER_CPU(__u32 [16 + 5 + SHA_WORKSPACE_WORDS],
62 ipv6_cookie_scratch); 45 ipv6_cookie_scratch);
63 46
@@ -264,7 +247,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
264 ireq->rcv_wscale = rcv_wscale; 247 ireq->rcv_wscale = rcv_wscale;
265 ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), dst); 248 ireq->ecn_ok = cookie_ecn_ok(&tcp_opt, sock_net(sk), dst);
266 249
267 ret = get_cookie_sock(sk, skb, req, dst); 250 ret = tcp_get_cookie_sock(sk, skb, req, dst);
268out: 251out:
269 return ret; 252 return ret;
270out_free: 253out_free: