aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vnet/interface.c9
-rw-r--r--src/vnet/interface_api.c11
-rw-r--r--src/vnet/interface_cli.c4
-rw-r--r--src/vnet/interface_funcs.h2
4 files changed, 10 insertions, 16 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index eb5d3d0fced..82eccc12436 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -1334,7 +1334,8 @@ vnet_rename_interface (vnet_main_t * vnm, u32 hw_if_index, char *new_name)
static clib_error_t *
vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
- u32 hw_if_index, u64 mac_address)
+ u32 hw_if_index,
+ u8 * mac_address)
{
clib_error_t *error = 0;
vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, hw_if_index);
@@ -1346,7 +1347,7 @@ vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
if (dev_class->mac_addr_change_function)
{
error =
- dev_class->mac_addr_change_function (hi, (char *) &mac_address);
+ dev_class->mac_addr_change_function (hi, (char *) mac_address);
}
if (!error)
{
@@ -1355,7 +1356,7 @@ vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
hw_class = vnet_get_hw_interface_class (vnm, hi->hw_class_index);
if (NULL != hw_class->mac_addr_change_function)
- hw_class->mac_addr_change_function (hi, (char *) &mac_address);
+ hw_class->mac_addr_change_function (hi, (char *) mac_address);
}
else
{
@@ -1376,7 +1377,7 @@ vnet_hw_interface_change_mac_address_helper (vnet_main_t * vnm,
clib_error_t *
vnet_hw_interface_change_mac_address (vnet_main_t * vnm, u32 hw_if_index,
- u64 mac_address)
+ u8 * mac_address)
{
return vnet_hw_interface_change_mac_address_helper
(vnm, hw_if_index, mac_address);
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index a6414bc9ac6..bd11d45d853 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -881,21 +881,14 @@ static void vl_api_sw_interface_set_mac_address_t_handler
vnet_main_t *vnm = vnet_get_main ();
u32 sw_if_index = ntohl (mp->sw_if_index);
vnet_sw_interface_t *si;
- u64 mac;
clib_error_t *error;
int rv = 0;
VALIDATE_SW_IF_INDEX (mp);
- mac = ((u64) mp->mac_address[0] << (8 * 0)
- | (u64) mp->mac_address[1] << (8 * 1)
- | (u64) mp->mac_address[2] << (8 * 2)
- | (u64) mp->mac_address[3] << (8 * 3)
- | (u64) mp->mac_address[4] << (8 * 4)
- | (u64) mp->mac_address[5] << (8 * 5));
-
si = vnet_get_sw_interface (vnm, sw_if_index);
- error = vnet_hw_interface_change_mac_address (vnm, si->hw_if_index, mac);
+ error = vnet_hw_interface_change_mac_address (vnm, si->hw_if_index,
+ mp->mac_address);
if (error)
{
rv = VNET_API_ERROR_UNIMPLEMENTED;
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index e5efb1faef7..0debdb4d0b7 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -1201,7 +1201,7 @@ set_interface_mac_address (vlib_main_t * vm, unformat_input_t * input,
vnet_sw_interface_t *si = NULL;
clib_error_t *error = 0;
u32 sw_if_index = ~0;
- u64 mac = 0;
+ u8 mac[6] = { 0 };
if (!unformat_user (input, unformat_vnet_sw_interface, vnm, &sw_if_index))
{
@@ -1209,7 +1209,7 @@ set_interface_mac_address (vlib_main_t * vm, unformat_input_t * input,
format_unformat_error, input);
goto done;
}
- if (!unformat_user (input, unformat_ethernet_address, &mac))
+ if (!unformat_user (input, unformat_ethernet_address, mac))
{
error = clib_error_return (0, "expected mac address `%U'",
format_unformat_error, input);
diff --git a/src/vnet/interface_funcs.h b/src/vnet/interface_funcs.h
index 6f7ed111e46..1f22e80f314 100644
--- a/src/vnet/interface_funcs.h
+++ b/src/vnet/interface_funcs.h
@@ -274,7 +274,7 @@ clib_error_t *vnet_rename_interface (vnet_main_t * vnm, u32 hw_if_index,
/* Change interface mac address*/
clib_error_t *vnet_hw_interface_change_mac_address (vnet_main_t * vnm,
u32 hw_if_index,
- u64 mac_address);
+ u8 * mac_address);
/* Change rx-mode */
clib_error_t *set_hw_interface_change_rx_mode (vnet_main_t * vnm,