xiaoxiang781216 commented on code in PR #3315:
URL: https://github.com/apache/nuttx-apps/pull/3315#discussion_r2711397835
##########
netutils/netinit/netinit.c:
##########
@@ -296,6 +299,14 @@ static void netinit_set_macaddr(void)
/* Many embedded network interfaces must have a software assigned MAC */
+#if defined(CONFIG_NETINIT_WIFIMAC)
+ strlcpy((FAR char *)req.ifname, NET_DEVNAME, IFNAMSIZ);
Review Comment:
remove the cast
##########
netutils/netinit/netinit.c:
##########
@@ -296,6 +299,14 @@ static void netinit_set_macaddr(void)
/* Many embedded network interfaces must have a software assigned MAC */
+#if defined(CONFIG_NETINIT_WIFIMAC)
+ strlcpy((FAR char *)req.ifname, NET_DEVNAME, IFNAMSIZ);
+ if (boardctl(BOARDIOC_MACADDR, (uintptr_t)&req) == 0)
+ {
+ netlib_setmacaddr(NET_DEVNAME, req.macaddr);
+ }
+#endif
+
#if defined(CONFIG_NETINIT_UIDMAC)
Review Comment:
```suggestion
#elif defined(CONFIG_NETINIT_UIDMAC)
```
##########
netutils/netinit/netinit.c:
##########
@@ -286,6 +286,9 @@ static const uint16_t g_ipv6_netmask[8] =
defined(HAVE_MAC)
static void netinit_set_macaddr(void)
{
+#if defined(CONFIG_NETINIT_WIFIMAC)
+ struct boardioc_macaddr_s req;
+#endif
#if defined(CONFIG_NETINIT_UIDMAC)
Review Comment:
```suggestion
#elif defined(CONFIG_NETINIT_UIDMAC)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]