From patchwork Tue Feb 22 21:06:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2320 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.30.191.6]) by backend41.mail.ord1d.rsapps.net with LMTP id EL97CibrFWKzMgAAqwncew (envelope-from ) for ; Wed, 23 Feb 2022 03:07:02 -0500 Received: from proxy8.mail.ord1d.rsapps.net ([172.30.191.6]) by director13.mail.ord1d.rsapps.net with LMTP id yN84HybrFWJbWwAA91zNiA (envelope-from ) for ; Wed, 23 Feb 2022 03:07:02 -0500 Received: from smtp21.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1d.rsapps.net with LMTPS id MDPOHibrFWIaIwAAGdz6CA (envelope-from ) for ; Wed, 23 Feb 2022 03:07:02 -0500 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: smtp21.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=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 948ff57a-947f-11ec-ac8d-a0369f0d8808-1-1 Received: from [216.105.38.7] ([216.105.38.7:46076] helo=lists.sourceforge.net) by smtp21.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id E9/3D-27606-62BE5126; Wed, 23 Feb 2022 03:07:02 -0500 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.94.2) (envelope-from ) id 1nMmex-00052V-Lw; Wed, 23 Feb 2022 08:06:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nMmev-00052H-Ok for openvpn-devel@lists.sourceforge.net; Wed, 23 Feb 2022 08:06:00 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=E+qprzkngaH3cGdEIryzIAaZkjYVevnGFD1z3infh1U=; b=KAQIOmMULDUtB+KSJb74ITR88/ Mp7MIIpbYxTLdAcl6DB9lNmitbd/vnmIbrDbA7sgw3GRxEaJNAX3dFvlbqoh8OO11QOjTODAkwdwW Q8xb7In7qDySD30pXj0VINa5i9j/58hxIcV42QwtAGsOngyfVWpIRfHIl3Yf96tc3xPM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=E+qprzkngaH3cGdEIryzIAaZkjYVevnGFD1z3infh1U=; b=M 4rXCfISxzgpOk4b0HxYAKwgcHRiuuY1vcrSfpnnEgbbY6jEG83AOO/QAd0dkg894y1irRoITaz/Mh /Ic3ykAKXDQ5zyoA9Wflq8PKjpTJBF9jvmq/GMSqVYcsVvhRy8fZxP073pdjYna1rWjMncRmEZ/Wi nmLF2ZnO94WrrOw0=; 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 1nMmet-00CDAJ-NV for openvpn-devel@lists.sourceforge.net; Wed, 23 Feb 2022 08:06:00 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Wed, 23 Feb 2022 09:06:28 +0100 Message-Id: <20220223080628.4773-1-a@unstable.cc> MIME-Version: 1.0 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: With the introduction of SITNL two occurrences of ETH_ALEN were introduced in the code. This define exists on Linux in the linux/if_ether.h header, however the latter is included in linux/if_tun.h whi [...] Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1nMmet-00CDAJ-NV Subject: [Openvpn-devel] [PATCH v2] networking: use OPENVPN_ETH_ALEN instead of ETH_ALEN 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 With the introduction of SITNL two occurrences of ETH_ALEN were introduced in the code. This define exists on Linux in the linux/if_ether.h header, however the latter is included in linux/if_tun.h which may or may not exist (depending on how old your system is). If the system lacks if_tun.h then the compilation fails because ETH_ALEN cannot be found. For this reason, swap ETH_ALEN with OPENVPN_ETH_ALEN which is already used in other places of the code. Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- Changes from v1: * include proto.h where OPENVPN_ETH_ALEN is used --- src/openvpn/lladdr.c | 3 ++- src/openvpn/networking_sitnl.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openvpn/lladdr.c b/src/openvpn/lladdr.c index 3ddbebb3..ee677187 100644 --- a/src/openvpn/lladdr.c +++ b/src/openvpn/lladdr.c @@ -13,6 +13,7 @@ #include "misc.h" #include "run_command.h" #include "lladdr.h" +#include "proto.h" int set_lladdr(openvpn_net_ctx_t *ctx, const char *ifname, const char *lladdr, @@ -26,7 +27,7 @@ set_lladdr(openvpn_net_ctx_t *ctx, const char *ifname, const char *lladdr, } #if defined(TARGET_LINUX) - uint8_t addr[ETH_ALEN]; + uint8_t addr[OPENVPN_ETH_ALEN]; sscanf(lladdr, MAC_FMT, MAC_SCAN_ARG(addr)); r = (net_addr_ll_set(ctx, ifname, addr) == 0); diff --git a/src/openvpn/networking_sitnl.c b/src/openvpn/networking_sitnl.c index 959c897f..515a30d6 100644 --- a/src/openvpn/networking_sitnl.c +++ b/src/openvpn/networking_sitnl.c @@ -32,6 +32,7 @@ #include "buffer.h" #include "misc.h" #include "networking.h" +#include "proto.h" #include #include @@ -748,7 +749,7 @@ net_addr_ll_set(openvpn_net_ctx_t *ctx, const openvpn_net_iface_t *iface, req.i.ifi_family = AF_PACKET; req.i.ifi_index = ifindex; - SITNL_ADDATTR(&req.n, sizeof(req), IFLA_ADDRESS, addr, ETH_ALEN); + SITNL_ADDATTR(&req.n, sizeof(req), IFLA_ADDRESS, addr, OPENVPN_ETH_ALEN); msg(M_INFO, "%s: lladdr " MAC_FMT " for %s", __func__, MAC_PRINT_ARG(addr), iface);