Skip to content
Snippets Groups Projects
Commit c8aaea42 authored by Hauke Petersen's avatar Hauke Petersen
Browse files

drivers/netdev_eth: use eui48 for IID generation

parent ec37ff58
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <errno.h> #include <errno.h>
#include "net/netdev.h" #include "net/netdev.h"
#include "net/eui48.h"
#include "net/eui64.h" #include "net/eui64.h"
#include "net/ethernet.h" #include "net/ethernet.h"
...@@ -34,9 +35,9 @@ static int _get_iid(netdev_t *netdev, eui64_t *value, size_t max_len) ...@@ -34,9 +35,9 @@ static int _get_iid(netdev_t *netdev, eui64_t *value, size_t max_len)
return -EOVERFLOW; return -EOVERFLOW;
} }
uint8_t addr[ETHERNET_ADDR_LEN]; eui48_t mac;
netdev->driver->get(netdev, NETOPT_ADDRESS, addr, ETHERNET_ADDR_LEN); netdev->driver->get(netdev, NETOPT_ADDRESS, mac.uint8, sizeof(eui48_t));
ethernet_get_iid(value, addr); eui48_to_ipv6_iid(value, &mac);
return sizeof(eui64_t); return sizeof(eui64_t);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment