Commit b115c775 authored by Paolo Abeni's avatar Paolo Abeni Committed by Jakub Kicinski
Browse files

tcp: do not increment BeyondWindow MIB for old seq



The mentioned MIB is currently incremented even when a packet
with an old sequence number (i.e. a zero window probe) is received,
which is IMHO misleading.

Explicitly restrict such MIB increment at the relevant events.

Fixes: 6c758062 ("tcp: add LINUX_MIB_BEYOND_WINDOW")
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Link: https://patch.msgid.link/20d147292eb4b13b6535e0ad6f56be64d9c330d3.1753118029.git.pabeni@redhat.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 972ca7a3
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -5915,7 +5915,11 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
		if (!th->rst) {
			if (th->syn)
				goto syn_challenge;
			NET_INC_STATS(sock_net(sk), LINUX_MIB_BEYOND_WINDOW);

			if (reason == SKB_DROP_REASON_TCP_INVALID_SEQUENCE ||
			    reason == SKB_DROP_REASON_TCP_INVALID_END_SEQUENCE)
				NET_INC_STATS(sock_net(sk),
					      LINUX_MIB_BEYOND_WINDOW);
			if (!tcp_oow_rate_limited(sock_net(sk), skb,
						  LINUX_MIB_TCPACKSKIPPEDSEQ,
						  &tp->last_oow_ack_time))