Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e65c332d authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp: md5: increment sk_drops on syn_recv state



TCP MD5 mismatches do increment sk_drops counter in all states but
SYN_RECV.

This is very unlikely to happen in the real world, but worth adding
to help diagnostics.

We increase the parent (listener) sk_drops.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bb40aca7
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1602,6 +1602,7 @@ int tcp_v4_rcv(struct sk_buff *skb)


		sk = req->rsk_listener;
		sk = req->rsk_listener;
		if (unlikely(tcp_v4_inbound_md5_hash(sk, skb))) {
		if (unlikely(tcp_v4_inbound_md5_hash(sk, skb))) {
			sk_drops_add(sk, skb);
			reqsk_put(req);
			reqsk_put(req);
			goto discard_it;
			goto discard_it;
		}
		}
+1 −0
Original line number Original line Diff line number Diff line
@@ -1409,6 +1409,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
		sk = req->rsk_listener;
		sk = req->rsk_listener;
		tcp_v6_fill_cb(skb, hdr, th);
		tcp_v6_fill_cb(skb, hdr, th);
		if (tcp_v6_inbound_md5_hash(sk, skb)) {
		if (tcp_v6_inbound_md5_hash(sk, skb)) {
			sk_drops_add(sk, skb);
			reqsk_put(req);
			reqsk_put(req);
			goto discard_it;
			goto discard_it;
		}
		}