X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=connect.c;h=b157cf1cc718bbd7b8f4598b2dcb3a7ba92bb8e3;hb=d1c5f2a42d7b5c0e3d3862212dea1f09809c4963;hp=0e6f27ea0a07ef0ba9b339c447271b337a9e5a5b;hpb=4c505f71e60b9d152a3a9d7a59b8b5146991a288;p=git.git diff --git a/connect.c b/connect.c index 0e6f27ea..b157cf1c 100644 --- a/connect.c +++ b/connect.c @@ -290,7 +290,7 @@ static enum protocol get_protocol(const char *name) #define STR_(s) # s #define STR(s) STR_(s) -#ifndef __CYGWIN__ +#ifndef NO_IPV6 static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path) { @@ -348,7 +348,7 @@ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path) return 0; } -#else /* __CYGWIN__ */ +#else /* NO_IPV6 */ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path) { @@ -397,7 +397,7 @@ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path) memset(&sa, 0, sizeof sa); sa.sin_family = he->h_addrtype; - sa.sin_port = nport; + sa.sin_port = htons(nport); memcpy(&sa.sin_addr, ap, he->h_length); if (connect(sockfd, (struct sockaddr *)&sa, sizeof sa) < 0) { @@ -417,7 +417,7 @@ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path) return 0; } -#endif /* __CYGWIN__ */ +#endif /* NO_IPV6 */ /* * Yeah, yeah, fixme. Need to pass in the heads etc.