diff options
author | John Lo <loj@cisco.com> | 2016-06-03 20:48:31 -0400 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2016-06-03 20:48:31 -0400 |
commit | 2671f1188d41313a6b54f5bd3d83973850f34934 (patch) | |
tree | d6a3f22e692e2514792ace1a236285cb91c69a40 /vnet | |
parent | b98a3a87a968d9675103e16b6d4b3949955288c0 (diff) |
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 <loj@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/ip/ip4_forward.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c index 353cb76eb8f..cb29d30ad37 100644 --- a/vnet/vnet/ip/ip4_forward.c +++ b/vnet/vnet/ip/ip4_forward.c @@ -1775,8 +1775,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; @@ -1970,7 +1970,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; |