tests/gnrc_udp: Adapt to change in ipv6_addr_split_iface
This commit is contained in:
parent
c3a02d86df
commit
e64d327ea8
@ -82,8 +82,8 @@ static void *_eventloop(void *arg)
|
|||||||
static void send(char *addr_str, char *port_str, char *data_len_str, unsigned int num,
|
static void send(char *addr_str, char *port_str, char *data_len_str, unsigned int num,
|
||||||
unsigned int delay)
|
unsigned int delay)
|
||||||
{
|
{
|
||||||
gnrc_netif_t *netif;
|
gnrc_netif_t *netif = NULL;
|
||||||
int iface;
|
char *iface;
|
||||||
char *conversion_end;
|
char *conversion_end;
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
ipv6_addr_t addr;
|
ipv6_addr_t addr;
|
||||||
@ -91,11 +91,11 @@ static void send(char *addr_str, char *port_str, char *data_len_str, unsigned in
|
|||||||
|
|
||||||
/* get interface, if available */
|
/* get interface, if available */
|
||||||
iface = ipv6_addr_split_iface(addr_str);
|
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);
|
netif = gnrc_netif_iter(NULL);
|
||||||
}
|
}
|
||||||
else {
|
else if (iface) {
|
||||||
netif = gnrc_netif_get_by_pid(iface);
|
netif = gnrc_netif_get_by_pid(atoi(iface));
|
||||||
}
|
}
|
||||||
/* parse destination address */
|
/* parse destination address */
|
||||||
if (ipv6_addr_from_str(&addr, addr_str) == NULL) {
|
if (ipv6_addr_from_str(&addr, addr_str) == NULL) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user