Skip to content

Commit e65c332

Browse files
edumazetdavem330
authored andcommitted
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: Eric Dumazet <[email protected]> Acked-by: Neal Cardwell <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bb40aca commit e65c332

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

net/ipv4/tcp_ipv4.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
16021602

16031603
sk = req->rsk_listener;
16041604
if (unlikely(tcp_v4_inbound_md5_hash(sk, skb))) {
1605+
sk_drops_add(sk, skb);
16051606
reqsk_put(req);
16061607
goto discard_it;
16071608
}

net/ipv6/tcp_ipv6.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
14091409
sk = req->rsk_listener;
14101410
tcp_v6_fill_cb(skb, hdr, th);
14111411
if (tcp_v6_inbound_md5_hash(sk, skb)) {
1412+
sk_drops_add(sk, skb);
14121413
reqsk_put(req);
14131414
goto discard_it;
14141415
}

0 commit comments

Comments
 (0)