diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index e20bcf0061af6d01f7dddab0743950324e24726a..d774bcd9a54bce80ae679c8700a0bc8eaec1a088 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1729,6 +1729,8 @@ int tcp_v4_rcv(struct sk_buff *skb) } if (nsk == sk) { reqsk_put(req); + } else if (tcp_filter(sk, skb)) { + goto discard_and_relse; } else if (tcp_child_process(sk, nsk, skb)) { tcp_v4_send_reset(nsk, skb); goto discard_and_relse; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 68dc7472b44d2d91e1119a91a5a17fb37fb01a2f..f85cbfc183d61e4fa9f0cfebbf16cac6675e3fe3 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1464,6 +1464,8 @@ static int tcp_v6_rcv(struct sk_buff *skb) if (nsk == sk) { reqsk_put(req); tcp_v6_restore_cb(skb); + } else if (tcp_filter(sk, skb)) { + goto discard_and_relse; } else if (tcp_child_process(sk, nsk, skb)) { tcp_v6_send_reset(nsk, skb); goto discard_and_relse;