From patchwork Fri Jan 17 11:04:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4066 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:b7cb:b0:5e7:b9eb:58e8 with SMTP id en11csp654778mab; Fri, 17 Jan 2025 03:04:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWqeRL6Tplt7aB/i2VchNsokLCGZgFiovVahXvLgOcAEOftsLfXshbDbtlv/BV2Ma/fjXB00HCYxdc=@openvpn.net X-Google-Smtp-Source: AGHT+IEqB+yz+O+30iX4SZpvhQm/3YBAk4GLBxIJJZSgRkJtVDNUfbC4+E80sPsGfw4HZt079GYW X-Received: by 2002:a05:6871:d085:b0:29d:efe8:5a49 with SMTP id 586e51a60fabf-2b1869b4c27mr5907939fac.3.1737111878078; Fri, 17 Jan 2025 03:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737111878; cv=none; d=google.com; s=arc-20240605; b=UqjYseNY6yKm0Utf2ouqho961Fo5gTx+Qa0j2E0jzFU01c60L1XVdrbxWmiyc4iaCv /mjowV+hVIJ7ljKje/H3DklJzpzxRmMKgsNmonBeyxLoH1hpfqUVCfc/iAux05utBelQ 2niFZmUC6DgWNv0ds/9DCOIbZ2WDZh8Yq4K3lWICl0fNs588y5brMLcqhnuCWo0aafoI Bz8uS1QpPC7AdPSPFf9QBySNvlATxSQi5cKFuykU11cXG7ae2VWQEXEa5+hPN2SuEKUp 8rdxFxZJh3IsP7Sryo7xxXk24W/1KwpNuS/LR0H6zguI1S7YApGUsNGf1wls9UPj2ZwH ntRA== 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=Wwm/8E8GZAAs215dYqJlY4dgM7Hy7tfdWI9Et0HPZOU=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=DhewUcO+KIlGOOcQNteNqIKaFxMZIT1szZqmJXfKi8UNlipd+ZyAKjonr8DEoSOiW5 UUoCZa38Xp05txEIUUGGanzZZPwtQAubCvf6dS1JDH8MSCNPEQrdml6UfyApbZ0ZcpX4 Kd/T9QOJ1OKdzdAAha2M3y91Q1L9RXWWx/QSs0MlqgvWdOSLZus6Mrv2JtECEbAisVPe lgwC1w5dRsmkusjGMeF1UoxBmfjiSncXd59q+EF/grh/teDxrfmhvGcPmPbUoOLLpcNr wpmniLwMVn4wpr9YP50Gd8O4gn3Tc7+0cUjLjU+YohcZ37Zgn2ov6rOXDrYbZBbuancH kGqw==; 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=a3j+MIbo; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="GoGTngl/"; 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-2b1b8c7d000si1954967fac.22.2025.01.17.03.04.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jan 2025 03:04:38 -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=a3j+MIbo; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="GoGTngl/"; 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-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tYk9S-0007d9-TX; Fri, 17 Jan 2025 11:04:34 +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 1tYk9Q-0007d0-FL for openvpn-devel@lists.sourceforge.net; Fri, 17 Jan 2025 11:04:31 +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=BTKZhxpqzWCR9vEqXBYV5opT1sdeXUuDq42VqsDObys=; b=a3j+MIbomjQBx7IXcXGyvwoImr CN0uxqtE9YxXXuBYMZk+7mTiPmV16qJEZoK9vHR6Ut0uhbXxQRN9v9j2/E0pYPlFzi/XZ9dMvu0Jj +0TYRW2rEip2ohLCZYO9gJp29lBHFA8xCCwXql3lCQnpQsnXp4dOtY+jN1KR6GkKOVgU=; 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=BTKZhxpqzWCR9vEqXBYV5opT1sdeXUuDq42VqsDObys=; b=GoGTngl/cFdjxM5XDhBJCkAq3E bRCCG8lo97lcsF+0Xu2fjseNaNQGrXCqpkFXTwVXzcg2lRNTjgGYuMEtPB7MaSxVjSBzBnuhi4crg ZiO+ivvFCsXFVazXYtsUZJS5Z6ImZOeiQfLM4gbY1mKJsV6vU+wQZ/AuA3AZp1LGZc6s=; 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 1tYk9O-0004It-5H for openvpn-devel@lists.sourceforge.net; Fri, 17 Jan 2025 11:04:31 +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 50HB4Nbd000946 for ; Fri, 17 Jan 2025 12:04:23 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 50HB4NQj000938 for openvpn-devel@lists.sourceforge.net; Fri, 17 Jan 2025 12:04:23 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 17 Jan 2025 12:04:22 +0100 Message-ID: <20250117110422.921-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-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: From: Marco Baffo Updated the mroute_addr_print_ex() function to wrap IPv6 addresses in square brackets and printing the port when the port is specified, e.g., [2001:db8::1]:8080 . When the port is not specified the I [...] Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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 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. [193.149.48.174 listed in sa-trusted.bondedsender.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1tYk9O-0004It-5H Subject: [Openvpn-devel] [PATCH v2] IPv6 MADDR LOG: Wrap IPv6 addresses in square brackets and print port when the port is specified 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?1821493824516130129?= X-GMAIL-MSGID: =?utf-8?q?1821493824516130129?= From: Marco Baffo Updated the mroute_addr_print_ex() function to wrap IPv6 addresses in square brackets and printing the port when the port is specified, e.g., [2001:db8::1]:8080 . When the port is not specified the IPv6 address formatting remain the same, e.g., 2001:db8::1 . Change-Id: Ia58cff107d14e29e51df0a988e8337cbb70ebfbb Signed-off-by: Marco Baffo 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/+/870 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/mroute.c b/src/openvpn/mroute.c index f4539dc..80e18b7 100644 --- a/src/openvpn/mroute.c +++ b/src/openvpn/mroute.c @@ -430,18 +430,19 @@ { buf_printf(&out, "%s", print_in_addr_t(maddr.v4mappedv6.addr, IA_NET_ORDER, gc)); - /* we only print port numbers for v4mapped v6 as of - * today, because "v6addr:port" is too ambiguous - */ - if (maddr.type & MR_WITH_PORT) - { - buf_printf(&out, ":%d", ntohs(maddr.v6.port)); - } + } + else if (maddr.type & MR_WITH_PORT) + { + buf_printf(&out, "[%s]", print_in6_addr(maddr.v6.addr, 0, gc)); } else { buf_printf(&out, "%s", print_in6_addr(maddr.v6.addr, 0, gc)); } + if (maddr.type & MR_WITH_PORT) + { + buf_printf(&out, ":%d", ntohs(maddr.v6.port)); + } if (maddr.type & MR_WITH_NETBITS) { buf_printf(&out, "/%d", maddr.netbits);