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 15:31:05 UTC

[GitHub] [incubator-nuttx-apps] antmerlino 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

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



##########
File path: netutils/netinit/netinit.c
##########
@@ -533,6 +554,10 @@ static void netinit_configure(void)
 #ifndef CONFIG_NETINIT_NETLOCAL
   /* Bring the network up. */
 
+#ifdef CONFIG_NETINIT_DHCPC
+    memset(&g_ds, 0, sizeof(g_ds));

Review comment:
       Sorry for the long, somewhat tangent reply.
   
   I was curious about this comment. While I agree it is not necessary for the normal call vector, who says that `netinit_configure()` cannot be called a second time. In this case, I'd think ensuring a known state is a good idea.
   
   I was curious if it was called anywhere twice, so I searched where `netinit_configure()` is called from. The only place it is _currently_ called is `netinit_bringup()` or `netinit_thread()` (which `netinit_bringup()` launches) 
   
   But where is `netinit_bringup()` called from? 
   `nsh_consolemain()`
   Looking at the documentation I see:
   
   ``` 
    * Name: nsh_consolemain (Normal character device version)
    *
    * Description:
    *   This interfaces may be to called or started with task_start to start a
    *   single an NSH instance that operates on stdin and stdout.  This
    *   function does not normally return (see below).```
   
   I think this raises a concern. If I wanted multiple NSH consoles, does this mean that my network gets re-configured each time any of them come up?
   




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