This patch adds a forward lookup of any hostnames listed in the "hosts allow" or "hosts deny" daemon config options. Based on a patch by Paul Williamson. To use this patch, run these commands for a successful build: patch -p1 h_addr_list[i] != NULL; i++) { + tok = inet_ntoa(*(struct in_addr*)(hp->h_addr_list[i])); + if (match_address(addr, tok)) + return 1; + } + + return 0; +} + static int access_match(const char *list, const char *addr, const char *host) { char *tok; @@ -221,7 +253,7 @@ static int access_match(const char *list, const char *addr, const char *host) strlower(list2); for (tok = strtok(list2, " ,\t"); tok; tok = strtok(NULL, " ,\t")) { - if (match_hostname(host, tok) || match_address(addr, tok)) { + if (match_hostname(host, tok) || match_address(addr, tok) || match_hostlookup(addr, tok)) { free(list2); return 1; }