From 6633e04e6ec23399fb2e2ecec3d1b34a7aa758d0 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 4 Feb 2013 02:43:19 +0100 Subject: [PATCH] Treat 0.0.0.0 as a local address qmail-1.03-0.0.0.0-0.2 --- ipme.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ipme.c b/ipme.c index 1f190b7..9eabad0 100644 --- a/ipme.c +++ b/ipme.c @@ -23,6 +23,9 @@ struct ip_address *ip; { int i; if (ipme_init() != 1) return -1; + /* This is a hack. --sg */ + if (ip->d[0] == 127) + return 1; for (i = 0;i < ipme.len;++i) if (byte_equal(&ipme.ix[i].ip,4,ip)) return 1; @@ -46,6 +49,11 @@ int ipme_init() ipme.len = 0; ix.pref = 0; + /* 0.0.0.0 is a special address which always refers to + * "this host, this network", according to RFC 1122, Sec. 3.2.1.3a. + */ + byte_copy(&ix.ip,4,"\0\0\0\0"); + if (!ipalloc_append(&ipme,&ix)) { return 0; } if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1; len = 256; -- cgit v1.2.3