From c881c48eed87b0cbf1a788b4ee298674865407b8 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 21 Mar 2018 09:32:39 +0100 Subject: [PATCH] netif_add: check that the new netif is not already added --- src/core/netif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/netif.c b/src/core/netif.c index 4e888f44..1d668e27 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -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) {