diff options
| author | manuel <manuel@mausz.at> | 2013-02-04 02:43:19 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-04 02:43:19 +0100 |
| commit | 6633e04e6ec23399fb2e2ecec3d1b34a7aa758d0 (patch) | |
| tree | 350263ac9a07ed31164a1a7081a4512391595a5a | |
| parent | d2b166c433e97c710ec6906493a3bd400d731491 (diff) | |
| download | qmail-6633e04e6ec23399fb2e2ecec3d1b34a7aa758d0.tar.gz qmail-6633e04e6ec23399fb2e2ecec3d1b34a7aa758d0.tar.bz2 qmail-6633e04e6ec23399fb2e2ecec3d1b34a7aa758d0.zip | |
[PATCH] Treat 0.0.0.0 as a local address
qmail-1.03-0.0.0.0-0.2
| -rw-r--r-- | ipme.c | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -23,6 +23,9 @@ struct ip_address *ip; | |||
| 23 | { | 23 | { |
| 24 | int i; | 24 | int i; |
| 25 | if (ipme_init() != 1) return -1; | 25 | if (ipme_init() != 1) return -1; |
| 26 | /* This is a hack. --sg */ | ||
| 27 | if (ip->d[0] == 127) | ||
| 28 | return 1; | ||
| 26 | for (i = 0;i < ipme.len;++i) | 29 | for (i = 0;i < ipme.len;++i) |
| 27 | if (byte_equal(&ipme.ix[i].ip,4,ip)) | 30 | if (byte_equal(&ipme.ix[i].ip,4,ip)) |
| 28 | return 1; | 31 | return 1; |
| @@ -46,6 +49,11 @@ int ipme_init() | |||
| 46 | ipme.len = 0; | 49 | ipme.len = 0; |
| 47 | ix.pref = 0; | 50 | ix.pref = 0; |
| 48 | 51 | ||
| 52 | /* 0.0.0.0 is a special address which always refers to | ||
| 53 | * "this host, this network", according to RFC 1122, Sec. 3.2.1.3a. | ||
| 54 | */ | ||
| 55 | byte_copy(&ix.ip,4,"\0\0\0\0"); | ||
| 56 | if (!ipalloc_append(&ipme,&ix)) { return 0; } | ||
| 49 | if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1; | 57 | if ((s = socket(AF_INET,SOCK_STREAM,0)) == -1) return -1; |
| 50 | 58 | ||
| 51 | len = 256; | 59 | len = 256; |
