From patchwork Tue Nov 28 11:14:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3487 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:693c:368c:b0:fb:b703:d903 with SMTP id sp12csp2484932dyc; Tue, 28 Nov 2023 03:15:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYhzkBsgLy+cI+30sW8zGweHOWtnUkP3WmrbkIytm7lSL5gcp5UfyAoGBBbarhKpETeFuq X-Received: by 2002:a9d:6d1a:0:b0:6d8:48b1:f60c with SMTP id o26-20020a9d6d1a000000b006d848b1f60cmr290182otp.1.1701170157039; Tue, 28 Nov 2023 03:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701170157; cv=none; d=google.com; s=arc-20160816; b=hCwZNsgJ651ZK1ZTksjyy6uEa7V8DJZC0CUMHh4NunobkVZ2Q/Sps4T0Q7D4F3Lq98 3hwB96lnRybeMYFPLjdYlB0jxxKssoD7UMUqhqqT++bCyZtMVZAS77eWmKfWQyvoNYhw bhanVcjFo1GxNqd8sH53XgadITYjqo0fMfQXuh0FWusc4GHpYoL8Adp3ucR6hjtZMNhA tNx1k1Ph/fY+DredeuveHgnPU0wzDLGR8BkB8xIdLKDHHSk4U6tCRAvVsJZY8MWJyufZ lX1FUiEz9Q2gTLq7Emc/tUbOlpDsHPKnHG49NGx5ga4xYSFmYM9vqVzFFgaET0tk9cZZ FUag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=9QgmyHZmcd3In2iSsRgXn0htfBZZgcTi/mfGDTEIt/U=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=dOouyDsXMq8P32GNlyv9GgGNLt/e0/qp4B6KYvcJjATJ1q1bB5HxFaFaI/g1puW+om I3ENeEsIm5IRNwExCswoQ4f06baN0c3Nz3hBWvpfcratnULnuBWRsdoFgdLF0P4FZSnS D4tW6iIMCWu65QrCwZSdMP/hAQp0Eg082UcG1IGFXlV16nAi6QDC+JxTvqzzTQU5Ww+f jPwdhJR4HykRaNE7sZ9gdEzl3gJ/+zvNTR2FYOLIuymZPNPOeqWiqKqTDTmSIQOTIta3 UsqVjYJlSIPDllpfO2LzKAu/XYHEtiWCkLoWIL7Alur862bOULNggMh2QIn/1dxhXrnZ HoWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=guWKkMPN; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Fhx5LFGh; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=0XT2gRk9; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id c12-20020a631c0c000000b005824bad8f81si11725066pgc.853.2023.11.28.03.15.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Nov 2023 03:15:56 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=guWKkMPN; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Fhx5LFGh; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=0XT2gRk9; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1r7w3Y-00045i-Ug; Tue, 28 Nov 2023 11:15:09 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r7w3W-00045V-HD for openvpn-devel@lists.sourceforge.net; Tue, 28 Nov 2023 11:15:07 +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:Cc:To:From:Sender:Reply-To: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=IjMSLTT8dg8bAwyIn/p7dq3Non2LabmLC8A604opU24=; b=guWKkMPNmKVoj+ZV9gPHG+y0jE GFadtcTuw6Nozm5ZOY9sV7oO1KD3H3lZmce/LWLIT4/kPQ4NIlGpUFJ9n4Se+ivuerYKMb0ap+Zx5 TQrFMFYr1/Q9HhYWmcQdO6vMr+95pxac1Za2AkZAnSSR3E5htB/9S/UIz4gbWB4SWEK8=; 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:Cc:To:From:Sender:Reply-To: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=IjMSLTT8dg8bAwyIn/p7dq3Non2LabmLC8A604opU24=; b=Fhx5LFGhZsqJWL1rYgveuxXsPU AgonAs12d1VdvKzhQaddPXAhNRRtag3GmxGp5+mtE9mn21xE5Uw7sph8oQ2wDwtM+smJSVLkvn63C hEdIVt6+yNaA7z3WuGpVvQ9NyEyq7u9VmsulowZUCyWRLmNpLq+P7ju+1LL31sXh6vHw=; Received: from mout-p-102.mailbox.org ([80.241.56.152]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1r7w3N-0007Ao-76 for openvpn-devel@lists.sourceforge.net; Tue, 28 Nov 2023 11:15:02 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4SffxN5cs2z9t63; Tue, 28 Nov 2023 12:14:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1701170088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IjMSLTT8dg8bAwyIn/p7dq3Non2LabmLC8A604opU24=; b=0XT2gRk9Fre1l0p846PbqrvCLRwn6xS1p4Z3HH3x5b8vB151SaNyd71c4TWese/dEGozth bcg7tOJ/zvsP8yeRnldBGqNnrcotNNG0J9y5aQ7QIaUZBQjf8/ZkYtXx4aCCv65xQnuVQS isgED7wPkI5zUfPGhudbTtaTV6xIbP91TiMnBgpjcCkaFsEarxhnDh6dMxKqnnUT8vwMQL f1SAk/DO5YulnfB0hZGmYsuhk9VoviUQySZL9un8GHH9wTHKVJeytjg0rs3ckO+mhRH/IK BaXtImumA5dXu9LHTVB0BIUYeRNZ7k4+HIWpI3g7R2XhoFvZtbWNXKxICXRckw== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Tue, 28 Nov 2023 12:14:47 +0100 Message-Id: <20231128111447.64445-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4SffxN5cs2z9t63 X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe Change-Id: I66e3dd7b7166459526824fe5ae81a449b375b8db Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.152 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1r7w3N-0007Ao-76 Subject: [Openvpn-devel] [PATCH v1] Minimal Solaris/OpenIndiana support to Cmake and clean up -Werror 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 X-GMAIL-THRID: =?utf-8?q?1783806198105016318?= X-GMAIL-MSGID: =?utf-8?q?1783806198105016318?= From: Arne Schwabe Change-Id: I66e3dd7b7166459526824fe5ae81a449b375b8db Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/458 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/CMakeLists.txt b/CMakeLists.txt index d21c9bd..c3a55ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,11 +121,17 @@ set(TARGET_FREEBSD YES) set(ENABLE_DCO YES) link_libraries(-lnv) +elseif (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") + set(TARGET_SOLARIS YES) + set(HAVE_SYS_SOCKIO_H 1) + link_libraries(-lnsl -lsocket -lresolv) elseif (WIN32) set(ENABLE_DCO YES) elseif (APPLE) set(TARGET_DARWIN YES) set(HAVE_NET_IF_UTUN_H YES) +else() + message(FATAL_ERROR "Unknown system name: \"${CMAKE_SYSTEM_NAME}\"") endif () if (UNIX) diff --git a/config.h.cmake.in b/config.h.cmake.in index 19b79bc..5b93fc5 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -336,7 +336,7 @@ #cmakedefine HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKIO_H +#cmakedefine HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -443,6 +443,9 @@ /* Are we running on Linux? */ #cmakedefine TARGET_LINUX +/* Are we running on Solaris/OpenIndiana? */ +#cmakedefine TARGET_SOLARIS + /* Are we running WIN32? */ #cmakedefine TARGET_WIN32 diff --git a/src/openvpn/route.c b/src/openvpn/route.c index ff64938..6cc112c 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -2342,12 +2342,11 @@ return; } -#ifndef _WIN32 +#if !defined(_WIN32) #if !defined(TARGET_LINUX) const char *gateway; -#else - int metric; #endif +#if !defined(TARGET_SOLARIS) bool gateway_needed = false; const char *device = tt->actual_name; if (r6->iface != NULL) /* vpn server special route */ @@ -2365,6 +2364,7 @@ gateway_needed = true; } #endif +#endif struct gc_arena gc = gc_new(); struct argv argv = argv_new(); @@ -2395,7 +2395,7 @@ msg( M_INFO, "delete_route_ipv6(%s/%d)", network, r6->netbits ); #if defined(TARGET_LINUX) - metric = -1; + int metric = -1; if ((r6->flags & RT_METRIC_DEFINED) && (r6->metric > 0)) { metric = r6->metric; diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 82ab6c0..f1b8699 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1900,7 +1900,7 @@ #endif -#if !(defined(_WIN32) || defined(TARGET_LINUX)) +#if !(defined(_WIN32) || defined(TARGET_LINUX) || defined(TARGET_SOLARIS)) static void open_tun_generic(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt) @@ -2061,7 +2061,7 @@ } #endif /* TARGET_LINUX || TARGET_FREEBSD*/ -#if !defined(_WIN32) +#if !(defined(_WIN32) || defined(TARGET_SOLARIS)) static void close_tun_generic(struct tuntap *tt) { @@ -2398,13 +2398,12 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt, openvpn_net_ctx_t *ctx) { - int if_fd, ip_muxid, arp_muxid, arp_fd, ppa = -1; + int if_fd = -1, ip_muxid = -1, arp_muxid = -1, arp_fd = -1, ppa = -1; struct lifreq ifr; const char *ptr; - const char *ip_node, *arp_node; + const char *ip_node = NULL, *arp_node = NULL; const char *dev_tuntap_type; int link_type; - bool is_tun; struct strioctl strioc_if, strioc_ppa; /* improved generic TUN/TAP driver from @@ -2428,7 +2427,6 @@ } dev_tuntap_type = "tun"; link_type = I_PLINK; - is_tun = true; } else if (tt->type == DEV_TYPE_TAP) { @@ -2440,7 +2438,6 @@ arp_node = dev_node; dev_tuntap_type = "tap"; link_type = I_PLINK; /* was: I_LINK */ - is_tun = false; } else {