netutils: get interface by name rather than ID

The zone ID part in a host part is the name of the network interface
(which by chance is the string representation of the ID with GNRC), not
the ID.
This commit is contained in:
Martine Lenders 2021-07-22 17:26:47 +02:00
parent 184501b242
commit 81c927f80a
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80

View File

@ -56,7 +56,7 @@ int netutils_get_ipv6(ipv6_addr_t *addr, netif_t **netif, const char *hostname)
size_t len = strlen(hostname);
char *iface = strchr(hostname, '%');
if (iface) {
*netif = netif_get_by_id(atoi(iface + 1));
*netif = netif_get_by_name(iface + 1);
len -= strlen(iface);
if (*netif == NULL) {