From patchwork Thu Apr 22 05:29:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1766 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id YKXwDp6WgWBGRgAAIUCqbw (envelope-from ) for ; Thu, 22 Apr 2021 11:30:38 -0400 Received: from proxy5.mail.ord1d.rsapps.net ([172.30.191.6]) by director13.mail.ord1d.rsapps.net with LMTP id sOiyDp6WgWDTBgAA91zNiA (envelope-from ) for ; Thu, 22 Apr 2021 11:30:38 -0400 Received: from smtp9.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy5.mail.ord1d.rsapps.net with LMTPS id 2JdyDp6WgWDsEQAA8Zzt7w (envelope-from ) for ; Thu, 22 Apr 2021 11:30:38 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp9.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: afa85718-a37f-11eb-9b2b-0026b95bddb7-1-1 Received: from [216.105.38.7] ([216.105.38.7:51738] helo=lists.sourceforge.net) by smtp9.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 77/8C-17636-D9691806; Thu, 22 Apr 2021 11:30:37 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1lZbH6-0001ka-67; Thu, 22 Apr 2021 15:29:52 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZbH4-0001kO-TF for openvpn-devel@lists.sourceforge.net; Thu, 22 Apr 2021 15:29:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vjj3asgqdAZVluctCtuf0GZBze2PjqvsRdrvMrK7BAk=; b=GscLhR8d1so75J54J/lGzgW2SW ZszAmUtzKndgiqgFOJp2daA/yV2kckrQ5wPCRlzw4zKrN86TXbHesaJ6i1cY7F5TYRuL1EpRvmP1r 7IgeqekI7YX1RL15G3CG09I7ez7xm91EHdJ7OO7Oix3SWSlwNwEPU3qljlcGUfkMz8TU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vjj3asgqdAZVluctCtuf0GZBze2PjqvsRdrvMrK7BAk=; b=Iy7Z0It5kWxi0UtixqyQaUgX5H 8dc+dXZbH26qsd2zM7CwVGHtcD9Ui21Zg1Bd1YKBN1Ulb5teLd0rOMJCayl9fs9esQRjmTbZ5pVAX hfFFP5GcE2LOwUWXotMgmhdtT9QbUD4QEEVez6ZdoS+6hEzxp2MmLCRPSMoZfqrsMmDE=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1lZbH1-00DH7E-Ai for openvpn-devel@lists.sourceforge.net; Thu, 22 Apr 2021 15:29:51 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lZbGt-000B9S-Ob for openvpn-devel@lists.sourceforge.net; Thu, 22 Apr 2021 17:29:39 +0200 Received: (nullmailer pid 2134108 invoked by uid 10006); Thu, 22 Apr 2021 15:29:40 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 22 Apr 2021 17:29:39 +0200 Message-Id: <20210422152939.2134046-6-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210422152939.2134046-1-arne@rfc2549.org> References: <20210422152939.2134046-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1lZbH1-00DH7E-Ai Subject: [Openvpn-devel] [PATCH v2 6/6] Remove a number of platform specific checks in configure.ac X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox - Remove windows XP/old mingw compat code in socket.c - Use _WIN32 instead checking for existence of windows.h, winsock2.h and ws2tcpip.h in autconf - Remove check for unlink. The last remaining use is a check inside a Unix socket. - Even Windows has umask, so remove the check for it - Move epoll.h inclusion to event.c Patch V2: Add epoll.h syshead.h that accidently was put into another patch Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- configure.ac | 11 +++++------ src/compat/compat.h | 5 +---- src/openvpn/event.c | 4 ++++ src/openvpn/socket.c | 16 ---------------- src/openvpn/syshead.h | 16 ++-------------- 5 files changed, 12 insertions(+), 40 deletions(-) diff --git a/configure.ac b/configure.ac index 3b4d3cbc7..94897c863 100644 --- a/configure.ac +++ b/configure.ac @@ -412,7 +412,6 @@ AC_CHECK_HEADERS([ \ unistd.h dlfcn.h \ netinet/in.h netinet/in_systm.h \ netinet/tcp.h arpa/inet.h netdb.h \ - windows.h winsock2.h ws2tcpip.h \ versionhelpers.h \ ]) AC_CHECK_HEADERS([ \ @@ -438,13 +437,13 @@ SOCKET_INCLUDES=" #ifdef HAVE_NETINET_IN_H #include #endif -#ifdef HAVE_WINDOWS_H +#ifdef _WIN32 #include #endif -#ifdef HAVE_WINSOCK2_H +#ifdef _WIN32 #include #endif -#ifdef HAVE_WS2TCPIP_H +#ifdef _WIN32 #include #endif #ifdef HAVE_NETINET_IN_SYSTM_H @@ -623,8 +622,8 @@ AC_CHECK_FUNCS([ \ daemon chroot getpwnam setuid nice system getpid dup dup2 \ syslog openlog mlockall getrlimit getgrnam setgid \ setgroups flock readv writev time gettimeofday \ - setsid chdir getpeername unlink \ - chsize ftruncate execve getpeereid umask basename dirname access \ + setsid chdir getpeername \ + chsize ftruncate execve getpeereid basename dirname access \ epoll_create strsep \ ]) diff --git a/src/compat/compat.h b/src/compat/compat.h index 2bf48a5eb..026974a81 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -24,11 +24,8 @@ #ifndef COMPAT_H #define COMPAT_H -#ifdef HAVE_WINSOCK2_H +#ifdef _WIN32 #include -#endif - -#ifdef HAVE_WS2TCPIP_H #include #endif diff --git a/src/openvpn/event.c b/src/openvpn/event.c index 14a25155c..d766f8be8 100644 --- a/src/openvpn/event.c +++ b/src/openvpn/event.c @@ -35,6 +35,10 @@ #include "event.h" #include "fdmisc.h" +#if EPOLL +#include +#endif + #include "memdbg.h" /* diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 4e13c65e8..01c65b3e0 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -1385,14 +1385,6 @@ socket_listen_accept(socket_descriptor_t sd, return new_sd; } -/* older mingw versions and WinXP do not have this define, - * but Vista and up support the functionality - just define it here - */ -#ifdef _WIN32 -#ifndef IPV6_V6ONLY -#define IPV6_V6ONLY 27 -#endif -#endif void socket_bind(socket_descriptor_t sd, struct addrinfo *local, @@ -3905,10 +3897,7 @@ socket_bind_unix(socket_descriptor_t sd, const char *prefix) { struct gc_arena gc = gc_new(); - -#ifdef HAVE_UMASK const mode_t orig_umask = umask(0); -#endif if (bind(sd, (struct sockaddr *) local, sizeof(struct sockaddr_un))) { @@ -3919,10 +3908,7 @@ socket_bind_unix(socket_descriptor_t sd, sockaddr_unix_name(local, "NULL")); } -#ifdef HAVE_UMASK umask(orig_umask); -#endif - gc_free(&gc); } @@ -3967,12 +3953,10 @@ void socket_delete_unix(const struct sockaddr_un *local) { const char *name = sockaddr_unix_name(local, NULL); -#ifdef HAVE_UNLINK if (name && strlen(name)) { unlink(name); } -#endif } bool diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index bc628eac4..a9680f72f 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -100,10 +100,6 @@ #include #endif -#ifdef HAVE_IO_H -#include -#endif - #ifdef HAVE_SYS_FILE_H #include #endif @@ -155,10 +151,6 @@ #include #endif -#ifdef HAVE_SYS_EPOLL_H -#include -#endif - #ifdef ENABLE_SELINUX #include #endif @@ -342,6 +334,8 @@ typedef int MIB_TCP_STATE; #include #include #include +#include + /* The following two headers are needed of PF_INET6 */ #include #include @@ -541,12 +535,6 @@ socket_defined(const socket_descriptor_t sd) #define EPOLL 0 #endif -/* Disable EPOLL */ -#if 0 -#undef EPOLL -#define EPOLL 0 -#endif - /* * Compression support */