diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-25 15:26:30 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-25 15:26:30 -0600 |
commit | 76d6af0fd310967d8bf08d01cfc1db00e4a0c757 (patch) | |
tree | 963a7f1a3e29449a2389cfbe0053d608e7e9d16a /apps/netutils/dhcpd/dhcpd.c | |
parent | 6b0412f5128e2fdf94852de586b3f90cbf476240 (diff) | |
download | nuttx-76d6af0fd310967d8bf08d01cfc1db00e4a0c757.tar.gz nuttx-76d6af0fd310967d8bf08d01cfc1db00e4a0c757.tar.bz2 nuttx-76d6af0fd310967d8bf08d01cfc1db00e4a0c757.zip |
Fixes for more issues found by cppcheck
Diffstat (limited to 'apps/netutils/dhcpd/dhcpd.c')
-rw-r--r-- | apps/netutils/dhcpd/dhcpd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/netutils/dhcpd/dhcpd.c b/apps/netutils/dhcpd/dhcpd.c index 93b061db7..cb58d0a43 100644 --- a/apps/netutils/dhcpd/dhcpd.c +++ b/apps/netutils/dhcpd/dhcpd.c @@ -478,8 +478,10 @@ static inline bool dhcpd_parseoptions(void) { uint32_t tmp; uint8_t *ptr; +#ifndef CONFIG_NET_DHCP_LIGHT uint8_t overloaded; uint8_t currfield; +#endif int optlen = 0; int remaining; @@ -498,8 +500,10 @@ static inline bool dhcpd_parseoptions(void) ptr += 4; remaining = DHCPD_OPTIONS_SIZE - 4; +#ifndef CONFIG_NET_DHCP_LIGHT overloaded = DHCPD_OPTION_FIELD; currfield = DHCPD_OPTION_FIELD; +#endif /* Set all options to the default value */ @@ -637,8 +641,7 @@ static inline bool dhcpd_verifyreqip(void) /* Verify that the requested IP address is within the supported lease range */ - if (g_state.ds_optreqip > 0 && - g_state.ds_optreqip >= CONFIG_NETUTILS_DHCPD_STARTIP && + if (g_state.ds_optreqip >= CONFIG_NETUTILS_DHCPD_STARTIP && g_state.ds_optreqip <= CONFIG_NETUTILS_DHCP_OPTION_ENDIP) { /* And verify that the lease has not already been taken or offered |