From 0128e59938274c47e5c4b1a41f7f5a1b3c3882e8 Mon Sep 17 00:00:00 2001 From: John Lo Date: Fri, 3 Jun 2016 20:48:31 -0400 Subject: [PATCH] VPP-100: Fix IP4 local handling of TCP/IP fragmented packet Fix previous change that does not work on little endian machines. Use inline call ip4_is_fragment() which is endian neutral. Change-Id: I5a35d89d936650ab6c628dfc388b8c992a74a589 Signed-off-by: John Lo --- vnet/vnet/ip/ip4_forward.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c index 5c2ac3828a1..e9e5232f9e0 100644 --- a/vnet/vnet/ip/ip4_forward.c +++ b/vnet/vnet/ip/ip4_forward.c @@ -1785,8 +1785,8 @@ ip4_local (vlib_main_t * vm, /* Treat IP frag packets as "experimental" protocol for now until support of IP frag reassembly is implemented */ - proto0 = (ip0->flags_and_fragment_offset << 2) ? 0xfe : ip0->protocol; - proto1 = (ip1->flags_and_fragment_offset << 2) ? 0xfe : ip1->protocol; + proto0 = ip4_is_fragment(ip0) ? 0xfe : ip0->protocol; + proto1 = ip4_is_fragment(ip1) ? 0xfe : ip1->protocol; is_udp0 = proto0 == IP_PROTOCOL_UDP; is_udp1 = proto1 == IP_PROTOCOL_UDP; is_tcp_udp0 = is_udp0 || proto0 == IP_PROTOCOL_TCP; @@ -1980,7 +1980,7 @@ ip4_local (vlib_main_t * vm, /* Treat IP frag packets as "experimental" protocol for now until support of IP frag reassembly is implemented */ - proto0 = (ip0->flags_and_fragment_offset << 2) ? 0xfe : ip0->protocol; + proto0 = ip4_is_fragment(ip0) ? 0xfe : ip0->protocol; is_udp0 = proto0 == IP_PROTOCOL_UDP; is_tcp_udp0 = is_udp0 || proto0 == IP_PROTOCOL_TCP; -- 2.16.6