]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/resolve.c
New configuration option "NoIdent" to disable IDENT lookups
[ngircd-alex.git] / src / ngircd / resolve.c
index 041c15620b1585c56f84dd45c8fa7a17f55b0c1a..999ef9906df241f3c3d195524df8fb86c1082907 100644 (file)
@@ -175,13 +175,12 @@ Do_IdentQuery(int identsock, array *resolved_addr)
 #ifdef IDENTAUTH
        char *res;
 
-       assert(identsock >= 0);
+       if (identsock < 0)
+               return;
 
 #ifdef DEBUG
        Log_Resolver(LOG_DEBUG, "Doing IDENT lookup on socket %d ...", identsock);
 #endif
-       if (identsock < 0)
-               return;
        res = ident_id( identsock, 10 );
 #ifdef DEBUG
        Log_Resolver(LOG_DEBUG, "Ok, IDENT lookup on socket %d done: \"%s\"",
@@ -271,19 +270,21 @@ static bool
 ForwardLookup(const char *hostname, array *IpAddr)
 {
        ng_ipaddr_t addr;
+
 #ifdef HAVE_GETADDRINFO
        int res;
        struct addrinfo *a, *ai_results;
-       static struct addrinfo hints = {
+       static struct addrinfo hints;
+
 #ifndef WANT_IPV6
-               .ai_family = AF_INET,
+       hints.ai_family = AF_INET;
 #endif
 #ifdef AI_ADDRCONFIG   /* glibc has this, but not e.g. netbsd 4.0 */
-               .ai_flags = AI_ADDRCONFIG,
+       hints.ai_flags = AI_ADDRCONFIG;
 #endif
-               .ai_socktype = SOCK_STREAM,
-               .ai_protocol = IPPROTO_TCP
-       };
+       hints.ai_socktype = SOCK_STREAM;
+       hints.ai_protocol = IPPROTO_TCP;
+
 #ifdef WANT_IPV6
        assert(Conf_ConnectIPv6 || Conf_ConnectIPv4);