From: "its_Giaan (Code Review)" Date: Thu, 17 Oct 2024 14:47:28 +0000 In-Reply-To: References: Reply-To: gianmarco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., a@...2181... Message-ID: <3330175e8be7262681e2610a66b23884f6ca5f40-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="9eoHrfueocE="; 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 --9eoHrfueocE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, ordex, 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 (#5). 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 Signed-off-by: Gianmarco De Gregori --- M src/openvpn/socket.c 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/61/761/5 diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index b7d80ee..2b55021 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: 5 Gerrit-Owner: its_Giaan Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: ordex Gerrit-MessageType: newpatchset --9eoHrfueocE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, ordex, plaisthos. <= /p>

its_Giaan uploaded patch set #5 to this change.

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

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 fla= g when passing
'::' to '--local' otherwise the second so= cket won't be
able to bind properly.

Change-Id: I705fd9bf9298= a54560eca12e3797351f4af321a7
Signed-off-by: Antonio Quartulli <a@...1665...= 181...>
Signed-off-by: Gianmarco De Gregori <gianmarco@...2726...&= gt;
---
M src/openvpn/socket.c
1 file changed, 10 insertions(+), 2= deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn ref=
s/changes/61/761/5
diff --git a/src/openvpn/socket.c b/src/openvpn/=
socket.c
index b7d80ee..2b55021 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-onl= y 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.l= sa->bind_local,
- = ai_family,
- "TCP/UDP", sock->info.bind_i= pv6_only);
+ = ai_family, "TCP/UDP", v6only);
= }
}
}

To view, visit change 761. To unsubscribe, or for help writing mail f= ilters, visit settings.<= /p>

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I705fd9bf9298a54560eca12e379= 7351f4af321a7
Gerrit-Change-Number: 761
Gerrit-PatchSet: 5
Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <a@...2181...>
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-Attention: ordex <a@...2181...> <= /div>
Gerrit-MessageType: newpatchset
--9eoHrfueocE=--