diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-12-25 12:14:24 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-12-25 12:14:24 -0600 |
commit | 904290645f804de5db4c585f2a0b240658e94312 (patch) | |
tree | a086abca24e39e04679f713df4d4c4a5d5f89372 /apps | |
parent | c08be22cfcddb8103d0cb8a3f4696035f1e3e46c (diff) | |
download | nuttx-904290645f804de5db4c585f2a0b240658e94312.tar.gz nuttx-904290645f804de5db4c585f2a0b240658e94312.tar.bz2 nuttx-904290645f804de5db4c585f2a0b240658e94312.zip |
Viewtool STM32F107: Add a NSH configuration with network support
Diffstat (limited to 'apps')
-rw-r--r-- | apps/netutils/uiplib/uip_setmacaddr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/netutils/uiplib/uip_setmacaddr.c b/apps/netutils/uiplib/uip_setmacaddr.c index f6cbe4132..49323d833 100644 --- a/apps/netutils/uiplib/uip_setmacaddr.c +++ b/apps/netutils/uiplib/uip_setmacaddr.c @@ -84,6 +84,7 @@ int uip_setmacaddr(const char *ifname, const uint8_t *macaddr) { int ret = ERROR; + if (ifname && macaddr) { /* Get a socket (only so that we get access to the INET subsystem) */ @@ -102,12 +103,13 @@ int uip_setmacaddr(const char *ifname, const uint8_t *macaddr) req.ifr_hwaddr.sa_family = AF_INETX; memcpy(&req.ifr_hwaddr.sa_data, macaddr, IFHWADDRLEN); - /* Perforom the ioctl to set the MAC address */ + /* Perform the ioctl to set the MAC address */ ret = ioctl(sockfd, SIOCSIFHWADDR, (unsigned long)&req); close(sockfd); } } + return ret; } |