From patchwork Mon Mar 17 15:14:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 4181 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:7046:b0:60a:d70a:d3c7 with SMTP id t6csp2215441mat; Mon, 17 Mar 2025 08:14:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVbJKPUpGKPT0f2vJKyRiicPX0JZAXICPGOebyTy7O+FmxQDXhfVdmKSPw6sDBwg6oTYrLHAWDdY8I=@openvpn.net X-Google-Smtp-Source: AGHT+IGsQ63/mz19CN9Nphy5Jnp3CRSIvx9SpfcuWf+YUxfaducUfHWBwvuulRATGAnOFQhq8sPK X-Received: by 2002:a05:6808:1487:b0:3f8:eee4:7140 with SMTP id 5614622812f47-3fdeed0d629mr8550599b6e.22.1742224472564; Mon, 17 Mar 2025 08:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742224472; cv=none; d=google.com; s=arc-20240605; b=R2TQsAozuxkN2Wv1MMX+IXwX+0bXbqMd4uSozQDjTyBa9z0w8t1SEx2rph/O1YWpC0 GKI6MHdsUKiJwldhkTCkT3HNDaKlouYzZGsB656sG8xU/eQ3lSp/DuovZxHsgW1UuBnK XdX30HhPxnmWXbgU4j0hHENrnMgJHXrbVS0rI/4vo9wZVYwdo0B01QDwiUZ5voL0MrUF IjsOnDCKAv33ATuuzD6coK8UI11b6t+wr4mCPHFkcHvzTRceViFDQwrSxk5LyzX1/lPV Sh1qFPUij/jOpvOEKJAVVhKnE219901h7DqoAXEwOI0y+AIXUUEsn2rJ/xC02lp7xl/K NiPg== 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=L9O2YIBNv+8uGujzu9bATbHZ08h+Nx5aPbL+aCmlnnw=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=kwrYlzgGNj6/38gK1IxwHqEfOKeWY+hp3GVErHkIaWP3uStwniv1zc4EZ0H7pGc9KX 3VArR8w2prblgJMZrZ8AB7hvrHOFHt7MGBJdUjDPrLUdukOslQRF4JrSuv1VKUibRRcD RIfEGdywVmgfbTleyy02OR+3SDFuG+UxStgebnuM31/XR/aZwIObwLlrZzkU0fD7RyVh SBlVEKDdchTNF41WkUyIsZ91vER93JBLIkyBcZhq1zLYlQMT3zlUh50g06mK32JUVCI8 nPouMRFnA2lq/+wbysWc4jod3JTT0BM06/fb2+V/Pkl4AeU4Z7aPuWu7y5jsSz+V+6UP Pl/Q==; 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=bHocPq2t; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="k8xOsg/J"; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=NMc6fr0n; 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 5614622812f47-3fcd403dfe5si5824948b6e.24.2025.03.17.08.14.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Mar 2025 08:14:32 -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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=bHocPq2t; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="k8xOsg/J"; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=NMc6fr0n; 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-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tuCAe-0001bL-Gb; Mon, 17 Mar 2025 15:14:28 +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 1tuCAc-0001bD-GN for openvpn-devel@lists.sourceforge.net; Mon, 17 Mar 2025 15:14:26 +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=X7i78UIVVQ9CToRpx0sH8Z0shK1YtejO/q312Jcgi7Y=; b=bHocPq2tgnD6kZ5Zo5Ugoy06Et Dl49ALU89bQLArD/c17QL6pab+z95xxVD2mhKA0/TnoI09AMLKZKgO4TQcAxAPVM736Z93szQ4TWl JxLPlnYcvfl13l396heLvw1TYpqXGqhfb9a3GWMcz63miihMeAO3MdPK4EJE08gaEll0=; 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=X7i78UIVVQ9CToRpx0sH8Z0shK1YtejO/q312Jcgi7Y=; b=k 8xOsg/JuH7M9q333DU3BJAgRakaHOPPnRzh82Dalm1SW7k6ORM8eSsWUmdDPTW/GneqaTzzs0wXJO gSr8lEa/PnI72rspwpWtE1SSkUKxVqvD9apjcoSirs66Xm0dO1C4h3iUR67QhetyfMyNCrrqe8o6Y j7L420RP7xc5Jh/0=; Received: from mail-wm1-f52.google.com ([209.85.128.52]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tuCAX-00007s-1A for openvpn-devel@lists.sourceforge.net; Mon, 17 Mar 2025 15:14:26 +0000 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-43d0782d787so15414015e9.0 for ; Mon, 17 Mar 2025 08:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1742224449; x=1742829249; 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=X7i78UIVVQ9CToRpx0sH8Z0shK1YtejO/q312Jcgi7Y=; b=NMc6fr0nfeCC5e2fLh7lipZIrVeDql9UTMkd5ochli2jiYjHTQUdmNgZQ7M+wv5rBh hF0lyp5j9dP9hh8/DyNSu6HsUiVN3hWpGGkME96+QPZlyu2TdPJAFdHzRVpuC6dpivk+ 5YZNJeYUbbsVeEVVL9c6qzHEEvj2GsHeE4slzMPXoaWPiSE2MX8SFrAhemKJUquIYHhp EbhH9RuObzkIEpmIeeCtt8ZXnKDdydTsS9bil7b1GhDdlgLtOi5gOPYiAKdZpnMjEdi6 KyzWtR5km7gyRUen9Kiklu2OQoqVf2pK8Rv8yPOAo+oqMD7plFONaL+Pm1hB6a7yinEp i1zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742224449; x=1742829249; 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=X7i78UIVVQ9CToRpx0sH8Z0shK1YtejO/q312Jcgi7Y=; b=u7Ryh61WbvR1cT3HmF4H793e0mQVQT9a1HM7zwNOS/u0q8jT8j2mX6yIbKyK3tU2u8 XVztporMoNeQEGn7K9R4EHGRwUDLVoNqXPIOOFRYVKz4dRHJVkgM5b/gS3ao4dU86LhX bxiJPl3+42Y+bT3xyVH5oXSB9L7xDSyAsR1soD/0NMYphSdhFtVuguptNQ0unqSM+zly UzSluE+9Yr/tBN9fn81M04TIPURJk5AWIT6dw/inXj8OmKEs5YlQWdIS97/sQHNiKNeD XobDw3MdNYYasdfPH86G26wpkMQiGO3wL+obb9RuQ2fBKHJaB5dMHXs3twi4lmt6sC8K NYRA== X-Gm-Message-State: AOJu0YyLzQEPxKMiyAoY9EFgMJyrRXIXBE1jbg3AroLCjrAoAOkWBAV2 FdTvnmLYbxu9loYvho2x5cJxnRY+2/GDMmdxb0247dIN11rrbXdr6QFmDx7WUm1YDjm2QmYwTBr 4UpvyUo2xDykQ2cjPet1o5STztvit1qo9j2HcCP72S5u4frHgNYpDNJPhg2w79WMKioO/2SmeYX BvGw== X-Gm-Gg: ASbGncua32uunxiFqkz6CA2Xr3wjJSO0XYjWQZkIIM78670DS3XqCpU4XxcLmPK33rR zv3lW9VdQiPjnGssFGNVQrnTQG2uDe6Bh24TT/AyBFNrc/PkkJePa7JGWQTLfWsH/jO8lFJNhld GTBdEjDdzVe5YtCro/SpBl67LQOvo6F24QjeEEpRM3YCwNbC+mVDiZyZU4IxCkIfoShKZQKccvB lXOoi9uokFqKs0MHJijDfE40JxPIs6pwiAkwDWbIt99ynvRVDWXdmLbZ4f+t+72qOREfonCBsrO oDSto3b6km6U8iUf887TM3BObJQhU6CYGrw6IrXYTEPMoEvGONczlJVu02HL5+bFqOa/5pY9SJ5 cUCAXYJkaHzV9QklWFNxcvcm8c5sqnpF8y6Cl X-Received: by 2002:a05:600c:3505:b0:43c:eb63:415d with SMTP id 5b1f17b1804b1-43d1ec8db5amr159190565e9.14.1742224449070; Mon, 17 Mar 2025 08:14:09 -0700 (PDT) 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-43d1ffb6292sm108227375e9.1.2025.03.17.08.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Mar 2025 08:14:08 -0700 (PDT) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Mon, 17 Mar 2025 15:14:08 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I1c8fcd5bb6e1fa0020d52879eefbafdb2630e7b5 X-Gerrit-Change-Number: 909 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: a7ddcc042ae80698c38c6e3ba34b70569d0307f3 References: Message-ID: <885170f99ccebf00ec9e7501915538f8a35ea716-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.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. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 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.52 listed in list.dnswl.org] 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. [209.85.128.52 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.52 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.52 listed in wl.mailspike.net] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1tuCAX-00007s-1A Subject: [Openvpn-devel] [S] Change in openvpn[master]: Mention address if not unspecific on DNS failure 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: 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?1826854768223316252?= X-GMAIL-MSGID: =?utf-8?q?1826854768223316252?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/909?usp=email to review the following change. Change subject: Mention address if not unspecific on DNS failure ...................................................................... Mention address if not unspecific on DNS failure With the recent changes breaking configs that included lport 0, it became apparent that having the address family in the error message when resolving fails, would have made diagnosis in this case and probably others much easier. Change-Id: I1c8fcd5bb6e1fa0020d52879eefbafdb2630e7b5 Signed-off-by: Arne Schwabe --- M src/openvpn/socket.c 1 file changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/09/909/1 diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 6b32e30..24c414d 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -445,6 +445,22 @@ throw_signal_soft(SIGHUP, "Preresolving failed"); } +/** + * Small helper function for openvpn_getaddrinfo to print the address + * family when resolving fails + */ +static const char * +gettaddrinfo_addr_family_name(int af) +{ + switch (af) + { + case AF_INET: return "[AF_INET]"; + + case AF_INET6: return "[AF_INET6]"; + } + return ""; +} + /* * Translate IPv4/IPv6 addr or hostname into struct addrinfo * If resolve error, try again for resolve_retry_seconds seconds. @@ -545,11 +561,11 @@ print_hostname = "undefined"; } - fmt = "RESOLVE: Cannot resolve host address: %s:%s (%s)"; + fmt = "RESOLVE: Cannot resolve host address: %s:%s%s (%s)"; if ((flags & GETADDR_MENTION_RESOLVE_RETRY) && !resolve_retry_seconds) { - fmt = "RESOLVE: Cannot resolve host address: %s:%s (%s) " + fmt = "RESOLVE: Cannot resolve host address: %s:%s%s (%s) %s" "(I would have retried this name query if you had " "specified the --resolv-retry option.)"; } @@ -561,6 +577,8 @@ goto done; } + + #ifdef ENABLE_MANAGEMENT if (flags & GETADDR_UPDATE_MANAGEMENT_STATE) { @@ -639,6 +657,7 @@ fmt, print_hostname, print_servname, + gettaddrinfo_addr_family_name(ai_family), gai_strerror(status)); if (--resolve_retries <= 0)