Skip to content

Commit

Permalink
apps/rexecd: fix bind failed return 13
Browse files Browse the repository at this point in the history
Signed-off-by: zhushiqi <[email protected]>
  • Loading branch information
zhushiqshi committed Nov 11, 2024
1 parent b3e1077 commit 92584dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion netutils/rexec/rexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int do_rexec(FAR struct rexec_arg_s *arg)
int sock;
int ret;

sock = rexec_af(&arg->host, arg->port, arg->user,
sock = rexec_af(&arg->host, htons(arg->port), arg->user,
arg->password, arg->command,
NULL, arg->af);
if (sock < 0)
Expand Down
4 changes: 2 additions & 2 deletions netutils/rexecd/rexecd.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ int main(int argc, FAR char **argv)
default:
case AF_INET:
((FAR struct sockaddr_in *)&addr)->sin_family = AF_INET;
((FAR struct sockaddr_in *)&addr)->sin_port = REXECD_PORT;
((FAR struct sockaddr_in *)&addr)->sin_port = htons(REXECD_PORT);
ret = sizeof(struct sockaddr_in);
break;
case AF_INET6:
((FAR struct sockaddr_in6 *)&addr)->sin6_family = AF_INET6;
((FAR struct sockaddr_in6 *)&addr)->sin6_port = REXECD_PORT;
((FAR struct sockaddr_in6 *)&addr)->sin6_port = htons(REXECD_PORT);
ret = sizeof(struct sockaddr_in6);
break;
case AF_RPMSG:
Expand Down

0 comments on commit 92584dd

Please sign in to comment.