aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-06-03 20:48:31 -0400
committerJohn Lo <loj@cisco.com>2016-06-04 00:53:44 +0000
commit0128e59938274c47e5c4b1a41f7f5a1b3c3882e8 (patch)
treee8c7a7933e9d323e199e6966aae5a9fd35577bd0 /vnet
parent2b54e996d43a1b72337acdcc636d813598553fd8 (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.c6
1 files 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;