]> git.baikalelectronics.ru Git - kernel.git/commit
udp_offload: Set encapsulation before inner completes.
authorJarno Rajahalme <jarno@ovn.org>
Tue, 3 May 2016 23:10:21 +0000 (16:10 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 May 2016 22:25:26 +0000 (18:25 -0400)
commitdef48a77e9a7cdc932376fd024ba4e6bb09ed661
tree3ca6aa48885be0f37d0b7f4832936b183c630a80
parent945f6fe42841e94d260e5a967a1b59013f70da1c
udp_offload: Set encapsulation before inner completes.

UDP tunnel segmentation code relies on the inner offsets being set for
an UDP tunnel GSO packet, but the inner *_complete() functions will
set the inner offsets only if 'encapsulation' is set before calling
them.  Currently, udp_gro_complete() sets 'encapsulation' only after
the inner *_complete() functions are done.  This causes the inner
offsets having invalid values after udp_gro_complete() returns, which
in turn will make it impossible to properly segment the packet in case
it needs to be forwarded, which would be visible to the user either as
invalid packets being sent or as packet loss.

This patch fixes this by setting skb's 'encapsulation' in
udp_gro_complete() before calling into the inner complete functions,
and by making each possible UDP tunnel gro_complete() callback set the
inner_mac_header to the beginning of the tunnel payload.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Reviewed-by: Alexander Duyck <aduyck@mirantis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/geneve.c
drivers/net/vxlan.c
include/linux/netdevice.h
net/ipv4/fou.c
net/ipv4/udp_offload.c