Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

Commit 0aea76d

Browse files
edumazetdavem330
authored andcommitted
tcp: SYN packets are now simply consumed
We now have proper per-listener but also per network namespace counters for SYN packets that might be dropped. We replace the kfree_skb() by consume_skb() to be drop monitor [1] friendly, and remove an obsolete comment. FastOpen SYN packets can carry payload in them just fine. [1] perf record -a -g -e skb:kfree_skb sleep 1; perf report Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1bc7fe6 commit 0aea76d

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

net/ipv4/tcp_input.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5815,24 +5815,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
58155815
if (icsk->icsk_af_ops->conn_request(sk, skb) < 0)
58165816
return 1;
58175817

5818-
/* Now we have several options: In theory there is
5819-
* nothing else in the frame. KA9Q has an option to
5820-
* send data with the syn, BSD accepts data with the
5821-
* syn up to the [to be] advertised window and
5822-
* Solaris 2.1 gives you a protocol error. For now
5823-
* we just ignore it, that fits the spec precisely
5824-
* and avoids incompatibilities. It would be nice in
5825-
* future to drop through and process the data.
5826-
*
5827-
* Now that TTCP is starting to be used we ought to
5828-
* queue this data.
5829-
* But, this leaves one open to an easy denial of
5830-
* service attack, and SYN cookies can't defend
5831-
* against this problem. So, we drop the data
5832-
* in the interest of security over speed unless
5833-
* it's still in use.
5834-
*/
5835-
kfree_skb(skb);
5818+
consume_skb(skb);
58365819
return 0;
58375820
}
58385821
goto discard;

0 commit comments

Comments
 (0)