You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/09/27 04:20:30 UTC

[incubator-nuttx-apps] branch master updated (0dc5e9f46 -> 09dfbdf4c)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


    from 0dc5e9f46 Replace #include <queue.h> with #include <nuttx/queue.h>
     new cbcfe6be2 netutils/dhcpc: Set close-on-exec by default to avoid udp_conn leak
     new a1ea7f9df netinit: associate wlan if DRIVERS_IEEE80211 enabled
     new 09dfbdf4c netutls/dhcpc: treat EINTR as normal errno

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 netutils/dhcpc/dhcpc.c     | 6 +++---
 netutils/netinit/netinit.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)


[incubator-nuttx-apps] 03/03: netutls/dhcpc: treat EINTR as normal errno

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 09dfbdf4c7c1428cfc587dcd48bbd645b15d588d
Author: chao an <an...@xiaomi.com>
AuthorDate: Tue Sep 27 03:12:15 2022 +0800

    netutls/dhcpc: treat EINTR as normal errno
    
    A return code of EINTR is perfectly normal, and isn't an error as such.
    It's an indication that your program may need to do something because
    a signal occurred, but if not, should re-call recv().
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 netutils/dhcpc/dhcpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c
index 3ec6c4af6..43c2edc48 100644
--- a/netutils/dhcpc/dhcpc.c
+++ b/netutils/dhcpc/dhcpc.c
@@ -765,7 +765,7 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
            * of time). Then loop and send the DISCOVER command again.
            */
 
-          else if (errno != EAGAIN)
+          else if (errno != EAGAIN && errno != EINTR)
             {
               /* An error other than a timeout was received -- error out */
 
@@ -865,7 +865,7 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
            * (at most 3 times).
            */
 
-          else if (errno != EAGAIN)
+          else if (errno != EAGAIN && errno != EINTR)
             {
               /* An error other than a timeout was received */
 


[incubator-nuttx-apps] 02/03: netinit: associate wlan if DRIVERS_IEEE80211 enabled

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit a1ea7f9df7fd128ea69028276cf25cb75d7f410c
Author: chao an <an...@xiaomi.com>
AuthorDate: Tue Sep 27 02:58:16 2022 +0800

    netinit: associate wlan if DRIVERS_IEEE80211 enabled
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 netutils/netinit/netinit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netutils/netinit/netinit.c b/netutils/netinit/netinit.c
index 4bb78e173..5c16ff3c7 100644
--- a/netutils/netinit/netinit.c
+++ b/netutils/netinit/netinit.c
@@ -595,7 +595,7 @@ static void netinit_net_bringup(void)
       return;
     }
 
-#ifdef CONFIG_WIRELESS_WAPI
+#if defined(CONFIG_WIRELESS_WAPI) && defined(CONFIG_DRIVERS_IEEE80211)
   /* Associate the wlan with an access point. */
 
   if (netinit_associate(NET_DEVNAME) < 0)


[incubator-nuttx-apps] 01/03: netutils/dhcpc: Set close-on-exec by default to avoid udp_conn leak

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit cbcfe6be2804ba5a70c381689844058e198ed3f3
Author: chao an <an...@xiaomi.com>
AuthorDate: Tue Sep 27 02:56:21 2022 +0800

    netutils/dhcpc: Set close-on-exec by default to avoid udp_conn leak
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 netutils/dhcpc/dhcpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c
index efac5f701..3ec6c4af6 100644
--- a/netutils/dhcpc/dhcpc.c
+++ b/netutils/dhcpc/dhcpc.c
@@ -542,7 +542,7 @@ FAR void *dhcpc_open(FAR const char *interface, FAR const void *macaddr,
 
       /* Create a UDP socket */
 
-      pdhcpc->sockfd = socket(PF_INET, SOCK_DGRAM, 0);
+      pdhcpc->sockfd = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
       if (pdhcpc->sockfd < 0)
         {
           ninfo("socket handle %d\n", pdhcpc->sockfd);