mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
examples/gnrc_networking: Adapt to change in ipv6_addr_split_iface
This commit is contained in:
parent
7d41fcc87d
commit
2856f166c6
@ -39,19 +39,19 @@ 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) {
|
||||
puts("Error: unable to parse destination address");
|
||||
|
Loading…
Reference in New Issue
Block a user