net/netdev: Add an algorithm to prevent an interface index from being reused until all network interfaces have by assigned once. The prevents removable devices from being removed, unregistered and re-installed, re-registered and keeping the same interface index.

This commit is contained in:
Gregory Nutt
2018-06-25 12:57:42 -06:00
parent c65e1aa3df
commit 5a0cf3c9a8
3 changed files with 47 additions and 18 deletions
+8
View File
@@ -89,6 +89,14 @@ EXTERN struct net_driver_s *g_netdevices;
*/
EXTERN uint32_t g_devset;
/* The set of network devices that have been freed. The purpose of this
* set is to postpone reuse of a interface index for as long as possible,
* i.e., don't reuse an interface index until all of the possible indices
* have been used.
*/
EXTERN uint32_t g_devfreed;
#endif
/****************************************************************************