summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorCong Wang <cwang@twopensource.com>2014-10-15 23:33:22 +0200
committerDavid S. Miller <davem@davemloft.net>2014-10-17 18:02:57 +0200
commit461b74c391c4ec9c766794e158508c357d8952e6 (patch)
tree19cfb1a79b6dc5c9141022985c3917fc2d90b7a1 /include/net
parentipv4: share tcp_v4_save_options() with cookie_v4_check() (diff)
downloadlinux-461b74c391c4ec9c766794e158508c357d8952e6.tar.xz
linux-461b74c391c4ec9c766794e158508c357d8952e6.zip
ipv4: clean up cookie_v4_check()
We can retrieve opt from skb, no need to pass it as a parameter. And opt should always be non-NULL, no need to check. Cc: Krzysztof Kolasa <kkolasa@winsoft.pl> Cc: Eric Dumazet <edumazet@google.com> Tested-by: Krzysztof Kolasa <kkolasa@winsoft.pl> 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 'include/net')
-rw-r--r--include/net/tcp.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 869637a7caf7..3a4bbbfdcf8d 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -468,8 +468,7 @@ void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
/* From syncookies.c */
int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th,
u32 cookie);
-struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
- struct ip_options *opt);
+struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb);
#ifdef CONFIG_SYN_COOKIES
/* Syncookies use a monotonic timer which increments every 60 seconds.
@@ -1674,7 +1673,7 @@ static inline 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) {
+ if (opt->optlen) {
int opt_size = sizeof(*dopt) + opt->optlen;
dopt = kmalloc(opt_size, GFP_ATOMIC);