]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9743 init client socket port
authorHoward Chu <hyc@openldap.org>
Tue, 9 Nov 2021 18:06:18 +0000 (18:06 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 11 Nov 2021 17:27:55 +0000 (17:27 +0000)
also silence meaningless warning

libraries/libldap/os-ip.c

index 3e8d86718ec0093f42fc22ec4b658cff746fb8ee..99b65a25bf9fe80e7642a271f3ebf1f07024c921 100644 (file)
@@ -263,7 +263,7 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s)
                == AC_SOCKET_ERROR )
        {
                /* XXX: needs to be replace with ber_stream_read() */
-               (void)read(s, &ch, 1);
+               (void)!read(s, &ch, 1);
                TRACE;
                return -1;
        }
@@ -697,6 +697,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
                                        struct sockaddr_in6 ip6addr;
                                        char bind_addr[INET6_ADDRSTRLEN];
                                        ip6addr.sin6_family = AF_INET6;
+                                       ip6addr.sin6_port = 0;
                                        ip6addr.sin6_addr = ld->ld_options.ldo_local_ip_addrs.ip6_addr;
                                        inet_ntop( AF_INET6,
                                                &(ip6addr.sin6_addr),
@@ -725,6 +726,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
                                        struct sockaddr_in ip4addr;
                                        char bind_addr[INET_ADDRSTRLEN];
                                        ip4addr.sin_family = AF_INET;
+                                       ip4addr.sin_port = 0;
                                        ip4addr.sin_addr = ld->ld_options.ldo_local_ip_addrs.ip4_addr;
                                        inet_ntop( AF_INET,
                                                &(ip4addr.sin_addr),