From patchwork Fri Apr 1 20:08:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2364 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.27.255.52]) by backend41.mail.ord1d.rsapps.net with LMTP id eKxVK6X2R2KVCQAAqwncew (envelope-from ) for ; Sat, 02 Apr 2022 03:09:25 -0400 Received: from proxy10.mail.iad3a.rsapps.net ([172.27.255.52]) by director9.mail.ord1d.rsapps.net with LMTP id 8FEEN6X2R2LkBgAAalYnBA (envelope-from ) for ; Sat, 02 Apr 2022 03:09:25 -0400 Received: from smtp15.gate.iad3a ([172.27.255.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.iad3a.rsapps.net with LMTPS id eGRDMKX2R2IQPwAAnQ/bqA (envelope-from ) for ; Sat, 02 Apr 2022 03:09:25 -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: smtp15.gate.iad3a.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=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: d3ed2430-b253-11ec-a6ed-525400f46865-1-1 Received: from [216.105.38.7] ([216.105.38.7:51842] helo=lists.sourceforge.net) by smtp15.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 05/26-16296-5A6F7426; Sat, 02 Apr 2022 03:09:25 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1naXrt-0004Oi-Dc; Sat, 02 Apr 2022 07:08:16 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1naXrq-0004OW-FY for openvpn-devel@lists.sourceforge.net; Sat, 02 Apr 2022 07:08:13 +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=pjQyBuAbGhypHCHfxtk9DNPAWaEt7YCdrTEgQiMdml4=; b=BLGeRnmtMU9nx1vsrDtNM8EFLa m9uiXdf7ZDPijTEA5dvp5UwwxwvDa/7MLorMZ9MyoWToehgmYPNsEJrrxnJCAvGTsc5ynJJ0eh3L4 F9fGnIZ3DvZi3gDvsyIFVnr5PVDnJTUOEOZfRwukUvBOHpxfe37hpUARITu6Cy1ICTP4=; 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=pjQyBuAbGhypHCHfxtk9DNPAWaEt7YCdrTEgQiMdml4=; b=cp9j7un1nKZ37rVxHUJNgkg0bT RhGqkqNv6fjmJLgknKXLBY8Cfdj4uiXaQl0M98/gcfqhuEzO2qzDJ3flYK0bZ3kLhl85xSMuZ3v/e WI/fR4AjD7Txs7QdRfe0IUtSYR11dovyVpS3QZrXnlf4PKeSv5mgTnRqD+E4W5KjQSuQ=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1naXro-002iyk-6Q for openvpn-devel@lists.sourceforge.net; Sat, 02 Apr 2022 07:08:12 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Sat, 2 Apr 2022 09:08:56 +0200 Message-Id: <20220402070902.30282-2-a@unstable.cc> In-Reply-To: <20220402070902.30282-1-a@unstable.cc> References: <20220402070902.30282-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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 The net_ctx_init/reset/free methods of sitnl are the same dummy methods that are already defined for non-Linux platforms in the networking.h header. Signed-off-by: Arne Schwabe Signed-off-by: Antonio Quartulli --- src/openvpn/networking.h | 7 ++++++- src/openvpn/networking_sitnl.c | 22 2 fi [...] Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1naXro-002iyk-6Q Subject: [Openvpn-devel] [PATCH 1/7] networking: remove duplicate methods from networking_sitnl.c 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Arne Schwabe The net_ctx_init/reset/free methods of sitnl are the same dummy methods that are already defined for non-Linux platforms in the networking.h header. Signed-off-by: Arne Schwabe Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- src/openvpn/networking.h | 7 ++++++- src/openvpn/networking_sitnl.c | 22 ---------------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/openvpn/networking.h b/src/openvpn/networking.h index 4e7610ec..2cbf6163 100644 --- a/src/openvpn/networking.h +++ b/src/openvpn/networking.h @@ -33,7 +33,12 @@ struct context; /* define mock types to ensure code builds on any platform */ typedef void *openvpn_net_ctx_t; typedef void *openvpn_net_iface_t; +#endif /* ifdef ENABLE_SITNL */ +/* Only the iproute2 backend implements these functions, + * the rest can rely on these stubs + */ +#if !defined(ENABLE_IPROUTE) static inline int net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx) { @@ -51,7 +56,7 @@ net_ctx_free(openvpn_net_ctx_t *ctx) { (void)ctx; } -#endif /* ifdef ENABLE_SITNL */ +#endif /* !defined(ENABLE_IPROUTE) */ #if defined(ENABLE_SITNL) || defined(ENABLE_IPROUTE) diff --git a/src/openvpn/networking_sitnl.c b/src/openvpn/networking_sitnl.c index 515a30d6..9b2f58d9 100644 --- a/src/openvpn/networking_sitnl.c +++ b/src/openvpn/networking_sitnl.c @@ -596,28 +596,6 @@ net_route_v6_best_gw(openvpn_net_ctx_t *ctx, const struct in6_addr *dst, } #ifdef ENABLE_SITNL - -int -net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx) -{ - (void)c; - (void)ctx; - - return 0; -} - -void -net_ctx_reset(openvpn_net_ctx_t *ctx) -{ - (void)ctx; -} - -void -net_ctx_free(openvpn_net_ctx_t *ctx) -{ - (void)ctx; -} - int net_route_v4_best_gw(openvpn_net_ctx_t *ctx, const in_addr_t *dst, in_addr_t *best_gw, char *best_iface)