diff options
author | Eric Dumazet <edumazet@google.com> | 2015-06-04 21:30:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-07 18:19:52 -0400 |
commit | b80c0e78582d4a3a004dc1ade4eb06babc6a4eea (patch) | |
tree | f2dda925e65212d4baacaa01a8b85f462a35b753 /net/ipv6 | |
parent | 13ea657806cf73b379a0109f7042182f47c351a7 (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.c | 19 |
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 | ||
44 | static 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 | |||
61 | static DEFINE_PER_CPU(__u32 [16 + 5 + SHA_WORKSPACE_WORDS], | 44 | static 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); |
268 | out: | 251 | out: |
269 | return ret; | 252 | return ret; |
270 | out_free: | 253 | out_free: |