]> granicus.if.org Git - pgbouncer/commitdiff
connect_server: store port in host order
authorMarko Kreen <markokr@gmail.com>
Wed, 29 Sep 2010 16:37:36 +0000 (09:37 -0700)
committerMarko Kreen <markokr@gmail.com>
Wed, 29 Sep 2010 16:37:36 +0000 (09:37 -0700)
src/objects.c

index faddcec1f6ee4b7c130806f349db766408e9953d..c0caa47c072e8c4a0e7cf018eb620391199c8562 100644 (file)
@@ -822,7 +822,7 @@ static void connect_server(struct PgSocket *server, struct sockaddr *sa, int sal
                server->remote_addr.is_unix = true;
        } else if (sa->sa_family == AF_INET) {
                struct sockaddr_in *in = (struct sockaddr_in *)sa;
-               server->remote_addr.port = in->sin_port;
+               server->remote_addr.port = ntohs(in->sin_port);
                server->remote_addr.ip_addr = in->sin_addr;
        }