aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-03-22 17:53:46 +0000
committerMauro Sardara <msardara@cisco.com>2022-03-30 18:37:38 +0000
commitd715d0bce8527d0865f2d8efec78bc92d8315c00 (patch)
tree6a2bb96a6e16c8189648115e9d7ba91c5b3fda7d /test
parentf4011d19edefc2f4d4d3e0d08d6e3d7c7e0889d2 (diff)
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 <msardara@cisco.com> Change-Id: Ia4515563c164f6dd5096832c831a48cb0a29b3ad Signed-off-by: Mauro Sardara <msardara@cisco.com> (cherry picked from commit 9539647b895c456ca53892a9259e3127c6b92d35)
Diffstat (limited to 'test')
-rw-r--r--test/test_udp.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/test_udp.py b/test/test_udp.py
index df9a0af3b6c..81851055546 100644
--- a/test/test_udp.py
+++ b/test/test_udp.py
@@ -145,25 +145,30 @@ class TestUdpEncap(VppTestCase):
[VppRoutePath("0.0.0.0",
0xFFFFFFFF,
type=FibPathType.FIB_PATH_TYPE_UDP_ENCAP,
- next_hop_id=udp_encap_0.id)], table_id=1)
+ next_hop_id=udp_encap_0.id,
+ proto=FibPathProto.FIB_PATH_NH_PROTO_IP4)],
+ table_id=1)
route_4o6 = VppIpRoute(
self, "1.1.2.1", 32,
[VppRoutePath("0.0.0.0",
0xFFFFFFFF,
type=FibPathType.FIB_PATH_TYPE_UDP_ENCAP,
- next_hop_id=udp_encap_2.id)])
+ next_hop_id=udp_encap_2.id,
+ proto=FibPathProto.FIB_PATH_NH_PROTO_IP4)])
route_6o4 = VppIpRoute(
self, "2001::1", 128,
[VppRoutePath("0.0.0.0",
0xFFFFFFFF,
type=FibPathType.FIB_PATH_TYPE_UDP_ENCAP,
- next_hop_id=udp_encap_1.id)])
+ next_hop_id=udp_encap_1.id,
+ proto=FibPathProto.FIB_PATH_NH_PROTO_IP6)])
route_6o6 = VppIpRoute(
self, "2001::3", 128,
[VppRoutePath("0.0.0.0",
0xFFFFFFFF,
type=FibPathType.FIB_PATH_TYPE_UDP_ENCAP,
- next_hop_id=udp_encap_3.id)])
+ next_hop_id=udp_encap_3.id,
+ proto=FibPathProto.FIB_PATH_NH_PROTO_IP6)])
route_4o6.add_vpp_config()
route_6o6.add_vpp_config()
route_6o4.add_vpp_config()