diff --git a/core/net/rime/rimeaddr.c b/core/net/rime/rimeaddr.c index 80899f802..c0b039b48 100644 --- a/core/net/rime/rimeaddr.c +++ b/core/net/rime/rimeaddr.c @@ -43,6 +43,7 @@ */ #include "net/rime/rimeaddr.h" +#include rimeaddr_t rimeaddr_node_addr; #if RIMEADDR_SIZE == 2 @@ -58,22 +59,13 @@ const rimeaddr_t rimeaddr_null = { { 0, 0, 0, 0, 0, 0, 0, 0 } }; void rimeaddr_copy(rimeaddr_t *dest, const rimeaddr_t *src) { - uint8_t i; - for(i = 0; i < RIMEADDR_SIZE; i++) { - dest->u8[i] = src->u8[i]; - } + memcpy(dest, src, RIMEADDR_SIZE); } /*---------------------------------------------------------------------------*/ int rimeaddr_cmp(const rimeaddr_t *addr1, const rimeaddr_t *addr2) { - uint8_t i; - for(i = 0; i < RIMEADDR_SIZE; i++) { - if(addr1->u8[i] != addr2->u8[i]) { - return 0; - } - } - return 1; + return (memcmp( addr1, addr2, RIMEADDR_SIZE) == 0); } /*---------------------------------------------------------------------------*/ void