minor: dhcp_network_changed(): assert for valid state, fix coding style

This commit is contained in:
sg 2017-02-03 21:20:39 +01:00
parent 855ea02b15
commit 1839153609

View File

@ -845,8 +845,9 @@ dhcp_network_changed(struct netif *netif)
{
struct dhcp *dhcp = netif_dhcp_data(netif);
if (!dhcp)
if (!dhcp) {
return;
}
switch (dhcp->state) {
case DHCP_STATE_REBINDING:
case DHCP_STATE_RENEWING:
@ -859,6 +860,7 @@ dhcp_network_changed(struct netif *netif)
/* stay off */
break;
default:
LWIP_ASSERT("invalid dhcp->state", dhcp->state <= DHCP_STATE_BACKING_OFF);
/* INIT/REQUESTING/CHECKING/BACKING_OFF restart with new 'rid' because the
state changes, SELECTING: continue with current 'rid' as we stay in the
same state */