You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/09/25 14:57:02 UTC

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #402: Network Monitor: Runtime selection of DHCP/Static IP with fall back set by the board, and a polled mode for HW lacking a PHY interrupt

patacongo commented on a change in pull request #402:
URL: https://github.com/apache/incubator-nuttx-apps/pull/402#discussion_r495045596



##########
File path: netutils/netinit/netinit.c
##########
@@ -357,6 +365,85 @@ static void netinit_set_macaddr(void)
 #  define netinit_set_macaddr()
 #endif
 
+#ifdef CONFIG_BOARDCTL_NETCONF
+/****************************************************************************
+ * Name: netinit_get_ipaddrs
+ *
+ * Description:
+ *   Setup IP addresses.
+ *
+ *   For 6LoWPAN, the IP address derives from the MAC address.  Setting it
+ *   to any user provided value is asking for trouble.
+ *
+ ****************************************************************************/
+
+static int netinit_get_ipaddrs(void)
+{
+#ifdef CONFIG_NETINIT_DHCPC
+  bool use_dhcp   = false;
+#endif
+  bool use_static = false;
+#ifdef CONFIG_NET_IPv4
+  struct in_addr addr;
+
+  int ret = boardctl(BOARDIOC_NETCONF, (uintptr_t) &g_netconf);

Review comment:
       As I disucss in apache/incubator-nuttx#1886, I do not think it is appropriate to use boardctl() for this purpose when the established, mostly standard ways of getting this information.  NuttX is ALL about conformance to standards and we must be faithful to that.
   
   boardctl() is unfortunately necessary, but we cannot let it be an expedient, low-effort solution for system interface issues that already have standard solutions.  We must to the work as necessary and not cut corners.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org