Clean up coverity warnings, VPP-486
[vpp.git] / vnet / vnet / ip / ip_input_acl.c
index fb7255e..6331cf4 100644 (file)
@@ -231,12 +231,13 @@ ip_inacl_inline (vlib_main_t * vm,
           table_index0 = vnet_buffer(b0)->l2_classify.table_index;
           e0 = 0;
           t0 = 0;
-
           vnet_get_config_data (am->vnet_config_main[tid],
-                                &vnet_buffer(b0)->ip.current_config_index,
+                                &b0->current_config_index,
                                 &next0,
                                 /* # bytes of config data */ 0);
 
+          vnet_buffer(b0)->l2_classify.opaque_index = ~0;
+
           if (PREDICT_TRUE(table_index0 != ~0))
             {
               hash0 = vnet_buffer(b0)->l2_classify.hash;
@@ -246,6 +247,8 @@ ip_inacl_inline (vlib_main_t * vm,
                                              now);
               if (e0)
                 {
+                  vnet_buffer(b0)->l2_classify.opaque_index
+                    = e0->opaque_index;
                   vlib_buffer_advance (b0, e0->advance);
 
                   next0 = (e0->next_index < n_next_nodes)?
@@ -290,6 +293,8 @@ ip_inacl_inline (vlib_main_t * vm,
                         (t0, (u8 *) h0, hash0, now);
                       if (e0)
                         {
+                          vnet_buffer(b0)->l2_classify.opaque_index
+                            = e0->opaque_index;
                           vlib_buffer_advance (b0, e0->advance);
                           next0 = (e0->next_index < n_next_nodes)?
                                    e0->next_index:next0;
@@ -317,7 +322,7 @@ ip_inacl_inline (vlib_main_t * vm,
               t->sw_if_index = vnet_buffer(b0)->sw_if_index[VLIB_RX];
               t->next_index = next0;
               t->table_index = t0 ? t0 - vcm->tables : ~0;
-              t->offset = e0 ? vnet_classify_get_offset (t0, e0): ~0;
+              t->offset = (e0 && t0) ? vnet_classify_get_offset (t0, e0): ~0;
             }
 
           /* verify speculative enqueue, maybe switch current next frame */
@@ -364,6 +369,8 @@ VLIB_REGISTER_NODE (ip4_inacl_node) = {
   },
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_inacl_node, ip4_inacl)
+
 static uword
 ip6_inacl (vlib_main_t * vm,
               vlib_node_runtime_t * node,
@@ -387,6 +394,8 @@ VLIB_REGISTER_NODE (ip6_inacl_node) = {
   },
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip6_inacl_node, ip6_inacl)
+
 static clib_error_t *
 ip_inacl_init (vlib_main_t * vm)
 {