From a602e0afae53d5b834555e1497c82d5c1f9ddf91 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 7 Nov 2019 16:38:33 +0100 Subject: [PATCH] examples/gnrc_networking_mac: Adapt to change in ipv6_addr_split_iface --- examples/gnrc_networking_mac/udp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/gnrc_networking_mac/udp.c b/examples/gnrc_networking_mac/udp.c index c22a26a202..134b8e5d61 100644 --- a/examples/gnrc_networking_mac/udp.c +++ b/examples/gnrc_networking_mac/udp.c @@ -39,18 +39,18 @@ static gnrc_netreg_entry_t server = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX static void send(char *addr_str, char *port_str, char *data, unsigned int num, unsigned int delay) { - gnrc_netif_t *netif; - int iface; + gnrc_netif_t *netif = NULL; + char *iface; uint16_t port; ipv6_addr_t addr; /* get interface, if available */ iface = ipv6_addr_split_iface(addr_str); - if ((iface < 0) && (gnrc_netif_numof() == 1)) { + if ((!iface) && (gnrc_netif_numof() == 1)) { netif = gnrc_netif_iter(NULL); } - else { - netif = gnrc_netif_get_by_pid(iface); + else if (iface){ + netif = gnrc_netif_get_by_pid(atoi(iface)); } /* parse destination address */ if (ipv6_addr_from_str(&addr, addr_str) == NULL) {