mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-01 04:12:07 +00:00
netif_set_link_up/down: only do something if the link state actually changes
This commit is contained in:
parent
2e795d2706
commit
29eb56a2f6
@ -119,6 +119,10 @@ HISTORY
|
||||
|
||||
++ Bugfixes:
|
||||
|
||||
2010-02-12: Simon Goldschmidt
|
||||
* netif.c: netif_set_link_up/down: only do something if the link state
|
||||
actually changes
|
||||
|
||||
2010-02-12: Simon Goldschmidt/Stephane Lesage
|
||||
* api_msg.c: Fixed bug #28865 (Cannot close socket/netconn in non-blocking
|
||||
connect)
|
||||
|
@ -506,6 +506,7 @@ void netif_set_status_callback(struct netif *netif, netif_status_callback_fn sta
|
||||
*/
|
||||
void netif_set_link_up(struct netif *netif )
|
||||
{
|
||||
if (!(netif->flags & NETIF_FLAG_LINK_UP)) {
|
||||
netif->flags |= NETIF_FLAG_LINK_UP;
|
||||
|
||||
#if LWIP_DHCP
|
||||
@ -537,15 +538,18 @@ void netif_set_link_up(struct netif *netif )
|
||||
}
|
||||
NETIF_LINK_CALLBACK(netif);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by a driver when its link goes down
|
||||
*/
|
||||
void netif_set_link_down(struct netif *netif )
|
||||
{
|
||||
if (netif->flags & NETIF_FLAG_LINK_UP) {
|
||||
netif->flags &= ~NETIF_FLAG_LINK_UP;
|
||||
NETIF_LINK_CALLBACK(netif);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set callback to be called when link is brought up/down
|
||||
|
Loading…
Reference in New Issue
Block a user