diff options
author | Cong Wang <cwang@twopensource.com> | 2014-10-15 14:33:21 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-17 12:02:57 -0400 |
commit | e25f866fbc8a4bf387b5dbe8e25aa5b07e55c74f (patch) | |
tree | df2c77e0b95e195dc496bba98155e2c62b9a80cd /net/ipv4/tcp_ipv4.c | |
parent | 2077eebf7d8bf20b36524de45851e28111a60c52 (diff) | |
download | op-kernel-dev-e25f866fbc8a4bf387b5dbe8e25aa5b07e55c74f.zip op-kernel-dev-e25f866fbc8a4bf387b5dbe8e25aa5b07e55c74f.tar.gz |
ipv4: share tcp_v4_save_options() with cookie_v4_check()
cookie_v4_check() allocates ip_options_rcu in the same way
with tcp_v4_save_options(), we can just make it a helper function.
Cc: Krzysztof Kolasa <kkolasa@winsoft.pl>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.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.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 552e87e..6a2a7d6 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -880,26 +880,6 @@ bool tcp_syn_flood_action(struct sock *sk, } EXPORT_SYMBOL(tcp_syn_flood_action); -/* - * Save and compile IPv4 options into the request_sock if needed. - */ -static struct ip_options_rcu *tcp_v4_save_options(struct sk_buff *skb) -{ - const struct ip_options *opt = &TCP_SKB_CB(skb)->header.h4.opt; - struct ip_options_rcu *dopt = NULL; - - if (opt && opt->optlen) { - int opt_size = sizeof(*dopt) + opt->optlen; - - dopt = kmalloc(opt_size, GFP_ATOMIC); - if (dopt && __ip_options_echo(&dopt->opt, skb, opt)) { - kfree(dopt); - dopt = NULL; - } - } - return dopt; -} - #ifdef CONFIG_TCP_MD5SIG /* * RFC2385 MD5 checksumming requires a mapping of |