netdev_unreg: modyify netdev remove logical when mutil-netdev exist
This commit is contained in:
parent
2d7770ecdc
commit
90f86c2b71
|
@ -165,9 +165,17 @@ int netdev_unregister(struct netdev *netdev)
|
||||||
if (cur_netdev == netdev)
|
if (cur_netdev == netdev)
|
||||||
{
|
{
|
||||||
/* find this network interface device in network interface device list */
|
/* find this network interface device in network interface device list */
|
||||||
if (netdev_list == netdev && rt_slist_next(&netdev_list->list) == RT_NULL)
|
if (netdev_list == netdev)
|
||||||
{
|
{
|
||||||
netdev_list = RT_NULL;
|
rt_slist_t *next = rt_slist_next(node);
|
||||||
|
if (next)
|
||||||
|
{
|
||||||
|
netdev_list = rt_slist_entry(next, struct netdev, list);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
netdev_list = RT_NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue