1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

examples/gnrc_networking_mac: Adapt to change in ipv6_addr_split_iface

This commit is contained in:
Leandro Lanzieri 2019-11-07 16:38:33 +01:00
parent 2856f166c6
commit a602e0afae

View File

@ -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) {