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:
parent
184501b242
commit
81c927f80a
@ -56,7 +56,7 @@ int netutils_get_ipv6(ipv6_addr_t *addr, netif_t **netif, const char *hostname)
|
|||||||
size_t len = strlen(hostname);
|
size_t len = strlen(hostname);
|
||||||
char *iface = strchr(hostname, '%');
|
char *iface = strchr(hostname, '%');
|
||||||
if (iface) {
|
if (iface) {
|
||||||
*netif = netif_get_by_id(atoi(iface + 1));
|
*netif = netif_get_by_name(iface + 1);
|
||||||
len -= strlen(iface);
|
len -= strlen(iface);
|
||||||
|
|
||||||
if (*netif == NULL) {
|
if (*netif == NULL) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user