Fix dual loop >= 4. Fix format specified for printing u64 counter.
[vpp.git] / vnet / vnet / map / ip4_map.c
index cf53ef4..6ed176c 100644 (file)
@@ -130,7 +130,7 @@ ip4_map_vtcfl (ip4_header_t *ip4, vlib_buffer_t *p)
   u8 tc = mm->tc_copy ? ip4->tos : mm->tc;
   u32 vtcfl = 0x6 << 28;
   vtcfl |= tc << 20;
-  vtcfl |= vnet_buffer(p)->ip.flow_hash && 0x000fffff;
+  vtcfl |= vnet_buffer(p)->ip.flow_hash & 0x000fffff;
 
   return (clib_host_to_net_u32(vtcfl));
 }
@@ -176,7 +176,7 @@ ip4_map (vlib_main_t *vm,
     vlib_get_next_frame(vm, node, next_index, to_next, n_left_to_next);
 
     /* Dual loop */
-    while (n_left_from > 4 && n_left_to_next > 2) {
+    while (n_left_from >= 4 && n_left_to_next >= 2) {
       u32 pi0, pi1;
       vlib_buffer_t *p0, *p1;
       map_domain_t *d0, *d1;