l2fib: MAC: Fix uint64 to u8 byte array
[vpp.git] / src / vnet / l2 / l2_api.c
index 989081f..8fd94b0 100644 (file)
@@ -133,7 +133,7 @@ send_l2fib_table_entry (vpe_api_main_t * am,
   mp->bd_id =
     ntohl (l2input_main.bd_configs[l2fe_key->fields.bd_index].bd_id);
 
-  mp->mac = l2fib_make_key (l2fe_key->fields.mac, 0);
+  clib_memcpy (mp->mac, l2fe_key->fields.mac, 6);
   mp->sw_if_index = ntohl (l2fe_res->fields.sw_if_index);
   mp->static_mac = l2fe_res->fields.static_mac;
   mp->filter_mac = l2fe_res->fields.filter;
@@ -199,7 +199,9 @@ vl_api_l2fib_add_del_t_handler (vl_api_l2fib_add_del_t * mp)
     }
   u32 bd_index = p[0];
 
-  u64 mac = mp->mac;
+  u8 mac[6];
+
+  clib_memcpy (mac, mp->mac, 6);
   if (mp->is_add)
     {
       if (mp->filter_mac)
@@ -420,6 +422,7 @@ vl_api_bridge_domain_add_del_t_handler (vl_api_bridge_domain_add_del_t * mp)
     .arp_term = mp->arp_term,
     .mac_age = mp->mac_age,
     .bd_id = ntohl (mp->bd_id),
+    .bd_tag = mp->bd_tag
   };
 
   int rv = bd_add_del (&a);
@@ -451,6 +454,13 @@ send_bridge_domain_details (l2input_main_t * l2im,
   mp->arp_term = bd_feature_arp_term (bd_config);
   mp->bvi_sw_if_index = ntohl (bd_config->bvi_sw_if_index);
   mp->mac_age = bd_config->mac_age;
+  if (bd_config->bd_tag)
+    {
+      strncpy ((char *) mp->bd_tag, (char *) bd_config->bd_tag,
+              ARRAY_LEN (mp->bd_tag) - 1);
+      mp->bd_tag[ARRAY_LEN (mp->bd_tag) - 1] = 0;
+    }
+
   mp->context = context;
 
   sw_ifs = (vl_api_bridge_domain_sw_if_t *) mp->sw_if_details;