as a boolean instead of an int.
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.64 2005/01/04 16:36:27 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.65 2005/01/11 15:51:02 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
66. Added hosts_max_try_hardlimit to the smtp transport, default 50.
+67. The string_is_ip_address() function returns 0, 4, or 6, for "no an IP
+ address", "IPv4 address", and "IPv6 address", respectively. Some calls of
+ the function were treating the return as a boolean value, which happened to
+ work because 0=false and not-0=true, but is not correct code.
+
Exim version 4.43
-----------------
-/* $Cambridge: exim/src/src/exim.c,v 1.12 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim.c,v 1.13 2005/01/11 15:51:02 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
check_port(uschar *address)
{
int port = host_extract_port(address);
-if (!string_is_ip_address(address, NULL))
+if (string_is_ip_address(address, NULL) == 0)
{
fprintf(stderr, "exim abandoned: \"%s\" is not an IP address\n", address);
exit(EXIT_FAILURE);
flags flag bits for verify_address()
exit_value to be set for failures
-Returns: nothint
+Returns: nothing
*/
static void
-/* $Cambridge: exim/src/src/host.c,v 1.5 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/host.c,v 1.6 2005/01/11 15:51:02 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
while ((s = string_nextinlist(&list, &sep, buffer, sizeof(buffer))) != NULL)
{
int port = host_extract_port(s); /* Leaves just the IP address */
- if (!string_is_ip_address(s, NULL))
+ if (string_is_ip_address(s, NULL) == 0)
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Malformed IP address \"%s\" in %s",
s, name);
-/* $Cambridge: exim/src/src/lookups/dnsdb.c,v 1.8 2005/01/04 10:00:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/dnsdb.c,v 1.9 2005/01/11 15:51:03 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
records for different purposes where the key string is a host name). This
code for doing the reversal is now in a separate function. */
- if (type == T_PTR && string_is_ip_address(domain, NULL))
+ if (type == T_PTR && string_is_ip_address(domain, NULL) > 0)
{
dns_build_reverse(domain, rbuffer);
domain = rbuffer;
-/* $Cambridge: exim/src/src/lookups/lsearch.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/lsearch.c,v 1.3 2005/01/11 15:51:03 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
int maskoffset;
int save = buffer[linekeylength];
buffer[linekeylength] = 0;
- if (!string_is_ip_address(buffer, &maskoffset) ||
+ if (string_is_ip_address(buffer, &maskoffset) == 0 ||
!host_is_in_net(keystring, buffer, maskoffset)) continue;
buffer[linekeylength] = save;
}
{
do_cache = do_cache; /* Keep picky compilers happy */
if ((length == 1 && keystring[0] == '*') ||
- string_is_ip_address(keystring, NULL))
+ string_is_ip_address(keystring, NULL) > 0)
{
return internal_lsearch_find(handle, filename, keystring, length, result,
errmsg, LSEARCH_IP);
-/* $Cambridge: exim/src/src/route.c,v 1.3 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/route.c,v 1.4 2005/01/11 15:51:02 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
DEBUG(D_route) debug_printf("%s [%s] translated to %s\n",
h->name, h->address, newaddress);
- if (string_is_ip_address(newaddress, NULL))
+ if (string_is_ip_address(newaddress, NULL) > 0)
{
h->address = newaddress;
continue;
-/* $Cambridge: exim/src/src/routers/dnslookup.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/dnslookup.c,v 1.3 2005/01/11 15:51:03 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
else
{
addr->message = US"all relevant MX records point to non-existent hosts";
- if (!allow_mx_to_ip && string_is_ip_address(h.name, NULL))
+ if (!allow_mx_to_ip && string_is_ip_address(h.name, NULL) > 0)
{
addr->user_message =
string_sprintf("It appears that the DNS operator for %s\n"
-/* $Cambridge: exim/src/src/routers/ipliteral.c,v 1.3 2005/01/04 10:00:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/ipliteral.c,v 1.4 2005/01/11 15:51:03 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (domain[0] != '[' || domain[len-1] != ']') return DECLINE;
domain[len-1] = 0; /* temporarily */
-if (!string_is_ip_address(domain+1, NULL))
+if (string_is_ip_address(domain+1, NULL) == 0)
{
domain[len-1] = ']';
return DECLINE;
-/* $Cambridge: exim/src/src/routers/rf_lookup_hostlist.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/rf_lookup_hostlist.c,v 1.3 2005/01/11 15:51:03 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* If explicitly configured to look up by name, or if the "host name" is
actually an IP address, do a byname lookup. */
- else if (lookup_type == lk_byname || string_is_ip_address(h->name, NULL))
+ else if (lookup_type == lk_byname || string_is_ip_address(h->name, NULL) > 0)
{
DEBUG(D_route|D_host_lookup) debug_printf("calling host_find_byname\n");
rc = host_find_byname(h, ignore_target_hosts, &canonical_name, TRUE);
-/* $Cambridge: exim/src/src/transports/smtp.c,v 1.4 2005/01/04 16:36:28 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/smtp.c,v 1.5 2005/01/11 15:51:03 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Find by name if so configured, or if it's an IP address. We don't
just copy the IP address, because we need the test-for-local to happen. */
- if (ob->gethostbyname || string_is_ip_address(host->name, NULL))
+ if (ob->gethostbyname || string_is_ip_address(host->name, NULL) > 0)
rc = host_find_byname(host, NULL, &canonical_name, TRUE);
else
{
-/* $Cambridge: exim/src/src/verify.c,v 1.9 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/verify.c,v 1.10 2005/01/11 15:51:02 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
for (host = host_list; host != NULL; host = nexthost)
{
nexthost = host->next;
- if (tf.gethostbyname || string_is_ip_address(host->name, NULL))
+ if (tf.gethostbyname ||
+ string_is_ip_address(host->name, NULL) > 0)
(void)host_find_byname(host, NULL, &canonical_name, TRUE);
else
{
/* If the pattern is an IP address, optionally followed by a bitmask count, do
a (possibly masked) comparision with the current IP address. */
-if (string_is_ip_address(ss, &maskoffset))
+if (string_is_ip_address(ss, &maskoffset) > 0)
return (host_is_in_net(cb->host_address, ss, maskoffset)? OK : FAIL);
/* If the item is of the form net[n]-lookup;<file|query> then it is a lookup on
while ((keydomain = string_nextinlist(&key, &keysep, keybuffer,
sizeof(keybuffer))) != NULL)
{
- if (string_is_ip_address(keydomain, NULL))
+ if (string_is_ip_address(keydomain, NULL) > 0)
{
uschar keyrevadd[128];
invert_address(keyrevadd, keydomain);