aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/syncookies.c2
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv6/syncookies.c2
-rw-r--r--net/ipv6/tcp_ipv6.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 5c24db4a3c91..c9dac8615958 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -266,7 +266,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
266 struct rtable *rt; 266 struct rtable *rt;
267 __u8 rcv_wscale; 267 __u8 rcv_wscale;
268 268
269 if (!sysctl_tcp_syncookies || !th->ack) 269 if (!sysctl_tcp_syncookies || !th->ack || th->rst)
270 goto out; 270 goto out;
271 271
272 if (tcp_synq_no_recent_overflow(sk) || 272 if (tcp_synq_no_recent_overflow(sk) ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index a13f881e5037..6558dfd899da 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1506,7 +1506,7 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
1506 } 1506 }
1507 1507
1508#ifdef CONFIG_SYN_COOKIES 1508#ifdef CONFIG_SYN_COOKIES
1509 if (!th->rst && !th->syn && th->ack) 1509 if (!th->syn)
1510 sk = cookie_v4_check(sk, skb, &(IPCB(skb)->opt)); 1510 sk = cookie_v4_check(sk, skb, &(IPCB(skb)->opt));
1511#endif 1511#endif
1512 return sk; 1512 return sk;
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 12383705dbad..9fcb3ec7c838 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -174,7 +174,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
174 struct dst_entry *dst; 174 struct dst_entry *dst;
175 __u8 rcv_wscale; 175 __u8 rcv_wscale;
176 176
177 if (!sysctl_tcp_syncookies || !th->ack) 177 if (!sysctl_tcp_syncookies || !th->ack || th->rst)
178 goto out; 178 goto out;
179 179
180 if (tcp_synq_no_recent_overflow(sk) || 180 if (tcp_synq_no_recent_overflow(sk) ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index e487080d02db..5887141ad641 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1157,7 +1157,7 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
1157 } 1157 }
1158 1158
1159#ifdef CONFIG_SYN_COOKIES 1159#ifdef CONFIG_SYN_COOKIES
1160 if (!th->rst && !th->syn && th->ack) 1160 if (!th->syn)
1161 sk = cookie_v6_check(sk, skb); 1161 sk = cookie_v6_check(sk, skb);
1162#endif 1162#endif
1163 return sk; 1163 return sk;