VPP-189: Fix another batch of coverity warnings
authorDave Barach <[email protected]>
Sat, 30 Jul 2016 15:01:18 +0000 (11:01 -0400)
committerDave Barach <[email protected]>
Sat, 30 Jul 2016 15:01:37 +0000 (11:01 -0400)
Change-Id: I2b13894cca950ddb6732714f3acc180443552b5f
Signed-off-by: Dave Barach <[email protected]>
vnet/vnet/map/ip4_map.c
vnet/vnet/map/ip6_map.c
vnet/vnet/mpls-gre/interface.c
vpp/vpp-api/custom_dump.c

index 85b72e1..a40238f 100644 (file)
@@ -287,7 +287,7 @@ ip4_map (vlib_main_t *vm,
       if (dal60 == 0 && dar60 == 0 && error0 == MAP_ERROR_NONE && next0 != IP4_MAP_NEXT_REASS)
        error0 = MAP_ERROR_NO_BINDING;
       if (dal61 == 0 && dar61 == 0 && error1 == MAP_ERROR_NONE && next1 != IP4_MAP_NEXT_REASS)
-       error0 = MAP_ERROR_NO_BINDING;
+       error1 = MAP_ERROR_NO_BINDING;
 
       /* construct ipv6 header */
       vlib_buffer_advance(p0, - sizeof(ip6_header_t));
index 694d249..178b7c3 100644 (file)
@@ -274,7 +274,7 @@ ip6_map (vlib_main_t *vm,
            vnet_buffer(p1)->ip_frag.header_offset = 0;
            vnet_buffer(p1)->ip_frag.flags = 0;
            vnet_buffer(p1)->ip_frag.next_index = IP4_FRAG_NEXT_IP4_LOOKUP;
-           vnet_buffer(p1)->ip_frag.mtu = d0->mtu;
+           vnet_buffer(p1)->ip_frag.mtu = d1->mtu;
            next1 = IP6_MAP_NEXT_IP4_FRAGMENT;
          } else {
            next1 = ip6_map_ip4_lookup_bypass(p1, ip41) ? IP6_MAP_NEXT_IP4_REWRITE : next1;
index 5b78072..dd61a80 100644 (file)
@@ -412,7 +412,7 @@ mpls_eth_interface_tx (vlib_main_t * vm,
               tr->tunnel_id = t1 - gm->eth_tunnels;
               tr->tx_sw_if_index = t1->tx_sw_if_index;
               tr->mpls_encap_index = t1->encap_index;
-              tr->length = b0->current_length;
+              tr->length = b1->current_length;
               hi1 = vnet_get_sup_hw_interface (vnm, t1->tx_sw_if_index);
               clib_memcpy (tr->dst, hi1->hw_address, sizeof (tr->dst));
             }
index 651fdd3..a6898eb 100644 (file)
@@ -695,7 +695,7 @@ static void *vl_api_create_subif_t_print
     if (mp->outer_vlan_id)
         s = format (s, "outer_vlan_id %d ", ntohs (mp->outer_vlan_id));
 
-    if (mp->outer_vlan_id)
+    if (mp->inner_vlan_id)
         s = format (s, "inner_vlan_id %d ", ntohs (mp->inner_vlan_id));
 
 #define _(a) if (mp->a) s = format (s, "%s ", #a);