diff --git a/examples/rpl_udp/rpl.c b/examples/rpl_udp/rpl.c index a2fd418d0b..9e1f6aec8e 100644 --- a/examples/rpl_udp/rpl.c +++ b/examples/rpl_udp/rpl.c @@ -37,7 +37,6 @@ char monitor_stack_buffer[MONITOR_STACK_SIZE]; radio_address_t id; -ipv6_addr_t std_addr; uint8_t is_root = 0; @@ -104,18 +103,16 @@ void rpl_udp_init(int argc, char **argv) return; } - /* TODO: check if this works as intended */ - ipv6_addr_t prefix, tmp; - ipv6_addr_init(&std_addr, 0xabcd, 0x0, 0x0, 0x0, 0x3612, 0x00ff, 0xfe00, id); - ipv6_addr_init_prefix(&prefix, &std_addr, 64); - ndp_add_prefix_info(0, &prefix, 64, NDP_OPT_PI_VLIFETIME_INFINITE, - NDP_OPT_PI_PLIFETIME_INFINITE, 1, - ICMPV6_NDP_OPT_PI_FLAG_AUTONOM); - ipv6_init_as_router(); /* add global address */ - ipv6_addr_set_by_eui64(&tmp, 0, &std_addr); + ipv6_addr_t tmp; + /* initialize prefix */ + ipv6_addr_init(&tmp, 0xabcd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, id); + /* set host suffix */ + ipv6_addr_set_by_eui64(&tmp, 0, &tmp); ipv6_net_if_add_addr(0, &tmp, NDP_ADDR_STATE_PREFERRED, 0, 0, 0); + ipv6_init_as_router(); + /* set channel to 10 */ tcmd.transceivers = TRANSCEIVER; tcmd.data = &chan; diff --git a/examples/rpl_udp/rpl_udp.h b/examples/rpl_udp/rpl_udp.h index 5263364645..4146e70638 100644 --- a/examples/rpl_udp/rpl_udp.h +++ b/examples/rpl_udp/rpl_udp.h @@ -86,9 +86,6 @@ void *rpl_udp_monitor(void *arg); /** @brief The nodes radio address */ extern radio_address_t id; -/** @brief The node's default IP address */ -extern ipv6_addr_t std_addr; - /** @brief Char array for IP address printing */ extern char addr_str[IPV6_MAX_ADDR_STR_LEN]; #endif /* RPL_UDP_H */