bonding: API cleanup
[vpp.git] / src / vnet / bonding / bond_api.c
index 74334b5..ebbb80e 100644 (file)
@@ -23,6 +23,7 @@
 #include <vnet/interface.h>
 #include <vnet/api_errno.h>
 #include <vnet/ethernet/ethernet.h>
+#include <vnet/ethernet/ethernet_types_api.h>
 
 #include <vnet/vnet_msg_enum.h>
 
@@ -78,12 +79,12 @@ vl_api_bond_create_t_handler (vl_api_bond_create_t * mp)
 
   if (mp->use_custom_mac)
     {
-      clib_memcpy (ap->hw_addr, mp->mac_address, 6);
+      mac_address_decode (mp->mac_address, (mac_address_t *) ap->hw_addr);
       ap->hw_addr_set = 1;
     }
 
-  ap->mode = mp->mode;
-  ap->lb = mp->lb;
+  ap->mode = ntohl (mp->mode);
+  ap->lb = ntohl (mp->lb);
   ap->numa_only = mp->numa_only;
   bond_create_if (vm, ap);
 
@@ -168,8 +169,8 @@ bond_send_sw_interface_details (vpe_api_main_t * am,
   clib_memcpy (mp->interface_name, bond_if->interface_name,
               MIN (ARRAY_LEN (mp->interface_name) - 1,
                    strlen ((const char *) bond_if->interface_name)));
-  mp->mode = bond_if->mode;
-  mp->lb = bond_if->lb;
+  mp->mode = htonl (bond_if->mode);
+  mp->lb = htonl (bond_if->lb);
   mp->numa_only = bond_if->numa_only;
   mp->active_slaves = htonl (bond_if->active_slaves);
   mp->slaves = htonl (bond_if->slaves);