Re: [PATCH nf] ipv4: fix conntrack defrag forwarding after ip_frag_reinit()

From: Eric Dumazet

Date: Thu Nov 19 2026 - 03:43:45 EST


Le jeu. 19 nov. 2026 à 07:18, Jiayuan Chen <jiayuan.chen@xxxxxxxxx> a écrit :
>
> q.max_size and max_df_size are used by ip_frag_reasm() to set
> IPCB(skb)->frag_max_size and the DF bit of the reassembled packet.
>
> ip_frag_reinit() reuses the queue for a new datagram but does not
> reset them, so the new datagram inherits them from the old one.
>
> On a router with conntrack defrag, if the largest fragment of the old
> datagram had DF set and was larger than the egress MTU, a new datagram
> without DF gets DF set after reassembly and is rejected with
> ICMP_FRAG_NEEDED, even though all its fragments fit.
>
> Reset both fields.
>
> Fixes: 5f2d04f1f9b5 ("ipv4: fix path MTU discovery with connection tracking")
> Fixes: d6b915e29f4a ("ip_fragment: don't forward defragmented DF packet")
> Signed-off-by: Jiayuan Chen <jiayuan.chen@xxxxxxxxx>

This only touches net/ipv4/ip_fragment.c, so this should target
the net tree ([PATCH net]), not nf.

Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>

Thanks.