From 5eeb95c4fc74f55cc5be5d74364ea4ec9933cbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Tue, 28 Jul 2015 09:07:40 +0200 Subject: [PATCH] [SQUASH ME] use ng_ipv6_addr_init_prefix() --- sys/net/routing/ng_rpl/ng_rpl_control_messages.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/sys/net/routing/ng_rpl/ng_rpl_control_messages.c b/sys/net/routing/ng_rpl/ng_rpl_control_messages.c index b34a86b35c87..d9dab4cf3ae1 100644 --- a/sys/net/routing/ng_rpl/ng_rpl_control_messages.c +++ b/sys/net/routing/ng_rpl/ng_rpl_control_messages.c @@ -152,18 +152,7 @@ void ng_rpl_send_DIO(ng_rpl_dodag_t *dodag, ng_ipv6_addr_t *destination) prefix_info->reserved = 0; memset(&prefix_info->prefix, 0, sizeof(prefix_info->prefix)); - prefix_info->prefix = dodag->dodag_id; - uint8_t pref_len = dodag->prefix_len; - - uint8_t i = sizeof(prefix_info->prefix.u8) - 1; - while (8 < pref_len) { - prefix_info->prefix.u8[i] = 0; - pref_len -= 8; - i--; - } - if (pref_len != 0) { - prefix_info->prefix.u8[i] = (prefix_info->prefix.u8[i] & (0xFF << (8 - pref_len))); - } + ng_ipv6_addr_init_prefix(&prefix_info->prefix, &dodag->dodag_id, dodag->prefix_len); pos += sizeof(*prefix_info); }