From patchwork Tue Dec 24 17:42:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4016 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:998b:b0:5e7:b9eb:58e8 with SMTP id d11csp4760845mav; Tue, 24 Dec 2024 09:43:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUdezaJ+eBdhJfuCIG6Cz8kJPC5UJm5EaPPVRNYdmSmTvBX6Zm8eJ1wDM4ejuGV/oeQCPvL9wLm5I0=@openvpn.net X-Google-Smtp-Source: AGHT+IFn8aDKI5LtGCowDBorTCKJOSKULuBs4OrKQSVnFUdhD/SFPEFF6Pq7g3oDN8WKVP/AyYXX X-Received: by 2002:a05:6871:1c8:b0:297:554:c660 with SMTP id 586e51a60fabf-2a7d12a2b7dmr12666304fac.9.1735062186249; Tue, 24 Dec 2024 09:43:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735062186; cv=none; d=google.com; s=arc-20240605; b=WeA1cNzxykYrLINOrR7rkZMlNDYhVVaRndhItBKoy0366T/7WSFbWtLJoWynv1+dwT bB7GsGw/eyNmiV4BuxChpNvCAEzOh65WcAihjrUJP8u36wfhDYQmVWpTco5284IlKaYb tfsbZ/zWKuIXFmxC2RvAhrUAYt+Ug4ZzQKUq4TgEEy4y15Gx24+VPom6/Fmpj0J4/6ZZ FVQpDBL1a2I5wJbCOA7P/pQ5aO1fF6b+MYLumIg/52PEXgbfAaIAJXx2T41Hyq68i5xd X8ZoI/DleI9QXEFm2S/IQsQhZaBwp2DbBVv8ldtxJIVsQkHvDOHSIK7PxMD9gfQwm4le w5cQ== 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; bh=MmQSBhHJtqeOn0/AJYXwJiOpWLpWzz4UM8OxfkN/Tvs=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=HNuacKFgh5GiiugE2EvmLzIVY5VntZYVOJkwXPw8x9fAvG6ZykoePO0cBizDO17od9 DPe7b/iWCKKZeBEr7voqb4LBJzOXDzvMvJ12NVMkaue27UlzVzIwP6l/+EYmGj3qUHv3 Gl0a0TzpjfCTmReGnv7nHPVUdbou9YJ6Segjl2yznPlIGrsS2eWhQmrgtgzszLqmNJ+2 GHgcv7RqlCSVDS/q62YJobiHPCx/o93gcrowgdqQBOLmWR1F7Mu9LUH/uu83srWUbntf XVy49rr8239MXD0qJTkdKc/0ddR2fYLfnImo2I0G4usYsJ65c39Yc1Xdv6bNhC1cPuPR em2g==; 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=XLTYEkBW; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Qyg8VpJs; 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 586e51a60fabf-2a7d78176besi7764723fac.216.2024.12.24.09.43.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Dec 2024 09:43:06 -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=XLTYEkBW; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Qyg8VpJs; 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 [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tQ8vu-0006zD-SN; Tue, 24 Dec 2024 17:43:03 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tQ8vf-0006yd-6R for openvpn-devel@lists.sourceforge.net; Tue, 24 Dec 2024 17:42:47 +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=CBHC45VICgd08NH4899y28ruDqQ5dy38AKMNDYlx19g=; b=XLTYEkBWIhV3XZvgxLfpr+7gRX R5xW5cbzBZEAIGyeG5n3viZ5iQ/s4k/ughOGP3GtZnbIxYJ0Dl29r/hisEKyLgkocdA/CiKaaknAD Xgu439288DhmcKGUO2uDx5sHLwxhXFSC0yDJnKcMlwmAWb4g770tv5+8mGTCp3AKejzk=; 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=CBHC45VICgd08NH4899y28ruDqQ5dy38AKMNDYlx19g=; b=Qyg8VpJsSYT+dQKbpQG00KkVUP lRIc0Hj9Z6cIJv6BeJe4sU50J4ZYlCSVueU5w5hrU13mFbuo9hSesxavyxpEzURSFeMZI62UBB4SO K2quGlHze/RDxL6K7vgNPJa8GXWQ7rOI+gD57+kIqXUFy28zEs2J1Lwdt2TT7obw8uYU=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] 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 1tQ8vd-0004Nj-UV for openvpn-devel@lists.sourceforge.net; Tue, 24 Dec 2024 17:42:46 +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 4BOHgY7B013015 for ; Tue, 24 Dec 2024 18:42:34 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 4BOHgYXW013014 for openvpn-devel@lists.sourceforge.net; Tue, 24 Dec 2024 18:42:34 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 24 Dec 2024 18:42:33 +0100 Message-ID: <20241224174233.13005-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 0.0 (/) 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: From: Lev Stipakov Commit 6f2d222 ("dns: store IPv4 addresses in network byte order") Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in sa-trusted.bondedsender.org] 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. [193.149.48.174 listed in bl.score.senderscore.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1tQ8vd-0004Nj-UV Subject: [Openvpn-devel] [PATCH v1] repair DNS address option 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?1819344567086603260?= X-GMAIL-MSGID: =?utf-8?q?1819344567086603260?= From: Lev Stipakov Commit 6f2d222 ("dns: store IPv4 addresses in network byte order") changed the internal representation of IPv4 address within DNS settings to network byte order, however later this value is copied into tuntap_options, where IPv4 addresses are assumed to be in host byte order (see lots of occurences of "htonl(tt->" in tun.c). As a consequence, DNS server address is set incorrectly, like 4.4.8.8 instead of 8.8.4.4 Fix by converting address to host byte order when copying from DNS options to tuntap_options. Change-Id: I87e4593e6a548bacd40b840cd241950019fa457d 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/+/845 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 b2a3a8b..20e8d55 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1390,7 +1390,7 @@ overflow = true; continue; } - tt->dns[tt->dns_len++] = server->addr[i].in.a4.s_addr; + tt->dns[tt->dns_len++] = ntohl(server->addr[i].in.a4.s_addr); } else {