From patchwork Tue Nov 26 15:28:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "kallisti5 (Code Review)" X-Patchwork-Id: 3964 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:8712:b0:5db:5963:ef83 with SMTP id bv18csp140787mab; Tue, 26 Nov 2024 07:29:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXtoC2SoJZr39uSE6lq8wyCCgp6AfViaFzRvylbL7tdSa6TOO54mSE50Lmq0dDLVlfzmo8pGdTi8Bg=@openvpn.net X-Google-Smtp-Source: AGHT+IGXZ+fO/sIjMxYBCGmEIQuYSOmK+bl6rFzMbn+Ncd8v00OfrrfZLFQEQNNtkuPnjPGBefBv X-Received: by 2002:a05:6902:1247:b0:e38:a786:d2fa with SMTP id 3f1490d57ef6-e38f88921a9mr17226762276.0.1732634953294; Tue, 26 Nov 2024 07:29:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732634953; cv=none; d=google.com; s=arc-20240605; b=d7QE36uIpGNNZTxDNkV2Vg8753P6kqSzk2oc8BROUSf1hKb3enqzacmx6TwI5pha7l 4gYmC4EhP0Mn079Bs8LPfFLsnuN4zixu5luzVcNboqDWG8Sr5HZA87mRzq7DNPt3K1O+ 2bjGjwDASs+63+D/JpiKmBqsNmcfgA9FYRYoOKb9ieLeHfL17oJs7gVFQ9cLmeemdHzk j31F4Zp4gKklEQyQq9ZdhNQ075H9Y3YwdDpbHvQAI9ovHvMFlomeXcpEjSOWWEh8s+FK 0djKoiWf3Xz8zzHyC/tBK6HwRfdo40IfPgrfC/jpfvhf/3eL7VvKKkeFYys3f2iV3qqj En5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=W7w3+xlTQt7AR7FjLYVWGIguBTfAY5LlW2ff3eMDt0A=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=CbVOuZ1E6s7yCTx47zYFi9Tvny8zIGHygkRQxJEIIu4BzWcCYixxw73tWc9t0CYAAH utq9IeADqL/NJpFlyFif/qbkG+tI6d/qBQlqtSXSmOX5vFzzhvOkIlc1dSdwMn82aVpo 0P82K1Zn6U31wRvEKw5BjYHG+Skn8SeialpETreDXoaSA8qCRBfJIPDOM+3LMlemj1JH d1rSxP9ry3frZ8AMmsScMn7ivNPhZJAP1T09galG8AIat6BX9bwJOdlJNWpcT64CmFDH WPjdcSc2YwRi/0G7WypebVmB6hT6R1BzvMfFGapWurGRZ2g5px67YTUjIPgoSeG47MxY /2Dg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Z1yMB7j8; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=bem2H5rT; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b="O29EX/q/"; 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=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 3f1490d57ef6-e38f634d242si6990020276.57.2024.11.26.07.29.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Nov 2024 07:29:12 -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=Z1yMB7j8; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=bem2H5rT; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b="O29EX/q/"; 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=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tFxUt-0002s2-Kj; Tue, 26 Nov 2024 15:29:03 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tFxUr-0002rn-Ez for openvpn-devel@lists.sourceforge.net; Tue, 26 Nov 2024 15:29:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yqs/VSoR6elY1J+1XNaP4RzF4vExBkaTlPy0tgQuKlY=; b=Z1yMB7j8mZlKj9rrQ7E1SZQaPE 4sKVBa6J/Tlsc4amESfYmOTJQolkOp4OzM9Z0MsbA9hgjrJhO5xYn0bR/Wq8NyW3AIiDu1dr/0fzl bH8V4wzWlLjIXK3yM3oxTtpKsAK+ISCh4unb7PapkZWA0X66Sff6X0/U41fZa/kP0BKI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=yqs/VSoR6elY1J+1XNaP4RzF4vExBkaTlPy0tgQuKlY=; b=b em2H5rTWL4z+FdAILkCUY9zSMGal/btaDsSNxJaoRZpHA2h5ojbqh5zvoQD1AnZrNwE4lVyCcZXrS xUa9/gUct46XKcX9Lc4x2cFOoxsjyc0ELAQjyjubfI4yIcDHxVvI0KRQbx18WSHz9rtXOR1IfAWO3 ZpDRZoBTdTIMQPo0=; Received: from mail-wm1-f47.google.com ([209.85.128.47]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tFxUp-0003vT-KX for openvpn-devel@lists.sourceforge.net; Tue, 26 Nov 2024 15:29:00 +0000 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-434a1639637so16430115e9.1 for ; Tue, 26 Nov 2024 07:28:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1732634933; x=1733239733; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=yqs/VSoR6elY1J+1XNaP4RzF4vExBkaTlPy0tgQuKlY=; b=O29EX/q/CbrerLEpjaVnNYC1gW3H2+ok9v70FpZXapdqajKaZlXPlIB7ry7IyxRcia LFvV1916ssO/0Y0jtB0/YkdzedU0j4w3eCb+3mAjFUIatGemMhV8pwj7VKwj3hMg4waN bM4G9ma7lwyVLqUH2RQF5QTVIsFuwNWfcqenWYfaM0EABRtkroUHjX+V5mhx5f8qhZC6 UhpQyjfBp9MfBUtIWWNY/o2kLK375AigAsToh544NI62SB8/C77MzEs70l6zAKaRsHOz Rdiwcdisoy9qhA5SFKB+wKe70mLZattHPnAJ5tLgjnlaBnB09VuZK0yNOFjanlV+XwBi xC7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732634933; x=1733239733; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yqs/VSoR6elY1J+1XNaP4RzF4vExBkaTlPy0tgQuKlY=; b=wWoQYm7zZ7apSi0vNVDgWrE0NrHxBAu/AtzYdGhs9Fdx2kiH1G5dRJitH/Jwme7eDX F8m0Tw7t+fawK8wkqA/jk3MH3mKqI6/6dkPrVsa1xUSQL93SoAMiXHDHUoLW6RfdbBBo qzBH2GdFQ4wN3xrNpV1cs/mcNnwA8nymYMnajfQ5b2vh8OTG8JK4Blb0Td5efQecuwc+ cQPozNJY4goyl9skHxqCCkPhX6RUM3bHfr20Ln/t0cI+JNpSDxVHV3FDyxhsqcG9mtLG 9s7mnjwMVNrnbMMpro/mCHBZ4k13BXjhc/fFT7rWbmIJ5JXWDarScOKc0cWIpBQPM68r GKQg== X-Gm-Message-State: AOJu0Yzj2yqKNzd3owx3pFkXprn1MO4qy00xFRHauXwzkaDG5fzFzAQU uswyyxsWcr+PbklK8SiIPKKeHOCeYESqxVACXZUS7hA/mZ2SxiMNuJhzwjgVje4= X-Gm-Gg: ASbGnctrwdDN9jIJhl+/889Di9xynubjwOexsnlBsB5+pzarHRiRrItptZZtNv3PrQH kHaPbOyK4l41uuPMGS9m+7m0R7QGaA/vS8k6xbxN0orE/DvUFHXf4KYx9G3NHrGhHld6jbu+Uol V0afhfjsyCNmKmK+oxiWwM1DvYu4c1LM08KXolZ+oza9fWw4sbMtLLL3ybB/9Sq6uxgUM1Bh5pR WAXbJCa4W0MOrNbQJCC26l/oi1vkpwKp9h6HD9WjnUFPkUFbQIMoWiFSU15KwxVkDylUc7gxmdJ YUP297yXJUYySZbaMLD+lhmHJ+lLg75QWJNPQ9RSvg== X-Received: by 2002:a05:600c:3d91:b0:434:a4bc:5375 with SMTP id 5b1f17b1804b1-434a4bc565cmr33313175e9.33.1732634933044; Tue, 26 Nov 2024 07:28:53 -0800 (PST) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43499bdfc0fsm108760875e9.19.2024.11.26.07.28.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2024 07:28:52 -0800 (PST) From: "kallisti5 (Code Review)" X-Google-Original-From: "kallisti5 (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 26 Nov 2024 15:28:52 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I9a278374f492a538f0c174ced1746c3b1f82b8c9 X-Gerrit-Change-Number: 687 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: f5727f6814c9cb90139cd6bd390310a7c374dd61 References: Message-ID: <71d8c8b97a5882cec6a753c43cc242d2956458f5-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -1.1 (-) 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: Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-1.1 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.47 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.128.47 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.128.47 listed in bl.score.senderscore.com] -0.9 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.47 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1tFxUp-0003vT-KX Subject: [Openvpn-devel] [S] Change in openvpn[master]: Haiku: Introduce basic platform / tun support 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: , Reply-To: alex@terarocket.io, arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1816799427988121329?= X-GMAIL-MSGID: =?utf-8?q?1816799427988121329?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/687?usp=email to review the following change. Change subject: Haiku: Introduce basic platform / tun support ...................................................................... Haiku: Introduce basic platform / tun support * Special thanks to Sean Brady's hard work in GSoC 2023 towards creating a TUN/TAP driver for Haiku! * More kudos to Augustin Cavalie for making it functional :-) Change-Id: I9a278374f492a538f0c174ced1746c3b1f82b8c9 --- M configure.ac M src/openvpn/tun.c 2 files changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/87/687/1 diff --git a/configure.ac b/configure.ac index 0876a6a..7f6e43d 100644 --- a/configure.ac +++ b/configure.ac @@ -368,6 +368,11 @@ have_tap_header="yes" ac_cv_header_net_if_h="no" # exists, but breaks things ;; + *-*-haiku*) + AC_DEFINE([TARGET_HAIKU], [1], [Are we running Haiku?]) + AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["H"], [Target prefix]) + LIBS="${LIBS} -lnetwork" + ;; *) AC_DEFINE_UNQUOTED([TARGET_PREFIX], ["X"], [Target prefix]) have_tap_header="yes" diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 85fe01a..e428fb9 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1631,6 +1631,16 @@ { windows_set_mtu(tt->adapter_index, AF_INET, tun_mtu); } +#elif defined(TARGET_HAIKU) + { + /* example: ifconfig tun/0 inet 1.1.1.1 255.255.255.0 mtu 1450 up */ + /* XXX: Need to add ifconfig_remote_netmask since right now it is just NULL */ + argv_printf(&argv, "%s %s inet %s %s mtu %d up", IFCONFIG_PATH, + ifname, ifconfig_local, ifconfig_remote_netmask, tun_mtu); + + argv_msg(M_INFO, &argv); + openvpn_execve_check(&argv, es, S_FATAL, "Haiku ifconfig failed"); + } #else /* if defined(TARGET_LINUX) */ msg(M_FATAL, "Sorry, but I don't know how to do 'ifconfig' commands on this operating system. You should ifconfig your TUN/TAP device manually or use an --up script."); #endif /* if defined(TARGET_LINUX) */ @@ -1909,10 +1919,17 @@ { for (int i = 0; i < 256; ++i) { +#if defined(TARGET_HAIKU) + snprintf(tunname, sizeof(tunname), + "/dev/%s/%d", dev, i); + snprintf(dynamic_name, sizeof(dynamic_name), + "%s/%d", dev, i); +#else snprintf(tunname, sizeof(tunname), "/dev/%s%d", dev, i); snprintf(dynamic_name, sizeof(dynamic_name), "%s%d", dev, i); +#endif if ((tt->fd = open(tunname, O_RDWR)) > 0) { dynamic_opened = true;