1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests: fix gnrc_sixlowpan test for gnrc_netif2

This commit is contained in:
Martine Lenders 2017-11-11 21:04:41 +01:00
parent 6cd91ee2cb
commit be00f5bfb6
No known key found for this signature in database
GPG Key ID: 8E97A9FE55F25D62

View File

@ -24,34 +24,34 @@
#include "shell.h"
#include "msg.h"
#include "net/ipv6/addr.h"
#include "net/gnrc/ipv6/netif.h"
#include "net/gnrc/pkt.h"
#include "net/gnrc/pktbuf.h"
#include "net/gnrc/netreg.h"
#include "net/gnrc/netapi.h"
#include "net/gnrc/netif.h"
#include "net/gnrc/netif2.h"
#include "net/gnrc/netif/hdr.h"
#include "net/gnrc/pktdump.h"
static void _init_interface(void)
{
kernel_pid_t ifs[GNRC_NETIF_NUMOF];
gnrc_netif2_t *netif = gnrc_netif2_iter(NULL);
ipv6_addr_t addr = IPV6_ADDR_UNSPECIFIED;
gnrc_netif_get(ifs);
/* fd01::01 */
addr.u8[0] = 0xfd;
addr.u8[1] = 0x01;
addr.u8[15] = 0x01;
gnrc_ipv6_netif_add_addr(ifs[0], &addr, 64, GNRC_IPV6_NETIF_ADDR_FLAGS_UNICAST);
if (gnrc_netapi_set(netif->pid, NETOPT_IPV6_ADDR, 64U << 8U, &addr,
sizeof(addr)) < 0) {
printf("error: unable to add IPv6 address fd01::1/64 to interface %u\n",
netif->pid);
}
}
static void _send_packet(void)
{
kernel_pid_t ifs[GNRC_NETIF_NUMOF];
gnrc_netif_get(ifs);
gnrc_netif2_t *netif = gnrc_netif2_iter(NULL);
struct {
gnrc_netif_hdr_t netif_hdr;
@ -64,7 +64,7 @@ static void _send_packet(void)
gnrc_netif_hdr_init(&(netif_hdr.netif_hdr), 8, 8);
netif_hdr.netif_hdr.if_pid = ifs[0];
netif_hdr.netif_hdr.if_pid = netif->pid;
uint8_t data1[] = {
/* 6LoWPAN Header */