From 9539647b895c456ca53892a9259e3127c6b92d35 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Tue, 22 Mar 2022 17:53:46 +0000 Subject: 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 Change-Id: Ia4515563c164f6dd5096832c831a48cb0a29b3ad Signed-off-by: Mauro Sardara --- src/vnet/ip/lookup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/vnet/ip/lookup.c') diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c index 92310e418c2..4da20df57a0 100644 --- a/src/vnet/ip/lookup.c +++ b/src/vnet/ip/lookup.c @@ -588,7 +588,13 @@ VLIB_CLI_COMMAND (vlib_cli_show_ip6_command, static) = { /* *INDENT-OFF* */ VLIB_CLI_COMMAND (ip_route_command, static) = { .path = "ip route", - .short_help = "ip route [add|del] [count ] / [table ] via [next-hop-address] [next-hop-interface] [next-hop-table ] [weight ] [preference ] [udp-encap-id ] [ip4-lookup-in-table ] [ip6-lookup-in-table ] [mpls-lookup-in-table ] [resolve-via-host] [resolve-via-connected] [rx-ip4 ] [out-labels ]", + .short_help = "ip route [add|del] [count ] / [table " + "] via [next-hop-address] [next-hop-interface] " + "[next-hop-table ] [weight ] [preference " + "] [udp-encap ] [ip4-lookup-in-table ] " + "[ip6-lookup-in-table ] [mpls-lookup-in-table ] " + "[resolve-via-host] [resolve-via-connected] [rx-ip4 " + "] [out-labels ]", .function = vnet_ip_route_cmd, .is_mp_safe = 1, }; -- cgit 1.2.3-korg