X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/7e66e54dcf419ff995a49250902ae71a73228373..184e88237dea64ce48076cdd0184612d057cbafd:/src/src/routers/iplookup.c?ds=sidebyside diff --git a/src/src/routers/iplookup.c b/src/src/routers/iplookup.c index 9e9239f5f..97bff0a8c 100644 --- a/src/src/routers/iplookup.c +++ b/src/src/routers/iplookup.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/routers/iplookup.c,v 1.5 2005/12/06 10:25:59 ph10 Exp $ */ +/* $Cambridge: exim/src/src/routers/iplookup.c,v 1.10 2007/01/08 10:50:20 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2005 */ +/* Copyright (c) University of Cambridge 1995 - 2007 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -206,7 +206,7 @@ while ((hostname = string_nextinlist(&listptr, &sep, host_buffer, host->address = host->name; else { - int rc = host_find_byname(host, NULL, NULL, TRUE); + int rc = host_find_byname(host, NULL, HOST_FIND_QUALIFY_SINGLE, NULL, TRUE); if (rc == HOST_FIND_FAILED || rc == HOST_FIND_AGAIN) continue; } @@ -240,6 +240,7 @@ while ((hostname = string_nextinlist(&listptr, &sep, host_buffer, if (ip_connect(query_socket, host_af, h->address,ob->port, ob->timeout) < 0) { + close(query_socket); DEBUG(D_route) debug_printf("connection to %s failed: %s\n", h->address, strerror(errno)); @@ -377,6 +378,9 @@ new_addr->parent = addr; copyflag(new_addr, addr, af_propagate); new_addr->p = addr->p; +if (addr->child_count == SHRT_MAX) + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s router generated more than %d " + "child addresses for <%s>", rblock->name, SHRT_MAX, addr->address); addr->child_count++; new_addr->next = *addr_new; *addr_new = new_addr;