1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

gnrc_ipv6/whitelist: switch assignment operation to memcpy()

This commit is contained in:
BytesGalore 2016-01-27 21:09:23 +01:00
parent 80023f07d8
commit 2d1671473b

View File

@ -13,6 +13,7 @@
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#include <string.h>
#include "bitfield.h"
#include "net/gnrc/ipv6/whitelist.h"
@ -32,8 +33,7 @@ int gnrc_ipv6_whitelist_add(const ipv6_addr_t *addr)
for (int i = 0; i < GNRC_IPV6_WHITELIST_SIZE; i++) {
if (!bf_isset(gnrc_ipv6_whitelist_set, i)) {
bf_set(gnrc_ipv6_whitelist_set, i);
gnrc_ipv6_whitelist[i].u64[0].u64 = addr->u64[0].u64;
gnrc_ipv6_whitelist[i].u64[1].u64 = addr->u64[1].u64;
memcpy(&gnrc_ipv6_whitelist[i], addr, sizeof(*addr));
DEBUG("IPv6 whitelist: whitelisted %s\n",
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)));
return 0;