From 481bd23fbae35f81b4e28af98cdcfa642104f132 Mon Sep 17 00:00:00 2001 From: Dirk-Willem van Gulik Date: Mon, 16 Jul 2001 06:20:39 +0000 Subject: [PATCH] All stable/release versions of FreeBSD, pre- and post SO_ACCEPTFILTER will give ENOPROTO. So ENOENT can go. Also it is sometimes hard to find out what the kernel status is; this change in logging will give the user at least a chance to figure out what is happening. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@89555 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/http_main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/http_main.c b/src/main/http_main.c index 07047e10e20..4f9409ddd6f 100644 --- a/src/main/http_main.c +++ b/src/main/http_main.c @@ -3450,11 +3450,14 @@ static int make_sock(pool *p, const struct sockaddr_in *server) struct accept_filter_arg af = { ACCEPT_FILTER_NAME, "" }; - if ((setsockopt(s, SOL_SOCKET, SO_ACCEPTFILTER, &af, sizeof(af)) < 0) - && (errno != ENOENT) && (errno != ENOPROTOOPT)) { - ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, - "make_sock: for %s, setsockopt: (SO_ACCEPTFILTER)", - addr); + if (setsockopt(s, SOL_SOCKET, SO_ACCEPTFILTER, &af, sizeof(af)) < 0) { + if (errno == ENOPROTOOPT) { + ap_log_error(APLOG_MARK, APLOG_INFO | APLOG_NOERRNO, server_conf, + "socket option SO_ACCEPTFILTER unkown on this machine. Continuing."); + } else { + ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_INFO, server_conf, + "make_sock: for %s, setsockopt: (SO_ACCEPTFILTER)", addr); + } } } #endif -- 2.47.2