mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/net/grnc/netreg: avoid creating an infinite loop
This commit is contained in:
parent
7d1ef9d99b
commit
b7a5261508
@ -152,6 +152,13 @@ int gnrc_netreg_register(gnrc_nettype_t type, gnrc_netreg_entry_t *entry)
|
||||
}
|
||||
|
||||
_gnrc_netreg_acquire_exclusive();
|
||||
|
||||
/* don't add the same entry twice */
|
||||
gnrc_netreg_entry_t *e;
|
||||
LL_FOREACH(netreg[type], e) {
|
||||
assert(entry != e);
|
||||
}
|
||||
|
||||
LL_PREPEND(netreg[type], entry);
|
||||
_gnrc_netreg_release_exclusive();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user