udp: fix inner packet checksum calculation in udp-encap 63/35663/1
authorMauro Sardara <[email protected]>
Tue, 22 Mar 2022 17:53:46 +0000 (17:53 +0000)
committerMauro Sardara <[email protected]>
Wed, 30 Mar 2022 18:37:38 +0000 (18:37 +0000)
commitd715d0bce8527d0865f2d8efec78bc92d8315c00
tree6a2bb96a6e16c8189648115e9d7ba91c5b3fda7d
parentf4011d19edefc2f4d4d3e0d08d6e3d7c7e0889d2
udp: fix inner packet checksum calculation in udp-encap

When computing the inner packet checksum, the code wrongly
assumes that the IP version of the inner packet is the
same of the outer one. On the contrary, it is perfectly
possible to encapsulate v6 packets into v4 and viceversa,
so we need to check the IP format of the inner header before
calling vnet_calc_checksums_inline.

Ticket: VPP-2020
Type: fix

Signed-off-by: Mauro Sardara <[email protected]>
Change-Id: Ia4515563c164f6dd5096832c831a48cb0a29b3ad
Signed-off-by: Mauro Sardara <[email protected]>
(cherry picked from commit 9539647b895c456ca53892a9259e3127c6b92d35)
src/vnet/ip/lookup.c
src/vnet/udp/udp_encap.c
src/vnet/udp/udp_encap.h
src/vnet/udp/udp_encap_node.c
src/vnet/udp/udp_inlines.h
src/vnet/vxlan-gpe/encap.c
test/test_udp.py