vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel
commit61a2e1118c8a629c463e86a64ddb8d5bf5252b07
authorSu Yanjun <suyj.fnst@cn.fujitsu.com>
Mon, 7 Jan 2019 02:31:20 +0000 (6 21:31 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:03:11 +0000 (13 14:03 -0700)
treef00367370ee770c42b6c5142880f82bb61537031
parentaa4ba765e0903926de64b359e8653bfd29a3c353
vti4: Fix a ipip packet processing bug in 'IPCOMP' virtual tunnel

[ Upstream commit dd9ee3444014e8f28c0eefc9fffc9ac9c5248c12 ]

Recently we run a network test over ipcomp virtual tunnel.We find that
if a ipv4 packet needs fragment, then the peer can't receive
it.

We deep into the code and find that when packet need fragment the smaller
fragment will be encapsulated by ipip not ipcomp. So when the ipip packet
goes into xfrm, it's skb->dev is not properly set. The ipv4 reassembly code
always set skb'dev to the last fragment's dev. After ipv4 defrag processing,
when the kernel rp_filter parameter is set, the skb will be drop by -EXDEV
error.

This patch adds compatible support for the ipip process in ipcomp virtual tunnel.

Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/ip_vti.c