mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 12:13:47 +00:00
minor: dhcp_network_changed(): assert for valid state, fix coding style
This commit is contained in:
parent
855ea02b15
commit
1839153609
@ -845,8 +845,9 @@ dhcp_network_changed(struct netif *netif)
|
|||||||
{
|
{
|
||||||
struct dhcp *dhcp = netif_dhcp_data(netif);
|
struct dhcp *dhcp = netif_dhcp_data(netif);
|
||||||
|
|
||||||
if (!dhcp)
|
if (!dhcp) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
switch (dhcp->state) {
|
switch (dhcp->state) {
|
||||||
case DHCP_STATE_REBINDING:
|
case DHCP_STATE_REBINDING:
|
||||||
case DHCP_STATE_RENEWING:
|
case DHCP_STATE_RENEWING:
|
||||||
@ -859,6 +860,7 @@ dhcp_network_changed(struct netif *netif)
|
|||||||
/* stay off */
|
/* stay off */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
LWIP_ASSERT("invalid dhcp->state", dhcp->state <= DHCP_STATE_BACKING_OFF);
|
||||||
/* INIT/REQUESTING/CHECKING/BACKING_OFF restart with new 'rid' because the
|
/* INIT/REQUESTING/CHECKING/BACKING_OFF restart with new 'rid' because the
|
||||||
state changes, SELECTING: continue with current 'rid' as we stay in the
|
state changes, SELECTING: continue with current 'rid' as we stay in the
|
||||||
same state */
|
same state */
|
||||||
|
Loading…
Reference in New Issue
Block a user