From 8b597875e7e0d878dece7195c178a27e189d3edc Mon Sep 17 00:00:00 2001 From: Evgeny Safronov Date: Tue, 28 Apr 2026 09:35:06 +0300 Subject: [PATCH 1/2] Apply suggested fix to modules/route-mpls/dataplane/dataplane.c from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- modules/route-mpls/dataplane/dataplane.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/modules/route-mpls/dataplane/dataplane.c b/modules/route-mpls/dataplane/dataplane.c index 5c46a67a..a9a22d37 100644 --- a/modules/route-mpls/dataplane/dataplane.c +++ b/modules/route-mpls/dataplane/dataplane.c @@ -149,16 +149,24 @@ route_mpls_handle_packets( } // IANA-specified values - uint16_t src_port = htobe16(0xc000 | (0x3fff & packet->hash)); - uint16_t dst_port = htobe16(6635); + uint16_t src_port_value = 0xc000 | (0x3fff & packet->hash); + uint16_t dst_port_value = 6635; + uint8_t src_port[2] = { + (uint8_t)(src_port_value >> 8), + (uint8_t)(src_port_value & 0xff), + }; + uint8_t dst_port[2] = { + (uint8_t)(dst_port_value >> 8), + (uint8_t)(dst_port_value & 0xff), + }; if (nexthop->type == ROUTE_TYPE_V4) { if (packet_ip4_encap_udp( packet, nexthop->ip4_tunnel.src, nexthop->ip4_tunnel.dst, - (uint8_t *)&src_port, - (uint8_t *)&dst_port + src_port, + dst_port )) { // FIXME update error counter packet_front_drop(packet_front, packet); @@ -169,8 +177,8 @@ route_mpls_handle_packets( packet, nexthop->ip6_tunnel.src, nexthop->ip6_tunnel.dst, - (uint8_t *)&src_port, - (uint8_t *)&dst_port + src_port, + dst_port )) { // FIXME update error counter packet_front_drop(packet_front, packet); From f8e811ec8081f65423008417fdb4d1e7ce829bee Mon Sep 17 00:00:00 2001 From: Evgeny Safronov Date: Tue, 28 Apr 2026 09:35:07 +0300 Subject: [PATCH 2/2] Apply suggested fix to modules/route-mpls/dataplane/dataplane.c from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- modules/route-mpls/dataplane/dataplane.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/route-mpls/dataplane/dataplane.c b/modules/route-mpls/dataplane/dataplane.c index a9a22d37..b3240ff3 100644 --- a/modules/route-mpls/dataplane/dataplane.c +++ b/modules/route-mpls/dataplane/dataplane.c @@ -92,6 +92,7 @@ route_mpls_handle_packets( rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4)) { if (ip4_result[ip4_idx] == FILTER_RULE_INVALID) { ++ip4_idx; + packet_front_drop(packet_front, packet); continue; } @@ -104,6 +105,7 @@ route_mpls_handle_packets( rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) { if (ip6_result[ip6_idx] == FILTER_RULE_INVALID) { ++ip6_idx; + packet_front_drop(packet_front, packet); continue; }