summaryrefslogtreecommitdiff
path: root/src/posix.c
diff options
context:
space:
mode:
authorIan Douglas Scott <ian@iandouglasscott.com>2017-06-23 10:10:29 -0700
committerIan Douglas Scott <ian@iandouglasscott.com>2017-06-23 10:12:46 -0700
commitef09eae1f6a2bdf74c15d2d6cdf2673f95dec501 (patch)
tree044b4f8f690407acfd3a2ea7ef8c6ab8599693b1 /src/posix.c
parentfa94875295bbd7a4afa0f7724e77dcff8cd3adab (diff)
downloadlibgit2-ef09eae1f6a2bdf74c15d2d6cdf2673f95dec501.tar.gz
Convert port with htons() in p_getaddrinfo()
`sin_port` should be in network byte order.
Diffstat (limited to 'src/posix.c')
-rw-r--r--src/posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/posix.c b/src/posix.c
index 94deb6ab0..fd9188ac7 100644
--- a/src/posix.c
+++ b/src/posix.c
@@ -40,7 +40,7 @@ int p_getaddrinfo(
if (ainfo->ai_servent)
ainfo->ai_port = ainfo->ai_servent->s_port;
else
- ainfo->ai_port = atol(port);
+ ainfo->ai_port = htons(atol(port));
memcpy(&ainfo->ai_addr_in.sin_addr,
ainfo->ai_hostent->h_addr_list[0],