From patchwork Tue Feb 22 20:58:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2319 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.30.191.6]) by backend41.mail.ord1d.rsapps.net with LMTP id MI8fCFvpFWI7IwAAqwncew (envelope-from ) for ; Wed, 23 Feb 2022 02:59:23 -0500 Received: from proxy6.mail.ord1d.rsapps.net ([172.30.191.6]) by director8.mail.ord1d.rsapps.net with LMTP id yCfOGVvpFWI4VwAAfY0hYg (envelope-from ) for ; Wed, 23 Feb 2022 02:59:23 -0500 Received: from smtp8.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.ord1d.rsapps.net with LMTPS id yGCGGVvpFWILUwAAQyIf0w (envelope-from ) for ; Wed, 23 Feb 2022 02:59:23 -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: smtp8.gate.ord1d.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: 82fa70ca-947e-11ec-9ce4-5254001e5a60-1-1 Received: from [216.105.38.7] ([216.105.38.7:34982] helo=lists.sourceforge.net) by smtp8.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 93/3E-02350-B59E5126; Wed, 23 Feb 2022 02:59:23 -0500 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.94.2) (envelope-from ) id 1nMmXl-0006Mt-BU; Wed, 23 Feb 2022 07:58:36 +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.94.2) (envelope-from ) id 1nMmXk-0006Ml-1C for openvpn-devel@lists.sourceforge.net; Wed, 23 Feb 2022 07:58:34 +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=EAVxAWzbowzJt0urHfVYFQ37QHmQfwrBwTpDVPldFT8=; b=KVb1MLnTILxcCLRCGvWXs7KflE EEHKkw1JuVZL9mZRJk8G3ot8yG3y+wsvr3S7wdbk7ULJMKvGhW5iDROiQ6Xudh0l2e4IA+qxf+Z/F 0UgTKgY7NM7aI0p7OTOrzjJ07M1QDXw2KMcb3qVDfIRZ/18+sR9qjwyAx2CaKx9yn04c=; 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=EAVxAWzbowzJt0urHfVYFQ37QHmQfwrBwTpDVPldFT8=; b=k CWsL8KlmbOEbqS9lu4ZjSyfrGlpXR/Z4EV/b3X2vPWG5ekiEqh0k2lrOOss4zFwQnyp6eCe5OIrQA gPC7fB3/Sjdz0Y0KI2oyyfGHj+tqDldFS6F9zqRJMJDkn+v1dK+tF28Rak/em63lK9qxv5HljxN8/ Xm0WeoohnBqsRXmQ=; 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 1nMmXg-00CCg4-L4 for openvpn-devel@lists.sourceforge.net; Wed, 23 Feb 2022 07:58:34 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Wed, 23 Feb 2022 08:58:47 +0100 Message-Id: <20220223075847.11704-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: 1nMmXg-00CCg4-L4 Subject: [Openvpn-devel] [PATCH] 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 --- src/openvpn/lladdr.c | 2 +- src/openvpn/networking_sitnl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpn/lladdr.c b/src/openvpn/lladdr.c index 3ddbebb3..4abe8c54 100644 --- a/src/openvpn/lladdr.c +++ b/src/openvpn/lladdr.c @@ -26,7 +26,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..c16323ac 100644 --- a/src/openvpn/networking_sitnl.c +++ b/src/openvpn/networking_sitnl.c @@ -748,7 +748,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);