VPP-243 - Coding style changes - updated emacs LISP styleify
[vpp.git] / vnet / vnet / l2 / l2_flood.c
index 0d25f58..61554ac 100644 (file)
@@ -87,7 +87,7 @@ static vlib_node_registration_t l2flood_node;
 _(L2FLOOD,           "L2 flood packets")                       \
 _(REPL_FAIL,         "L2 replication failures")                        \
 _(NO_MEMBERS,        "L2 replication complete")                        \
-_(BVI_TAGGED,        "BVI packet with vlan tag")               \
+_(BVI_BAD_MAC,       "BVI L3 mac mismatch")                    \
 _(BVI_ETHERTYPE,     "BVI packet with unhandled ethertype")
 
 typedef enum {
@@ -174,7 +174,7 @@ l2flood_process (vlib_main_t * vm,
          (!in_shg || members[0].shg != in_shg)))) {
       // If more than one member then initiate replication
       ctx = replication_prep (vm, b0, l2flood_node.index, 1 /* l2_packet */);
-      ctx->feature_replicas = (u64) members;
+      ctx->feature_replicas = (uword) members;
       ctx->feature_counter = current_member;
     }
 
@@ -194,7 +194,7 @@ l2flood_process (vlib_main_t * vm,
     ctx = replication_get_ctx (b0);
     replication_clear_recycled (b0);
 
-    members = (l2_flood_member_t *) ctx->feature_replicas;
+    members = (l2_flood_member_t *)(intptr_t) ctx->feature_replicas;
     current_member = (i32)ctx->feature_counter - 1;
 
     // Need to update input index from saved packet context
@@ -247,8 +247,8 @@ l2flood_process (vlib_main_t * vm,
                     next0);
 
     if (PREDICT_FALSE(rc)) {
-      if (rc == TO_BVI_ERR_TAGGED) {
-        b0->error = node->errors[L2FLOOD_ERROR_BVI_TAGGED];
+      if (rc == TO_BVI_ERR_BAD_MAC) {
+        b0->error = node->errors[L2FLOOD_ERROR_BVI_BAD_MAC];
         *next0 = L2FLOOD_NEXT_DROP;
       } else if (rc == TO_BVI_ERR_ETHERTYPE) {
         b0->error = node->errors[L2FLOOD_ERROR_BVI_ETHERTYPE];
@@ -350,8 +350,8 @@ l2flood_node_fn (vlib_main_t * vm,
                  ethernet_header_t * h0 = vlib_buffer_get_current (b0); 
                   t->sw_if_index = sw_if_index0;
                   t->bd_index = vnet_buffer(b0)->l2.bd_index;
-                  memcpy(t->src, h0->src_address, 6);
-                  memcpy(t->dst, h0->dst_address, 6);
+                  clib_memcpy(t->src, h0->src_address, 6);
+                  clib_memcpy(t->dst, h0->dst_address, 6);
                 }
               if (PREDICT_FALSE(b1->flags & VLIB_BUFFER_IS_TRACED))
                 {
@@ -359,8 +359,8 @@ l2flood_node_fn (vlib_main_t * vm,
                  ethernet_header_t * h1 = vlib_buffer_get_current (b1); 
                   t->sw_if_index = sw_if_index1;
                   t->bd_index = vnet_buffer(b1)->l2.bd_index;
-                  memcpy(t->src, h1->src_address, 6);
-                  memcpy(t->dst, h1->dst_address, 6);
+                  clib_memcpy(t->src, h1->src_address, 6);
+                  clib_memcpy(t->dst, h1->dst_address, 6);
                 }
             }
 
@@ -406,8 +406,8 @@ l2flood_node_fn (vlib_main_t * vm,
              ethernet_header_t * h0 = vlib_buffer_get_current (b0); 
               t->sw_if_index = sw_if_index0;
               t->bd_index = vnet_buffer(b0)->l2.bd_index;
-              memcpy(t->src, h0->src_address, 6);
-              memcpy(t->dst, h0->dst_address, 6);
+              clib_memcpy(t->src, h0->src_address, 6);
+              clib_memcpy(t->dst, h0->dst_address, 6);
             }
 
           /* verify speculative enqueue, maybe switch current next frame */
@@ -442,6 +442,8 @@ VLIB_REGISTER_NODE (l2flood_node,static) = {
   },
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (l2flood_node, l2flood_node_fn)
+
 clib_error_t *l2flood_init (vlib_main_t *vm)
 {
   l2flood_main_t * mp = &l2flood_main;