From f7be559df32c149b1ca6346d95c5d96ba1e07629 Mon Sep 17 00:00:00 2001 From: Antonio Galea Date: Fri, 8 Nov 2019 15:04:19 +0100 Subject: [PATCH] USBUS CDC ECM: host and MCU mac addresses should differ --- sys/usb/usbus/cdc/ecm/cdc_ecm.c | 4 +--- sys/usb/usbus/cdc/ecm/cdc_ecm_netdev.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/usb/usbus/cdc/ecm/cdc_ecm.c b/sys/usb/usbus/cdc/ecm/cdc_ecm.c index 176850c26443..1fab24e833b9 100644 --- a/sys/usb/usbus/cdc/ecm/cdc_ecm.c +++ b/sys/usb/usbus/cdc/ecm/cdc_ecm.c @@ -155,9 +155,7 @@ static void _fill_ethernet(usbus_cdcecm_device_t *cdcecm) { uint8_t ethernet[ETHERNET_ADDR_LEN]; - luid_get(ethernet, ETHERNET_ADDR_LEN); - eui48_set_local((eui48_t*)ethernet); - eui48_clear_group((eui48_t*)ethernet); + luid_get_eui48((eui48_t*)ethernet); fmt_bytes_hex(cdcecm->mac_host, ethernet, sizeof(ethernet)); } diff --git a/sys/usb/usbus/cdc/ecm/cdc_ecm_netdev.c b/sys/usb/usbus/cdc/ecm/cdc_ecm_netdev.c index ca5b5e73d3cc..cc2391e5b2e4 100644 --- a/sys/usb/usbus/cdc/ecm/cdc_ecm_netdev.c +++ b/sys/usb/usbus/cdc/ecm/cdc_ecm_netdev.c @@ -145,9 +145,7 @@ static int _init(netdev_t *netdev) { usbus_cdcecm_device_t *cdcecm = _netdev_to_cdcecm(netdev); - luid_get(cdcecm->mac_netdev, ETHERNET_ADDR_LEN); - eui48_set_local((eui48_t*)cdcecm->mac_netdev); - eui48_clear_group((eui48_t*)cdcecm->mac_netdev); + luid_get_eui48((eui48_t*)cdcecm->mac_netdev); return 0; }