Eliminate a warning when DHCP is not enabled

This commit is contained in:
Gregory Nutt
2013-09-17 10:48:30 -06:00
parent 98a8baeaf2
commit fd832f1c4a
2 changed files with 10 additions and 2 deletions

View File

@@ -647,3 +647,7 @@
of a single file. Provided by Lorenz Meier (2013-9-13). of a single file. Provided by Lorenz Meier (2013-9-13).
6.31 2013-xx-xx Gregory Nutt <gnutt@nuttx.org> 6.31 2013-xx-xx Gregory Nutt <gnutt@nuttx.org>
* apps/nshlib/nsh_netcmds.c: Remove a warning when DHCP is not
enabled (2013-9-17).

View File

@@ -572,7 +572,9 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
FAR char *mask = NULL; FAR char *mask = NULL;
FAR char *tmp = NULL; FAR char *tmp = NULL;
FAR char *hw = NULL; FAR char *hw = NULL;
#if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS)
FAR char *dns = NULL; FAR char *dns = NULL;
#endif
bool badarg = false; bool badarg = false;
uint8_t mac[IFHWADDRLEN]; uint8_t mac[IFHWADDRLEN];
#if defined(CONFIG_NSH_DHCPC) #if defined(CONFIG_NSH_DHCPC)
@@ -638,7 +640,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
badarg = true; badarg = true;
} }
} }
else if(!strcmp(tmp, "hw")) else if (!strcmp(tmp, "hw"))
{ {
if (argc-1>=i+1) if (argc-1>=i+1)
{ {
@@ -651,7 +653,8 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
badarg = true; badarg = true;
} }
} }
else if(!strcmp(tmp, "dns")) #if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS)
else if (!strcmp(tmp, "dns"))
{ {
if (argc-1 >= i+1) if (argc-1 >= i+1)
{ {
@@ -663,6 +666,7 @@ int cmd_ifconfig(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
badarg = true; badarg = true;
} }
} }
#endif
} }
} }
} }