nwrap: remove code duplication in nwrap_getaddrinfo
authorMichael Adam <obnox@samba.org>
Fri, 6 Nov 2015 10:28:35 +0000 (11:28 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 11 Jan 2016 11:25:28 +0000 (12:25 +0100)
The three formerly distinct cases now are all the same.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/nss_wrapper/nss_wrapper.c

index 986b974429acf58045a205f5ec7d7142dcbc5a15..63d5325efbfcbd7102a9a88efee9e1a9f1686d4f 100644 (file)
@@ -5129,23 +5129,9 @@ valid_port:
        }
 
        rc = -1;
-       if (addr.family == AF_INET) {
-               ai = nwrap_files_getaddrinfo(node, port, hints, &ai_tail);
-               if (ai != NULL) {
-                       rc = 1;
-               }
-#ifdef HAVE_IPV6
-       } else if (addr.family == AF_INET6) {
-               ai = nwrap_files_getaddrinfo(node, port, hints, &ai_tail);
-               if (ai != NULL) {
-                       rc = 1;
-               }
-#endif
-       } else {
-               ai = nwrap_files_getaddrinfo(node, port, hints, &ai_tail);
-               if (ai != NULL) {
-                       rc = 1;
-               }
+       ai = nwrap_files_getaddrinfo(node, port, hints, &ai_tail);
+       if (ai != NULL) {
+               rc = 1;
        }
 
        if (rc < 0) {