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

6lowpan: prefixes are initially all null pointers

Since the prefixes list stores pointers, one need to check for null pointers first.
This commit is contained in:
Oleg Hahm 2015-09-24 02:26:45 +02:00
parent ba023aecb8
commit 9b7b1bae37

View File

@ -52,7 +52,9 @@ static gnrc_sixlowpan_nd_router_prf_t *_get_free_prefix(ipv6_addr_t *prefix, siz
return &_prefixes[i];
}
if ((prf == NULL) && ipv6_addr_is_unspecified(&_prefixes[i].prefix->addr)) {
if ((prf == NULL) &&
((_prefixes[i].prefix == NULL) ||
ipv6_addr_is_unspecified(&_prefixes[i].prefix->addr))) {
prf = &_prefixes[i];
}
}