From: "mrbff (Code Review)" Date: Thu, 16 Jan 2025 17:11:40 +0000 References: Reply-To: marco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <2ad97b27f1fcdee2b4cd87d14bf41e7aa1dd2a53-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="HGtfKR7TDC0="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: IPv6 MADDR LOG: Wrap IPv6 addresses in square brackets and include po... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --HGtfKR7TDC0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/870?usp=3Demail to review the following change. Change subject: IPv6 MADDR LOG: Wrap IPv6 addresses in square brackets and = include port when specified ...................................................................... IPv6 MADDR LOG: Wrap IPv6 addresses in square brackets and include port whe= n specified - Updated the mroute_addr_print_ex() function to always wrap IPv6 addresses= in square brackets for proper formatting. - Added port printing for IPv6 addresses when specified, e.g., [2001:db8::1= ]:8080. Change-Id: Ia58cff107d14e29e51df0a988e8337cbb70ebfbb Signed-off-by: Marco Baffo --- M src/openvpn/mroute.c 1 file changed, 5 insertions(+), 8 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/70/870/1 diff --git a/src/openvpn/mroute.c b/src/openvpn/mroute.c index f4539dc..91419ed 100644 --- a/src/openvpn/mroute.c +++ b/src/openvpn/mroute.c @@ -430,17 +430,14 @@ { buf_printf(&out, "%s", print_in_addr_t(maddr.v4mappedv= 6.addr, IA_NET_ORDER, g= c)); - /* 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 { - buf_printf(&out, "%s", print_in6_addr(maddr.v6.addr, 0= , gc)); + 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) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/870?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ia58cff107d14e29e51df0a988e8337cbb70ebfbb Gerrit-Change-Number: 870 Gerrit-PatchSet: 1 Gerrit-Owner: mrbff Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --HGtfKR7TDC0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

mrbff would like plaisthos and flichtenheld to review t= his change.

Vi= ew Change

IPv6 MADDR LOG: Wrap IPv6 addresses in square brackets and in=
clude port when specified

- Updated the mroute_addr_print_ex() funct= ion to always wrap IPv6 addresses in square brackets for proper formatting.=
- Added port printing for IPv6 addresses when specified, e.g., [2001:db= 8::1]:8080.

Change-Id: Ia58cff107d14e29e51df0a988e8337cbb70ebfbb
= Signed-off-by: Marco Baffo <marco@...2726...>
---
M src/openvpn= /mroute.c
1 file changed, 5 insertions(+), 8 deletions(-)

<= pre style=3D"font-family: monospace,monospace; white-space: pre-wrap;">git = pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/70/870/1d= iff --git a/src/openvpn/mroute.c b/src/openvpn/mroute.c
ind= ex f4539dc..91419ed 100644
--- a/src/openvpn/mroute.c
+++ b/src/openvpn/mroute.c
@@ -430,17 +430,14 @@=
{
bu= f_printf(&out, "%s", print_in_addr_t(maddr.v4mappedv6.addr,
= IA_NET_ORDER, gc));
- = /* we only print port numbers for v4mapped v6 as of
- * toda= y, because "v6addr:port" is too ambiguous
- */
- if (maddr.type & = MR_WITH_PORT)
- = {
- = buf_printf(&out, ":%d", ntohs(maddr.v6.port))= ;
- = }
}
else<= /span>
{
- buf_printf(&out, "%s", print= _in6_addr(maddr.v6.addr, 0, gc));
+ buf_printf(&out, "[%s]", pr= int_in6_addr(maddr.v6.addr, 0, gc));
+ }
+ if (maddr.type & MR_WITH_PORT)+ {
<= span style=3D"color: hsl(120, 100%, 40%);">+ buf_printf(= &out, ":%d", ntohs(maddr.v6.port));

= }
if (maddr.type & MR_WITH_NET= BITS)
{

<= p>To view, visit change 870. To unsubscribe, or for help writing mail filters,= visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia58cff107d14e29e51df0a988e8= 337cbb70ebfbb
Gerrit-Change-Number: 870
Gerrit-PatchSet: 1
Gerrit-Owner: mrbff <marco@...2726...> <= /div>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--HGtfKR7TDC0=--