From: "its_Giaan (Code Review)" Date: Tue, 1 Oct 2024 15:30:04 +0000 In-Reply-To: References: Reply-To: gianmarco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., a@...2181... Message-ID: <44d555ce6a9a938f022c559696e8bd6afeec7073-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="2tMfbONl9D0="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: if a local IPv6 address is provided, socket must be v6-only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --2tMfbONl9D0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, its_Giaan, plaisthos. Hello flichtenheld, ordex, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/761?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by flichtenheld Change subject: if a local IPv6 address is provided, socket must be v6-only ...................................................................... if a local IPv6 address is provided, socket must be v6-only If we want to use a wildcard IPv6 socket (i.e ::port), it must be separate from an IPv4 wildcard socket. To do this, we need to set a specific flag when passing '::' to '--local' otherwise the second socket won't be able to bind properly. Change-Id: I705fd9bf9298a54560eca12e3797351f4af321a7 Signed-off-by: Antonio Quartulli --- M src/openvpn/socket.c 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/761/2 diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 1e48d9a..8677472 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -1111,9 +1111,17 @@ } else { + bool v6only =3D sock->info.bind_ipv6_only; + + /* force binding IPv6-only if an address was specified + * and it is a IPv6 */ + if (sock->local_host && ai_family =3D=3D AF_INET6) + { + v6only =3D true; + } + socket_bind(sock->sd, sock->info.lsa->bind_local, - ai_family, - "TCP/UDP", sock->info.bind_ipv6_only); + ai_family, "TCP/UDP", v6only); } } } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/761?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: I705fd9bf9298a54560eca12e3797351f4af321a7 Gerrit-Change-Number: 761 Gerrit-PatchSet: 2 Gerrit-Owner: its_Giaan Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-CC: ordex Gerrit-Attention: plaisthos Gerrit-Attention: its_Giaan Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --2tMfbONl9D0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, its_Giaan, plaistho= s.

its_Giaan uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/761?usp=3Demail">View Chang= e

The following approvals got outdated and were removed: Code-Review-1 by flichtenheld

if a local IPv6 address is provided, socket m=
ust be v6-only

If we want to use a wildcard IPv6 socket (i.e ::port)= , it
must be separate from an IPv4 wildcard socket.
To do this, we ne= ed to set a specific flag when passing
'::' to '--local'= otherwise the second socket won't be
able to bind properly.

= Change-Id: I705fd9bf9298a54560eca12e3797351f4af321a7
Signed-off-by: Anto= nio Quartulli <a@...2181...>
---
M src/openvpn/socket.c
1 fi= le changed, 10 insertions(+), 2 deletions(-)

git pull ssh://gerri=
t.openvpn.net:29418/openvpn refs/changes/61/761/2
diff --git a/src/=
openvpn/socket.c b/src/openvpn/socket.c
index 1e48d9a..8677= 472 100644
--- a/src/openvpn/socket.c
+++ b= /src/openvpn/socket.c
@@ -1111,9 +1111,17 @@
}
else
{
+ bool v6only = =3D sock->info.bind_ipv6_only;
+
+ = /* force binding IPv6-only if an address was specified
+ * and it is a IPv6 *= /

+ if (so= ck->local_host && ai_family =3D=3D AF_INET6)
+ {
+ v6only =3D true;
+ }
+
socket_b= ind(sock->sd, sock->info.lsa->bind_local,
- ai_family,
<= span style=3D"color: hsl(0, 100%, 40%);">- "TCP= /UDP", sock->info.bind_ipv6_only);
+ ai_family, "TCP/UDP&quo= t;, v6only);
}
}
}

To view, visit change 761. To unsubsc= ribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I705fd9bf9298a54560eca12e379= 7351f4af321a7
Gerrit-Change-Number: 761
Gerrit-PatchSet: 2
Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-CC: ordex <a@...2181...>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: its_Giaan <gianmarco@...1665...= 726...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newpatchset
--2tMfbONl9D0=--