netif_add: check that the new netif is not already added

This commit is contained in:
goldsimon 2018-03-21 09:32:39 +01:00
parent 600527dde7
commit c881c48eed

View File

@ -379,6 +379,7 @@ netif_add(struct netif *netif,
}
num_netifs = 0;
for (netif2 = netif_list; netif2 != NULL; netif2 = netif2->next) {
LWIP_ASSERT("netif already added", netif2 != netif);
num_netifs++;
LWIP_ASSERT("too many netifs, max. supported number is 255", num_netifs <= 255);
if (netif2->num == netif->num) {