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 2023/07/01 05:18:34 UTC

[nuttx] branch master updated (245db6742c -> 248fe7529a)

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/nuttx.git


    from 245db6742c esp32s2: Fix UART1 default pins
     new 221d919b77 Revert "fs: nfs: Do not bind to a local port in TCP mode"
     new c2af551355 fs: nfs: Introduce CONFIG_NFS_DONT_BIND_TCP_SOCKET
     new 248fe7529a drivers: wireless: select NFS_DONT_BIND_TCP_SOCKET for GS2200M

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:
 drivers/wireless/Kconfig |  1 +
 fs/nfs/Kconfig           |  9 +++++++++
 fs/nfs/rpc_clnt.c        | 44 ++++++++++++++++++++++++++------------------
 3 files changed, 36 insertions(+), 18 deletions(-)


[nuttx] 03/03: drivers: wireless: select NFS_DONT_BIND_TCP_SOCKET for GS2200M

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/nuttx.git

commit 248fe7529ad8d1b2e71fed11a69db6fe0611288e
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Fri Jun 30 15:01:52 2023 +0900

    drivers: wireless: select NFS_DONT_BIND_TCP_SOCKET for GS2200M
    
    Summary:
    - https://github.com/apache/nuttx/pull/3707
    
    Impact:
    - None
    
    Testing:
    - Tested with spresense:wifi_smp
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 drivers/wireless/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/wireless/Kconfig b/drivers/wireless/Kconfig
index 5ffef5d87f..49c3a97f15 100644
--- a/drivers/wireless/Kconfig
+++ b/drivers/wireless/Kconfig
@@ -35,6 +35,7 @@ config WL_GS2200M
 	select LIBC_SCANSET
 	select SCHED_LPWORK
 	select DRIVERS_IEEE80211
+	select NFS_DONT_BIND_TCP_SOCKET if NFS
 
 if WL_GS2200M
 


[nuttx] 01/03: Revert "fs: nfs: Do not bind to a local port in TCP mode"

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/nuttx.git

commit 221d919b77e06ce6c09b293daf86b9a885291303
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Fri Jun 30 14:07:07 2023 +0900

    Revert "fs: nfs: Do not bind to a local port in TCP mode"
    
    This reverts commit e1b14271c85f4aa0a23dfa2036afae7d53e9817c.
---
 fs/nfs/rpc_clnt.c | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/fs/nfs/rpc_clnt.c b/fs/nfs/rpc_clnt.c
index 1fbba587c3..9be474b88b 100644
--- a/fs/nfs/rpc_clnt.c
+++ b/fs/nfs/rpc_clnt.c
@@ -240,31 +240,28 @@ static int rpcclnt_socket(FAR struct rpcclnt *rpc, in_port_t rport)
       goto bad;
     }
 
-  if (rpc->rc_sotype == SOCK_DGRAM)
-    {
-      /* Some servers require that the client port be a reserved port
-       * number. We always allocate a reserved port, as this prevents
-       * filehandle disclosure through UDP port capture.
-       */
-
-      do
-        {
-          *lport = htons(--port);
-          error = psock_bind(&rpc->rc_so, (FAR struct sockaddr *)&laddr,
-                             addrlen);
-          if (error < 0)
-            {
-              ferr("ERROR: psock_bind failed: %d\n", error);
-            }
-        }
-      while (error == -EADDRINUSE && port >= 512);
+  /* Some servers require that the client port be a reserved port
+   * number. We always allocate a reserved port, as this prevents
+   * filehandle disclosure through UDP port capture.
+   */
 
-      if (error)
+  do
+    {
+      *lport = htons(--port);
+      error = psock_bind(&rpc->rc_so, (FAR struct sockaddr *)&laddr,
+                         addrlen);
+      if (error < 0)
         {
           ferr("ERROR: psock_bind failed: %d\n", error);
-          goto bad;
         }
     }
+  while (error == -EADDRINUSE && port >= 512);
+
+  if (error)
+    {
+      ferr("ERROR: psock_bind failed: %d\n", error);
+      goto bad;
+    }
 
   /* Protocols that do not require connections could be optionally left
    * unconnected.  That would allow servers to reply from a port other than


[nuttx] 02/03: fs: nfs: Introduce CONFIG_NFS_DONT_BIND_TCP_SOCKET

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/nuttx.git

commit c2af551355ce859a20516d8c7dbeab8be4cb6a9d
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Fri Jun 30 14:57:33 2023 +0900

    fs: nfs: Introduce CONFIG_NFS_DONT_BIND_TCP_SOCKET
    
    Summary:
    - Some network drivers such as GS2200M do not support to bind
      a local port for TCP client socket. In this case, this config
      disables to bind the port.
    - See also https://github.com/apache/nuttx/pull/3707
    
    Impact:
    - None
    
    Testing:
    - Tested with spresense:wifi_smp (Kconfig will be updated later)
    - Tested with sabre-6quad:netnsh_smp (QEMU)
    
    Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
 fs/nfs/Kconfig    |  9 +++++++++
 fs/nfs/rpc_clnt.c | 11 +++++++++++
 2 files changed, 20 insertions(+)

diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
index 5d030caa7c..56f4ab409a 100644
--- a/fs/nfs/Kconfig
+++ b/fs/nfs/Kconfig
@@ -13,6 +13,15 @@ config NFS
 
 #if NFS
 
+config NFS_DONT_BIND_TCP_SOCKET
+	bool
+	default n
+	depends on NFS
+	---help---
+		Some network drivers such as GS2200M do not support to bind
+		a local port for TCP client socket. In this case, this config
+		disables to bind the port.
+
 config NFS_STATISTICS
 	bool "NFS Statistics"
 	default n
diff --git a/fs/nfs/rpc_clnt.c b/fs/nfs/rpc_clnt.c
index 9be474b88b..66a6db773a 100644
--- a/fs/nfs/rpc_clnt.c
+++ b/fs/nfs/rpc_clnt.c
@@ -240,6 +240,13 @@ static int rpcclnt_socket(FAR struct rpcclnt *rpc, in_port_t rport)
       goto bad;
     }
 
+#ifdef CONFIG_NFS_DONT_BIND_TCP_SOCKET
+  if (rpc->rc_sotype == SOCK_STREAM)
+    {
+      goto connect;
+    }
+#endif
+
   /* Some servers require that the client port be a reserved port
    * number. We always allocate a reserved port, as this prevents
    * filehandle disclosure through UDP port capture.
@@ -263,6 +270,10 @@ static int rpcclnt_socket(FAR struct rpcclnt *rpc, in_port_t rport)
       goto bad;
     }
 
+#ifdef CONFIG_NFS_DONT_BIND_TCP_SOCKET
+connect:
+#endif
+
   /* Protocols that do not require connections could be optionally left
    * unconnected.  That would allow servers to reply from a port other than
    * the NFS_PORT.