From patchwork Fri Sep 19 15:40:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4428 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6a92:b0:72f:f16c:e055 with SMTP id u18csp290594maw; Fri, 19 Sep 2025 08:40:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWaQigzAG9EwgqoImNgP7jllEuNrzbydFP1anUJlPZlUjaDeD0Ejic8MbwAbi3B40rh+FB6N2EnDdU=@openvpn.net X-Google-Smtp-Source: AGHT+IE87pXPGl2SU4qK587IDpVVyaGOUVW5Sx51oVf2l+F1+jZGyuMvpEexqvmrC/PLDmhAYop8 X-Received: by 2002:a05:6830:7310:b0:759:6de2:a87f with SMTP id 46e09a7af769-76f7ec9a5f2mr2747946a34.27.1758296454923; Fri, 19 Sep 2025 08:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1758296454; cv=none; d=google.com; s=arc-20240605; b=WUFCzkMGzA43DevMwdD19Dl+l11TzEg+xTkKzM5kBbMNTWEpj8xjQ9bILV206CX2Av 2oVLp4IoaHAuzEKJMXnZ5dOoHCFNd0jiRn2oZDYsA3QeTykjao5IoqbNqjpHlqD0baxN WW6sJRm4Npd6HSqs+TzKXjIhmajsKGC2vmC6IMaGJY2MT7K9j3i2JQTwpN/+syoTGA+9 EOOETfre+ceFR4nn0wKB/bSh8pAnBVSAQRezPD2CwZuGrJaphIFp3L7DhrRhYOf7JeHs bekiOlKwwNWpFAiPJkVNb08aOXFlu0unkuO8+6+kGuUsFMFfGUTqpXCXtf8bCh4c/xHF VztA== 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=T8DEBFo6gcsaVXZqZ5+yPTZdVbSTgiy2/734WKoTUr0=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=L1SyzMu3I2esPWbtEMp7e6dKDR3frciZsMO0fz75spXJj99pU8TCWRU69YefcFvhU2 XLDICm+9nnlhThQmSdyYK+zPuveTEDAsZg/gCJLXex7b/zywjyulOwy1ban+oYDoCbmm yqtNXczAHid3Ch6bL4xE01mVQxnvkNoihQEf40beUyrdGTB2VWRGOHyfVrDpIRX2wtDA Yusvr7RZuaR+JhL+DxmVrVGx44Pr9mhUViwRw57l1YEh0aBgEhNcL24+/9zRagUM/LFM ziwnueeM4sJLVxPkEALFx0mHoOumiG5vhhDXXCGqMVrxlHj2xLqiDhe7m72ZxZZos2gj v8gw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=SJAamJlQ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="Cvw2fpr/"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=nMWsRcvK; 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 46e09a7af769-769263840c4si1556524a34.183.2025.09.19.08.40.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2025 08:40:54 -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=SJAamJlQ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="Cvw2fpr/"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=nMWsRcvK; 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=T8DEBFo6gcsaVXZqZ5+yPTZdVbSTgiy2/734WKoTUr0=; b=SJAamJlQ8bjG6xZejurFnKB323 70YT5ftFRYDuIkiqzQKOotP9wSi4rz6hklzUmwYfs4pJ3itlOnTYWCkAHgJJK1HSsgGYn1vyIJPTa fmLtg3VXC1y5AFBJlCfHmYZ8Az14Qnegy0EBqFmxoi8+elnqT2SpqD+p35CBbQyuwq2A=; 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 1uzdEA-0004ls-DO; Fri, 19 Sep 2025 15:40:51 +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 1uzdE8-0004li-QO for openvpn-devel@lists.sourceforge.net; Fri, 19 Sep 2025 15:40:49 +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=2lud027y7qGLJu3Y7RzGXaURiYsJFmHNG0TrQ4ibnug=; b=Cvw2fpr/9SiKNz1v34NpHPbHoX BKkk1B9FRxgHZwSYL5iyTcelhDNKSGEaI94l/Vgnxm9V46eGAVVlBPxoXKK6Wy5U+cjxGvtDPzUVL 9PbSHPPtvkhc7Ah0DBBaPF6d6K+KED7qq+E+AKCA7kYZqjq0//tZtB67+ZEtp1Xz6LyY=; 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=2lud027y7qGLJu3Y7RzGXaURiYsJFmHNG0TrQ4ibnug=; b=nMWsRcvKZQm+XNVHLY9CYXHLRq 9ZwwC7mjXEHfIwcb8MHj727h31wqFRXb5n6LA/mP8fLDcd8cO4+9vD+T6Qc/hyvRNgD6l9Sr3vAD9 UrHe5KCNp95+zEPfp2rh42BGhSmQzuNDXtkCO3MNb/Nxj/Uab+oL+K62dwq5frHmTHbs=; Received: from [193.149.48.134] (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 1uzdE7-0001o9-Rx for openvpn-devel@lists.sourceforge.net; Fri, 19 Sep 2025 15:40:48 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 58JFefaa017701 for ; Fri, 19 Sep 2025 17:40:41 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 58JFefXd017700 for openvpn-devel@lists.sourceforge.net; Fri, 19 Sep 2025 17:40:41 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 19 Sep 2025 17:40:34 +0200 Message-ID: <20250919154040.17684-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 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: Frank Lichtenheld And use them consistently so to avoid conversion warnings. Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [193.149.48.134 listed in list.dnswl.org] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1uzdE7-0001o9-Rx Subject: [Openvpn-devel] [PATCH v6] socket: Change resolve flags to unsigned int 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?1843707463392102626?= X-GMAIL-MSGID: =?utf-8?q?1843707463392102626?= From: Frank Lichtenheld And use them consistently so to avoid conversion warnings. Change-Id: I5ef21e425786a49c90d4b7305c3fb174ab6ddf92 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1131 --- 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/+/1131 This mail reflects revision 6 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 306170c..e362e5e 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -245,10 +245,10 @@ */ static int get_cached_dns_entry(struct cached_dns_entry *dns_cache, const char *hostname, const char *servname, - int ai_family, int resolve_flags, struct addrinfo **ai) + int ai_family, unsigned int resolve_flags, struct addrinfo **ai) { struct cached_dns_entry *ph; - int flags; + unsigned int flags; /* Only use flags that are relevant for the structure */ flags = resolve_flags & GETADDR_CACHE_MASK; @@ -268,7 +268,7 @@ static int do_preresolve_host(struct context *c, const char *hostname, const char *servname, const int af, - const int flags) + const unsigned int flags) { struct addrinfo *ai; int status; @@ -322,7 +322,7 @@ { int status; const char *remote; - int flags = preresolve_flags; + unsigned int flags = preresolve_flags; struct connection_entry *ce = l->array[i]; @@ -1185,7 +1185,7 @@ /* resolve local address if undefined */ if (!sock->info.lsa->bind_local) { - int flags = GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE; + unsigned int flags = GETADDR_RESOLVE | GETADDR_WARN_ON_SIGNAL | GETADDR_FATAL | GETADDR_PASSIVE; int status; if (proto_is_dgram(sock->info.proto)) diff --git a/src/openvpn/socket.h b/src/openvpn/socket.h index cce9183..e45981f 100644 --- a/src/openvpn/socket.h +++ b/src/openvpn/socket.h @@ -67,7 +67,7 @@ const char *hostname; const char *servname; int ai_family; - int flags; + unsigned int flags; struct addrinfo *ai; struct cached_dns_entry *next; }; diff --git a/src/openvpn/socket_util.h b/src/openvpn/socket_util.h index 5ea37dd..801fbfa 100644 --- a/src/openvpn/socket_util.h +++ b/src/openvpn/socket_util.h @@ -114,18 +114,18 @@ * DNS resolution */ -#define GETADDR_RESOLVE (1 << 0) -#define GETADDR_FATAL (1 << 1) -#define GETADDR_HOST_ORDER (1 << 2) -#define GETADDR_MENTION_RESOLVE_RETRY (1 << 3) -#define GETADDR_FATAL_ON_SIGNAL (1 << 4) -#define GETADDR_WARN_ON_SIGNAL (1 << 5) -#define GETADDR_MSG_VIRT_OUT (1 << 6) -#define GETADDR_TRY_ONCE (1 << 7) -#define GETADDR_UPDATE_MANAGEMENT_STATE (1 << 8) -#define GETADDR_RANDOMIZE (1 << 9) -#define GETADDR_PASSIVE (1 << 10) -#define GETADDR_DATAGRAM (1 << 11) +#define GETADDR_RESOLVE (1u << 0) +#define GETADDR_FATAL (1u << 1) +#define GETADDR_HOST_ORDER (1u << 2) +#define GETADDR_MENTION_RESOLVE_RETRY (1u << 3) +#define GETADDR_FATAL_ON_SIGNAL (1u << 4) +#define GETADDR_WARN_ON_SIGNAL (1u << 5) +#define GETADDR_MSG_VIRT_OUT (1u << 6) +#define GETADDR_TRY_ONCE (1u << 7) +#define GETADDR_UPDATE_MANAGEMENT_STATE (1u << 8) +#define GETADDR_RANDOMIZE (1u << 9) +#define GETADDR_PASSIVE (1u << 10) +#define GETADDR_DATAGRAM (1u << 11) #define GETADDR_CACHE_MASK (GETADDR_DATAGRAM | GETADDR_PASSIVE)