syncookies.c (20c59de2e6b6bc74bbf714dcd4e720afe8d516cf) syncookies.c (af9b4738574b46025de7ccbe75c7b24fd8914379)
1/*
2 * IPv6 Syncookies implementation for the Linux kernel
3 *
4 * Authors:
5 * Glenn Griffin <ggriffin.kernel@gmail.com>
6 *
7 * Based on IPv4 implementation by Andi Kleen
8 * linux/net/ipv4/syncookies.c

--- 160 unchanged lines hidden (view full) ---

169 const struct tcphdr *th = tcp_hdr(skb);
170 __u32 cookie = ntohl(th->ack_seq) - 1;
171 struct sock *ret = sk;
172 struct request_sock *req;
173 int mss;
174 struct dst_entry *dst;
175 __u8 rcv_wscale;
176
1/*
2 * IPv6 Syncookies implementation for the Linux kernel
3 *
4 * Authors:
5 * Glenn Griffin <ggriffin.kernel@gmail.com>
6 *
7 * Based on IPv4 implementation by Andi Kleen
8 * linux/net/ipv4/syncookies.c

--- 160 unchanged lines hidden (view full) ---

169 const struct tcphdr *th = tcp_hdr(skb);
170 __u32 cookie = ntohl(th->ack_seq) - 1;
171 struct sock *ret = sk;
172 struct request_sock *req;
173 int mss;
174 struct dst_entry *dst;
175 __u8 rcv_wscale;
176
177 if (!sysctl_tcp_syncookies || !th->ack)
177 if (!sysctl_tcp_syncookies || !th->ack || th->rst)
178 goto out;
179
180 if (tcp_synq_no_recent_overflow(sk) ||
181 (mss = cookie_check(skb, cookie)) == 0) {
182 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED);
183 goto out;
184 }
185

--- 94 unchanged lines hidden ---
178 goto out;
179
180 if (tcp_synq_no_recent_overflow(sk) ||
181 (mss = cookie_check(skb, cookie)) == 0) {
182 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESFAILED);
183 goto out;
184 }
185

--- 94 unchanged lines hidden ---