Skip to content

Commit eb9b9a2

Browse files
fangpeinaxiaoxiang781216
authored andcommitted
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 <fangpeina@xiaomi.com>
1 parent b2d4ad6 commit eb9b9a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netutils/rexecd/rexecd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ int main(int argc, FAR char **argv)
223223
case AF_RPMSG:
224224
((FAR struct sockaddr_rpmsg *)&addr)->rp_family = AF_RPMSG;
225225
snprintf(((FAR struct sockaddr_rpmsg *)&addr)->rp_name,
226-
RPMSG_SOCKET_NAME_SIZE, "%d", REXECD_PORT);
226+
RPMSG_SOCKET_NAME_SIZE, "%d", htons(REXECD_PORT));
227227
ret = sizeof(struct sockaddr_rpmsg);
228228
}
229229

0 commit comments

Comments
 (0)