From patchwork Mon Jun 23 14:07:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4289 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:76b0:b0:671:5a2c:6455 with SMTP id n16csp82039mau; Mon, 23 Jun 2025 07:08:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU9D4nA8VErTE91wTCu86uuoacBP1P1zP18KIIzpco6zJeU+nL8zsiPIsvynqksJcd7wla0LgJeRJw=@openvpn.net X-Google-Smtp-Source: AGHT+IFBAETTsE3vt6OYXZDWv0vyK57NdWDiTQsbR4SBNfv8b6nTx9OiP7KuzGMj53sA55G0k/UE X-Received: by 2002:a05:6602:3808:b0:873:7685:6f3e with SMTP id ca18e2360f4ac-8762cdbda16mr1377833139f.0.1750687688023; Mon, 23 Jun 2025 07:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750687688; cv=none; d=google.com; s=arc-20240605; b=PRAmvb/YzJrF/psZjrkoq8wYOjfX6lx1iv1bAY4Pu+YThxBgroMQIK0N3auEGD2J5Q Cb8t1AbhidyBJzXSEFR6tD1A1W6Tf1xTy8700m7RwkwZ3aBopjj7gKJknUmod+nmbdT6 aqvKPKK0L/Z+35mZ9tlCY4sT6ISKjRDARtTwCRvkxVCCEfRUUC5l+QdyIgWant14WHbN P/HOEJAvAXjW25Dm4gdv3u5vfdfe1D6UxTr5vYCbzzZGeYDJf2WL7vGXywdzavBEn4Pm CseCgIAv7yA9W11Kp1YSM0AXJLiZADaq1xLLLuogVi8qpwcq6OO9G6NpXmNs8Ml0bCXr BHuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=bHZ7W6M5D9nAJy3du4oETs7Ko1zfmowh/8pNaTyLl+w=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=fn9wvflHAjoPqbZB9Fs2SsRg9R0pxhjo3zD2JQjpOAh1mQGGvQN4hFdKuDDK9Ku/K8 p7/DOB04VifxbM8vMJ4473wRdSXxkXGuFbWzXKGbH1m1kDnWQ6jrz46Ois2z+8JVFVJB gL0MXf7DI/O8Qw8E03DeYBQXY/ECqI9jzIRw1hp23f2AvXl47lVapIA7mTUIjDjgzDL1 aZ2geaBQ1DhPxtaBURoLYNTliClRLKRxIy/SaCpgma7Stn5gwywMeiTaAe6wW5um3tp4 E2Fwy29woXYXLDQBpcUth6JnnPfeAyNm6/aTfVrHJDTgTTUi9zv6N+6OhDIJDZS3I+op 7rDw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=eOshgqyY; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ONYUM98i; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Ry9XJ5R0; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id ca18e2360f4ac-8762b80c861si917105039f.97.2025.06.23.07.08.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jun 2025 07:08:07 -0700 (PDT) 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=pass header.i=@lists.sourceforge.net header.s=beta header.b=eOshgqyY; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ONYUM98i; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Ry9XJ5R0; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bHZ7W6M5D9nAJy3du4oETs7Ko1zfmowh/8pNaTyLl+w=; b=eOshgqyYjwNna1YVMTm3Lgic51 NQMQW5lYccgMsGmt6Qc8wnRJ/7PJE8m/CRiVZWd0CSkM69zqsrsNsQ7THL/3fZQLWCFE6rvRmigcY aVWHJ+JqfW3zGTSKGOGtTJtMHaDmPa0rYNMniOcFIc5RxjAN+ePtf/DhD0rCorJv9R0E=; 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 1uThq4-00030k-1y; Mon, 23 Jun 2025 14:08:00 +0000 Received: from [172.30.29.66] (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 1uThq2-00030d-LM for openvpn-devel@lists.sourceforge.net; Mon, 23 Jun 2025 14:07:58 +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=TdAer7yHJ0MW/Qs8aUsoGXkHDbHJEtMTJ5EhmGMXiF4=; b=ONYUM98izedfsznhLjZukmHMnk f+l6oJGYJgm//sYVJ3xJnGeKbsAGjPK+qbsGRU73CNdWWj4dPZwONpXQUVV1cElaIouMEkvwHqoRV qTbk8ERmI5nGtQ6ZC7PjNXSbqRb5xKfZsJR5J0YpNr0H0gpHIxLoIqO2NlZafLFS1qrA=; 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=TdAer7yHJ0MW/Qs8aUsoGXkHDbHJEtMTJ5EhmGMXiF4=; b=Ry9XJ5R0/Lmkx9M/OPfB9NqOe4 vxHZVZTLRbyem2flHuMreCY11N+IU/WBfss6ezBvO8LiB1XmmE9UaZ3Vv7Zp4+WZ2AGXgWZ3+gIQL OvwzGwRlipz4sf5Nt1GDzs/Hfw85njYBVmedom98lz3UtuDw5QCXHBNgFDTxoDpdxrMQ=; Received: from [193.149.48.143] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1uThq1-0005IN-GO for openvpn-devel@lists.sourceforge.net; Mon, 23 Jun 2025 14:07:58 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 55NE7oNi013980 for ; Mon, 23 Jun 2025 16:07:50 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 55NE7o8G013979 for openvpn-devel@lists.sourceforge.net; Mon, 23 Jun 2025 16:07:50 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 23 Jun 2025 16:07:43 +0200 Message-ID: <20250623140748.13960-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", 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: Ralf Lici Starting with Linux kernel version 6.16, a couple of ovpn-related enum definitions were introduced in the `include/uapi/linux/if_link.h` header. Redefining them in openvpn when they are already presen [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1uThq1-0005IN-GO Subject: [Openvpn-devel] [PATCH v2] dco linux: avoid redefining ovpn enums 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?1835729092847077405?= X-GMAIL-MSGID: =?utf-8?q?1835729092847077405?= From: Ralf Lici Starting with Linux kernel version 6.16, a couple of ovpn-related enum definitions were introduced in the `include/uapi/linux/if_link.h` header. Redefining them in openvpn when they are already present in the system headers can lead to conflicts or build issues. This commit ensures that enum redefinitions are avoided by conditionally using the existing definitions from the system header when available. Change-Id: I4fa2d578f9c0a5a8aa24ca1d396102ef2ed9a425 Signed-off-by: Ralf Lici --- 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/+/1064 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): diff --git a/src/openvpn/dco_linux.h b/src/openvpn/dco_linux.h index 273a6ad..4e441ec 100644 --- a/src/openvpn/dco_linux.h +++ b/src/openvpn/dco_linux.h @@ -40,6 +40,8 @@ /* OVPN section */ +#ifndef IFLA_OVPN_MAX + enum ovpn_mode { OVPN_MODE_P2P, OVPN_MODE_MP, @@ -49,10 +51,13 @@ IFLA_OVPN_UNSPEC = 0, IFLA_OVPN_MODE, - __IFLA_OVPN_AFTER_LAST, - IFLA_OVPN_MAX = __IFLA_OVPN_AFTER_LAST - 1, + __IFLA_OVPN_MAX, }; +#define IFLA_OVPN_MAX (__IFLA_OVPN_MAX - 1) + +#endif /* ifndef IFLA_OVPN_MAX */ + typedef struct { struct nl_sock *nl_sock;