diff --git a/src/gophernicus.c b/src/gophernicus.c index d6aa6e1..0d3c990 100644 --- a/src/gophernicus.c +++ b/src/gophernicus.c @@ -539,6 +539,13 @@ int main(int argc, char *argv[]) sstrlcpy(st.server_root, buf); } + /* Check if TCP wrappers have something to say about this connection */ +#ifdef HAVE_LIBWRAP + if (sstrncmp(st.req_remote_addr, UNKNOWN_ADDR) != MATCH && + hosts_ctl(self, STRING_UNKNOWN, st.req_remote_addr, STRING_UNKNOWN) == WRAP_DENIED) + die(&st, ERR_ACCESS, "Refused connection"); +#endif + #ifdef __OpenBSD__ /* unveil(2) support. * @@ -606,13 +613,6 @@ int main(int argc, char *argv[]) } #endif - /* Check if TCP wrappers have something to say about this connection */ -#ifdef HAVE_LIBWRAP - if (sstrncmp(st.req_remote_addr, UNKNOWN_ADDR) != MATCH && - hosts_ctl(self, STRING_UNKNOWN, st.req_remote_addr, STRING_UNKNOWN) == WRAP_DENIED) - die(&st, ERR_ACCESS, "Refused connection"); -#endif - /* Make sure the computer is turned on */ #ifdef __HAIKU__ if (is_computer_on() != TRUE)