Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/gnrc_netif: opt of _ipv6_get_iid() #10455

Merged
merged 1 commit into from
Nov 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion sys/net/gnrc/netif/gnrc_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,14 @@ int gnrc_netif_ipv6_get_iid(gnrc_netif_t *netif, eui64_t *eui64)
{
#if GNRC_NETIF_L2ADDR_MAXLEN > 0
if (netif->flags & GNRC_NETIF_FLAGS_HAS_L2ADDR) {
/* the device driver abstraction should be able to provide us with the
* IPV6_IID, so we try this first */
int res = netif->dev->driver->get(netif->dev, NETOPT_IPV6_IID,
eui64, sizeof(eui64_t));
if (res == sizeof(eui64_t)) {
return 0;
}

switch (netif->device_type) {
#ifdef MODULE_NETDEV_ETH
case NETDEV_TYPE_ETHERNET:
Expand Down Expand Up @@ -887,7 +895,8 @@ int gnrc_netif_ipv6_get_iid(gnrc_netif_t *netif, eui64_t *eui64)
break;
}
}
#endif
#endif /* GNRC_NETIF_L2ADDR_MAXLEN > 0 */

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change, but ok.

return -ENOTSUP;
}

Expand Down