From 1839153609e1513186bb67e7a2b80fe074cecd5d Mon Sep 17 00:00:00 2001 From: sg Date: Fri, 3 Feb 2017 21:20:39 +0100 Subject: [PATCH] minor: dhcp_network_changed(): assert for valid state, fix coding style --- src/core/ipv4/dhcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/ipv4/dhcp.c b/src/core/ipv4/dhcp.c index dd354710..20852cb1 100644 --- a/src/core/ipv4/dhcp.c +++ b/src/core/ipv4/dhcp.c @@ -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 */