From patchwork Thu Jul 31 15:29:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4344 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:b86:b0:671:5a2c:6455 with SMTP id mw6csp1693911mab; Thu, 31 Jul 2025 08:29:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUYNdwgIpjLDgTxOQbJzCyUzX/mhQp4nrq5kwB1e7GIUSjJ+pFJcrKwmAFR4MamsyE+Q2XoJ34EeZE=@openvpn.net X-Google-Smtp-Source: AGHT+IHlWuKEpAqbXqk7OcxfSLkwAf5GIBUzZ4TYl2FL43YMvCeiRclUCCfUy9/J4a6z36VoZBSz X-Received: by 2002:a05:6808:2191:b0:404:b5c6:46f3 with SMTP id 5614622812f47-4319b24a35fmr5361517b6e.21.1753975765713; Thu, 31 Jul 2025 08:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1753975765; cv=none; d=google.com; s=arc-20240605; b=RHzIwxh/4q9gS5Wem4mhfQTfB2svjIllpGAER032jwn1og9MHR+wu+/o44nUhfpXkl MjM+jOTziQFK/yTb0ZIb7G8Lu1KBrvtW9aebY37XXg5ZxVx+cBEKpDUuBjHcBYvRDmP9 WeXTSTzIfuqr6KyVJ/+R0aMhfI9Mgc6jBwQezonRuKdLRLPlou4SXycow+uGOz2Af43s z9f0MDD3nXxG1jtNn4z3VuSDGlBfSX6h2K2bmmtB+9iqYhHZx2Hm59tS8/D9+Gcf4sLp YKgKBMs7BO79HkUrCTLQVfMlPL4PC4evMqsEESJs7L/asnBUcPGyWpKVknzitrjlhUv9 k4DQ== 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=h2ydi8cojo3yLoJU0atgT0QZ/MhkKpmzYKtsewqH5ik=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=WKgPaQ208RgwNzgiDFwBjgNeHLsmAhlgbNDAZQ3pSsjvTnWkVq3SXRsd7fMF5MYB+G d76RRrJxIVZlro/s/CDpiTq7uwu3HqaLdUBk/StZzwOnNt6Z7266/rClGOqik21i35ca +DnvhKIOU20U99iFbh5+qbKCNMRTnHS91uYs0AcmEYWkF0jgXHUIAWFxFMmOcLjV3/uA kreQPIdK5W+57Imm8sD5fH6c8J0um8IuCjjKjtRlwBz2Bi+ASXRt+7I59MTPVdQQhH+d 0JkK1k1qHeY658mhrpidARoKNeP/tWgktu7swsqdIhnnyv9P/Oh+kg5y95Nxc7wKZdwX r2Yw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=KEWw8GvW; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="cYM/oPSl"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=hz4irQAl; 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 5614622812f47-433585a6aaesi462529b6e.182.2025.07.31.08.29.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jul 2025 08:29:25 -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=KEWw8GvW; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="cYM/oPSl"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=hz4irQAl; 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=h2ydi8cojo3yLoJU0atgT0QZ/MhkKpmzYKtsewqH5ik=; b=KEWw8GvWlk/bE/6KD9rTmWOKxa dH6Szo/ydMlAPZDDMEBOe0NJaYYv/CfYGgIQWJFU+wsVfF2qIbwsdh/M0tNmGFoU+SaftS/dTHStg EVea5KHpljjRZyecFw8f62OKQ1rH8Q8sm9nfthaZB8phr2/ZMaFkm7x9u/wh4I/hXOC4=; 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.95) (envelope-from ) id 1uhVDf-0006bR-Dr; Thu, 31 Jul 2025 15:29:23 +0000 Received: from [172.30.29.66] (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.95) (envelope-from ) id 1uhVDd-0006bJ-EK for openvpn-devel@lists.sourceforge.net; Thu, 31 Jul 2025 15:29:21 +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=6PLDb/ydgbNalXHwDn3ciX9G6RsJbHGSX/BDPTx4s6Y=; b=cYM/oPSlkonHrTIRYBtiVBRwhI 9pOHh2Px+aha6hDgZchKgJmTChs9NUx76A0GJ4phb14pyGT/KhH95rpZN6/0FgW/5WR8N3em28q+X mWT2s94GHZdwHq1Vz14jeGNLfZYCVu4sTLYRkCXb38n+0PZ7ov9z4l2E+9qmz+e3PE4M=; 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=6PLDb/ydgbNalXHwDn3ciX9G6RsJbHGSX/BDPTx4s6Y=; b=hz4irQAlIavNpLqenobn0hka3U TPYKrpBRrOBvLh/Ik36nI7kWqp1dvbYB396GTLs2+zXzCeQegdkkQUPYAbg2kYOAg4x+D71E90U5Z bklqDwAAzjzCyISBeHaMvk1coAJwGeGRKq1+dpmonnwdItqzQ1agPHDWPJM66Giyovhs=; 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 1uhVDc-00037U-8n for openvpn-devel@lists.sourceforge.net; Thu, 31 Jul 2025 15:29:21 +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 56VFTD22021854 for ; Thu, 31 Jul 2025 17:29:13 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 56VFTDi9021853 for openvpn-devel@lists.sourceforge.net; Thu, 31 Jul 2025 17:29:13 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 31 Jul 2025 17:29:06 +0200 Message-ID: <20250731152912.21826-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-1.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: Lev Stipakov We already fixed it in commit 82fd89a04f, but the fix got lost in 2dfc4f8. tuntap_options require host byte order, and we store dns servers in struct dns_server in network byte order, what we got from getaddrinfo(). 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: 1uhVDc-00037U-8n Subject: [Openvpn-devel] [PATCH v1] Fix wrong byte order of --dns server 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?1839176892504249158?= X-GMAIL-MSGID: =?utf-8?q?1839176892504249158?= From: Lev Stipakov We already fixed it in commit 82fd89a04f, but the fix got lost in 2dfc4f8. tuntap_options require host byte order, and we store dns servers in struct dns_server in network byte order, what we got from getaddrinfo(). Fix (again) by converting to the host byte order. Change-Id: I37ca672f05e9d77ec586fa28dadc6dc752e574fb Signed-off-by: Lev Stipakov Acked-by: Gert Doering --- 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/+/1125 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 3ceada0..ff9addd 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3573,7 +3573,7 @@ { if (s->addr[i].family == AF_INET && tt->dns_len + 1 < N_DHCP_ADDR) { - tt->dns[tt->dns_len++] = s->addr[i].in.a4.s_addr; + tt->dns[tt->dns_len++] = ntohl(s->addr[i].in.a4.s_addr); } else if (tt->dns6_len + 1 < N_DHCP_ADDR) {