diff options
| -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; |
