netfilter: nf_flow_table: ignore DF bit setting
authorFlorian Westphal <fw@strlen.de>
Tue, 21 May 2019 11:24:30 +0000 (13:24 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 22 May 2019 08:51:49 +0000 (10:51 +0200)
Its irrelevant if the DF bit is set or not, we must pass packet to
stack in either case.

If the DF bit is set, we must pass it to stack so the appropriate
ICMP error can be generated.

If the DF is not set, we must pass it to stack for fragmentation.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_flow_table_ip.c

index 0d603e2..bfd44db 100644 (file)
@@ -243,8 +243,7 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
        rt = (struct rtable *)flow->tuplehash[dir].tuple.dst_cache;
        outdev = rt->dst.dev;
 
-       if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)) &&
-           (ip_hdr(skb)->frag_off & htons(IP_DF)) != 0)
+       if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
                return NF_ACCEPT;
 
        if (skb_try_make_writable(skb, sizeof(*iph)))