Skip to content

Commit

Permalink
fixed static unique len
Browse files Browse the repository at this point in the history
  • Loading branch information
eduazocar committed Sep 19, 2022
1 parent 405fa6e commit a528b4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions firmware/sys/uniqueid/uniqueid.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void get_uid_ipv6(ipv6_addr_t *addr, uniqueid_mode_t mode) {
memcpy(addr->u8, header.u8, 8);
char addr_cpu[CPUID_LEN];
CPUID(addr_cpu);
memcpy(addr->u8 + LAST_OCTECTS, addr_cpu, OCTETS_BYTE_SIZE);
memcpy(addr->u8 + LAST_OCTECTS, addr_cpu, CPUID_LEN <= 8? CPUID_LEN : OCTETS_BYTE_SIZE );
break;
case UNIQUEID_RANDOM_MODE:
ipv6_addr_from_str(&header, CONFIG_HEADER_ADDRESS_ID);
Expand All @@ -75,7 +75,7 @@ uint32_t get_uid_seed(void *val, const uint8_t len) {
netif_t *iface = netif_get_by_id(index);
netif_get_opt(iface, NETOPT_RANDOM, 0, &rval, sizeof(uint32_t));
#else
hwrng_init(void);
hwrng_init();
hwrng_read(&rval, sizeof(rval));
#endif
for (uint8_t i = 0; i < len; i++) {
Expand Down

0 comments on commit a528b4e

Please sign in to comment.