mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
examples/dtls-echo: Adapt to change in ipv6_addr_split_iface
This commit is contained in:
parent
4d4f6ae1d6
commit
65b852ba15
@ -328,8 +328,8 @@ dtls_context_t *_init_dtls(sock_udp_t *sock, sock_udp_ep_t *local,
|
||||
remote->port = (unsigned short) DTLS_DEFAULT_PORT;
|
||||
|
||||
/* Parsing <address>[:<iface>]:Port */
|
||||
int iface = ipv6_addr_split_iface(addr_str);
|
||||
if (iface == -1) {
|
||||
char *iface = ipv6_addr_split_iface(addr_str);
|
||||
if (!iface) {
|
||||
if (gnrc_netif_numof() == 1) {
|
||||
/* assign the single interface found in gnrc_netif_numof() */
|
||||
dst->ifindex = (uint16_t)gnrc_netif_iter(NULL)->pid;
|
||||
@ -341,7 +341,7 @@ dtls_context_t *_init_dtls(sock_udp_t *sock, sock_udp_ep_t *local,
|
||||
}
|
||||
}
|
||||
else {
|
||||
gnrc_netif_t *netif = gnrc_netif_get_by_pid(iface);
|
||||
gnrc_netif_t *netif = gnrc_netif_get_by_pid(atoi(iface));
|
||||
if (netif == NULL) {
|
||||
puts("ERROR: interface not valid");
|
||||
return new_context;
|
||||
|
Loading…
Reference in New Issue
Block a user