Skip to content
Commit 9487cc4c authored by Xin Long's avatar Xin Long Committed by Greg Kroah-Hartman
Browse files

netfilter: use skb_ip_totlen and iph_totlen



[ Upstream commit a13fbf5e ]

There are also quite some places in netfilter that may process IPv4 TCP
GSO packets, we need to replace them too.

In length_mt(), we have to use u_int32_t/int to accept skb_ip_totlen()
return value, otherwise it may overflow and mismatch. This change will
also help us add selftest for IPv4 BIG TCP in the following patch.

Note that we don't need to replace the one in tcpmss_tg4(), as it will
return if there is data after tcphdr in tcpmss_mangle_packet(). The
same in mangle_contents() in nf_nat_helper.c, it returns false when
skb->len + extra > 65535 in enlarge_skb().

Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Stable-dep-of: 0ae8e4cc ("netfilter: nf_tables: set transport offset from mac header for netdev/egress")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5f523f1b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment