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


The following commit(s) were added to refs/heads/master by this push:
     new eb9b9a2d6 netutils/rexecd: fix rpname mismatch with rexec when using 
AF_RPMSG
eb9b9a2d6 is described below

commit eb9b9a2d608c160bb25f67bce5eca499210b0bb5
Author: fangpeina <[email protected]>
AuthorDate: Thu May 8 22:10:40 2025 +0800

    netutils/rexecd: fix rpname mismatch with rexec when using AF_RPMSG
    
    When using AF_RPMSG (-r option), rexecd was setting the rp_name
    to the raw port number, while rexec was using htons(port). This
    caused a mismatch where rexec couldn't connect to rexecd.
    
    This commit fixes the issue by applying htons() to REXECD_PORT
    when setting rp_name in the AF_RPMSG case, making it consistent
    with the rexec client implementation.
    
    Signed-off-by: fangpeina <[email protected]>
---
 netutils/rexecd/rexecd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/netutils/rexecd/rexecd.c b/netutils/rexecd/rexecd.c
index 2e462083c..6c238d586 100644
--- a/netutils/rexecd/rexecd.c
+++ b/netutils/rexecd/rexecd.c
@@ -223,7 +223,7 @@ int main(int argc, FAR char **argv)
       case AF_RPMSG:
         ((FAR struct sockaddr_rpmsg *)&addr)->rp_family = AF_RPMSG;
         snprintf(((FAR struct sockaddr_rpmsg *)&addr)->rp_name,
-                 RPMSG_SOCKET_NAME_SIZE, "%d", REXECD_PORT);
+                 RPMSG_SOCKET_NAME_SIZE, "%d", htons(REXECD_PORT));
         ret = sizeof(struct sockaddr_rpmsg);
     }
 

Reply via email to