diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-11-09 21:13:46 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-09 21:13:46 -0800 |
commit | 0d9d89f61c58f72d96585a61defb0634873c38ac (patch) | |
tree | fcb314481bb669dcf1f33ba3934786c1dcc51b12 /daemon.c | |
parent | Merge branch 'jk/terse-push' into aw/mirror-push (diff) | |
parent | Update draft release notes for 1.5.4 (diff) | |
download | tgif-0d9d89f61c58f72d96585a61defb0634873c38ac.tar.xz |
Merge master into aw/mirror-push
Diffstat (limited to 'daemon.c')
-rw-r--r-- | daemon.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -406,7 +406,8 @@ static struct daemon_service daemon_service[] = { { "receive-pack", "receivepack", receive_pack, 0, 1 }, }; -static void enable_service(const char *name, int ena) { +static void enable_service(const char *name, int ena) +{ int i; for (i = 0; i < ARRAY_SIZE(daemon_service); i++) { if (!strcmp(daemon_service[i].name, name)) { @@ -417,7 +418,8 @@ static void enable_service(const char *name, int ena) { die("No such service %s", name); } -static void make_service_overridable(const char *name, int ena) { +static void make_service_overridable(const char *name, int ena) +{ int i; for (i = 0; i < ARRAY_SIZE(daemon_service); i++) { if (!strcmp(daemon_service[i].name, name)) { @@ -540,7 +542,7 @@ static int execute(struct sockaddr *addr) if (addr->sa_family == AF_INET) { struct sockaddr_in *sin_addr = (void *) addr; inet_ntop(addr->sa_family, &sin_addr->sin_addr, addrbuf, sizeof(addrbuf)); - port = sin_addr->sin_port; + port = ntohs(sin_addr->sin_port); #ifndef NO_IPV6 } else if (addr && addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6_addr = (void *) addr; @@ -550,7 +552,7 @@ static int execute(struct sockaddr *addr) inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(addrbuf) - 1); strcat(buf, "]"); - port = sin6_addr->sin6_port; + port = ntohs(sin6_addr->sin6_port); #endif } loginfo("Connection from %s:%d", addrbuf, port); |