summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>2000-08-10 11:11:58 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>2000-08-10 11:11:58 +0000
commitdb52502663f43b9294b4956b312a3b34c563212c (patch)
tree47c50fff42cf3e07d67708192654ef942428aa84
parent8e4a6c11c2c77ec8cf6dead745342d4b058e2042 (diff)
From mhpower: support the resolved_addresses variable, which controls
whether IP addresses are reverse-resolved.
-rw-r--r--zwgc/main.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/zwgc/main.c b/zwgc/main.c
index 83413da..c4d1e42 100644
--- a/zwgc/main.c
+++ b/zwgc/main.c
@@ -325,8 +325,21 @@ void notice_handler(notice)
ZNotice_t *notice;
{
struct hostent *fromhost = NULL;
+ char *resolved_addresses;
+ int bool_result;
+
+ resolved_addresses = ZGetVariable("resolved_addresses");
+ if (!resolved_addresses)
+ bool_result = 0;
+ else if (!strcmp(resolved_addresses, "all"))
+ bool_result = 1;
+ else if (!strcmp(resolved_addresses, "none"))
+ bool_result = 0;
+ else
+ bool_result = ed_regexp_match_p(inet_ntoa(notice->z_sender_addr),
+ resolved_addresses);
- if (notice->z_sender_addr.s_addr) {
+ if (notice->z_sender_addr.s_addr && bool_result) {
#ifdef HAVE_ARES
ares_gethostbyaddr(achannel, &(notice->z_sender_addr),
sizeof(notice->z_sender_addr), AF_INET,