examples/dtls-wolfss: Use passed inerface if present
This commit is contained in:
parent
c1edee074a
commit
85e16cf55a
@ -109,12 +109,13 @@ int dtls_client(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (gnrc_netif_get_by_pid(iface) == NULL) {
|
gnrc_netif_t *netif = gnrc_netif_get_by_pid(iface);
|
||||||
|
if (netif == NULL) {
|
||||||
LOG(LOG_ERROR, "ERROR: interface not valid");
|
LOG(LOG_ERROR, "ERROR: interface not valid");
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
remote.netif = (uint16_t)gnrc_netif_iter(NULL)->pid;
|
remote.netif = (uint16_t)netif->pid;
|
||||||
}
|
}
|
||||||
if (ipv6_addr_from_str((ipv6_addr_t *)remote.addr.ipv6, addr_str) == NULL) {
|
if (ipv6_addr_from_str((ipv6_addr_t *)remote.addr.ipv6, addr_str) == NULL) {
|
||||||
LOG(LOG_ERROR, "ERROR: unable to parse destination address");
|
LOG(LOG_ERROR, "ERROR: unable to parse destination address");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user