[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-21 Thread cron2 (Code Review)
cron2 has uploaded a new patch set (#3) to the change originally created by 
stipa. ( http://gerrit.openvpn.net/c/openvpn/+/482?usp=email )

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


Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..

tun.c: don't attempt to delete DNS and WINS servers if they're not set

Commits

1c4a47f7 ("wintun: set adapter properties via interactive service")
18826de5 ("Set WINS servers via interactice service")

added functionality of add/remove DNS/WINS via interactive
service, which is used mostly by dco-win and wintun (tap-windows6
normally uses DHCP). There is a check in code - if DNS/WINS addresses
are not pushed, nothing is added.

However, due to bug we always attempted to remove DNS/WINS,
even if nothing was added. Removing WINS, for example, could take
up to 3 seconds.

This change fixes this by improving check "has DNS/WINS been pushed?".

While on it, convert do_XXX_service() functions to "void" from "bool",
since we never check their return values.

Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Signed-off-by: Lev Stipakov 
Acked-by: Frank Lichtenheld 
Message-Id: <20231220133637.60996-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27843.html
Signed-off-by: Gert Doering 
---
M src/openvpn/tun.c
1 file changed, 12 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/82/482/3

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index f1b8699..8e96149 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -147,17 +147,16 @@
 return ret;
 }

-static bool
+static void
 do_dns_domain_service(bool add, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;

 if (!tt->options.domain) /* no  domain to add or delete */
 {
-return true;
+goto out;
 }

 /* Use dns_cfg_msg with addr_len = 0 for setting only the DOMAIN */
@@ -195,17 +194,14 @@
 }

 msg(M_INFO, "DNS domain %s using service", (add ? "set" : "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }
 
-static bool
+static void
 do_dns_service(bool add, const short family, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;
@@ -213,9 +209,10 @@
 int addr_len = add ? len : 0;
 const char *ip_proto_name = family == AF_INET6 ? "IPv6" : "IPv4";

-if (addr_len == 0 && add) /* no addresses to add */
+if (len == 0)
 {
-return true;
+/* nothing to do */
+goto out;
 }

 /* Use dns_cfg_msg with domain = "" for setting only the DNS servers */
@@ -272,26 +269,23 @@
 }

 msg(M_INFO, "%s dns servers %s using service", ip_proto_name, (add ? "set" 
: "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

-static bool
+static void
 do_wins_service(bool add, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;
-int len = tt->options.wins_len;
-int addr_len = add ? len : 0;
+int addr_len = add ? tt->options.wins_len : 0;

-if (addr_len == 0 && add) /* no addresses to add */
+if (tt->options.wins_len == 0)
 {
-return true;
+/* nothing to do */
+goto out;
 }

 wins_cfg_message_t wins = {
@@ -338,11 +332,9 @@
 }

 msg(M_INFO, "WINS servers %s using service", (add ? "set" : "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

 static bool
@@ -7019,10 +7011,7 @@
 {
 do_dns_domain_service(false, tt);
 }
-if (tt->options.dns6_len > 0)
-{
-do_dns_service(false, AF_INET6, tt);
-}
+do_dns_service(false, AF_INET6, tt);
 delete_route_connected_v6_net(tt);
 do_address_service(false, AF_INET6, tt);
 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 3
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-21 Thread cron2 (Code Review)
cron2 has submitted this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/482?usp=email )

Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..

tun.c: don't attempt to delete DNS and WINS servers if they're not set

Commits

1c4a47f7 ("wintun: set adapter properties via interactive service")
18826de5 ("Set WINS servers via interactice service")

added functionality of add/remove DNS/WINS via interactive
service, which is used mostly by dco-win and wintun (tap-windows6
normally uses DHCP). There is a check in code - if DNS/WINS addresses
are not pushed, nothing is added.

However, due to bug we always attempted to remove DNS/WINS,
even if nothing was added. Removing WINS, for example, could take
up to 3 seconds.

This change fixes this by improving check "has DNS/WINS been pushed?".

While on it, convert do_XXX_service() functions to "void" from "bool",
since we never check their return values.

Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Signed-off-by: Lev Stipakov 
Acked-by: Frank Lichtenheld 
Message-Id: <20231220133637.60996-1-fr...@lichtenheld.com>
URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27843.html
Signed-off-by: Gert Doering 
---
M src/openvpn/tun.c
1 file changed, 12 insertions(+), 23 deletions(-)




diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index f1b8699..8e96149 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -147,17 +147,16 @@
 return ret;
 }

-static bool
+static void
 do_dns_domain_service(bool add, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;

 if (!tt->options.domain) /* no  domain to add or delete */
 {
-return true;
+goto out;
 }

 /* Use dns_cfg_msg with addr_len = 0 for setting only the DOMAIN */
@@ -195,17 +194,14 @@
 }

 msg(M_INFO, "DNS domain %s using service", (add ? "set" : "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

-static bool
+static void
 do_dns_service(bool add, const short family, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;
@@ -213,9 +209,10 @@
 int addr_len = add ? len : 0;
 const char *ip_proto_name = family == AF_INET6 ? "IPv6" : "IPv4";

-if (addr_len == 0 && add) /* no addresses to add */
+if (len == 0)
 {
-return true;
+/* nothing to do */
+goto out;
 }

 /* Use dns_cfg_msg with domain = "" for setting only the DNS servers */
@@ -272,26 +269,23 @@
 }

 msg(M_INFO, "%s dns servers %s using service", ip_proto_name, (add ? "set" 
: "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

-static bool
+static void
 do_wins_service(bool add, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;
-int len = tt->options.wins_len;
-int addr_len = add ? len : 0;
+int addr_len = add ? tt->options.wins_len : 0;

-if (addr_len == 0 && add) /* no addresses to add */
+if (tt->options.wins_len == 0)
 {
-return true;
+/* nothing to do */
+goto out;
 }

 wins_cfg_message_t wins = {
@@ -338,11 +332,9 @@
 }

 msg(M_INFO, "WINS servers %s using service", (add ? "set" : "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

 static bool
@@ -7019,10 +7011,7 @@
 {
 do_dns_domain_service(false, tt);
 }
-if (tt->options.dns6_len > 0)
-{
-do_dns_service(false, AF_INET6, tt);
-}
+do_dns_service(false, AF_INET6, tt);
 delete_route_connected_v6_net(tt);
 do_address_service(false, AF_INET6, tt);
 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 3
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-MessageType: merged
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-20 Thread flichtenheld (Code Review)
Attention is currently required from: d12fk, plaisthos, stipa.

flichtenheld has posted comments on this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/482?usp=email )

Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..


Patch Set 2: Code-Review+2


--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 2
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: d12fk 
Gerrit-Attention: stipa 
Gerrit-Comment-Date: Wed, 20 Dec 2023 13:36:10 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-18 Thread stipa (Code Review)
Attention is currently required from: flichtenheld, plaisthos, stipa.

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

http://gerrit.openvpn.net/c/openvpn/+/482?usp=email

to look at the new patch set (#2).

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


Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..

tun.c: don't attempt to delete DNS and WINS servers if they're not set

Commits

1c4a47f7 ("wintun: set adapter properties via interactive service")
18826de5 ("Set WINS servers via interactice service")

added functionality of add/remove DNS/WINS via interactive
service, which is used mostly by dco-win and wintun (tap-windows6
normally uses DHCP). There is a check in code - if DNS/WINS addresses
are not pushed, nothing is added.

However, due to bug we always attempted to remove DNS/WINS,
even if nothing was added. Removing WINS, for example, could take
up to 3 seconds.

This change fixes this by improving check "has DNS/WINS been pushed?".

While on it, convert do_XXX_service() functions to "void" from "bool",
since we never check their return values.

Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Signed-off-by: Lev Stipakov 
---
M src/openvpn/tun.c
1 file changed, 12 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/82/482/2

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index f1b8699..8e96149 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -147,17 +147,16 @@
 return ret;
 }

-static bool
+static void
 do_dns_domain_service(bool add, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;

 if (!tt->options.domain) /* no  domain to add or delete */
 {
-return true;
+goto out;
 }

 /* Use dns_cfg_msg with addr_len = 0 for setting only the DOMAIN */
@@ -195,17 +194,14 @@
 }

 msg(M_INFO, "DNS domain %s using service", (add ? "set" : "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

-static bool
+static void
 do_dns_service(bool add, const short family, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;
@@ -213,9 +209,10 @@
 int addr_len = add ? len : 0;
 const char *ip_proto_name = family == AF_INET6 ? "IPv6" : "IPv4";

-if (addr_len == 0 && add) /* no addresses to add */
+if (len == 0)
 {
-return true;
+/* nothing to do */
+goto out;
 }

 /* Use dns_cfg_msg with domain = "" for setting only the DNS servers */
@@ -272,26 +269,23 @@
 }

 msg(M_INFO, "%s dns servers %s using service", ip_proto_name, (add ? "set" 
: "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

-static bool
+static void
 do_wins_service(bool add, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;
-int len = tt->options.wins_len;
-int addr_len = add ? len : 0;
+int addr_len = add ? tt->options.wins_len : 0;

-if (addr_len == 0 && add) /* no addresses to add */
+if (tt->options.wins_len == 0)
 {
-return true;
+/* nothing to do */
+goto out;
 }

 wins_cfg_message_t wins = {
@@ -338,11 +332,9 @@
 }

 msg(M_INFO, "WINS servers %s using service", (add ? "set" : "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

 static bool
@@ -7019,10 +7011,7 @@
 {
 do_dns_domain_service(false, tt);
 }
-if (tt->options.dns6_len > 0)
-{
-do_dns_service(false, AF_INET6, tt);
-}
+do_dns_service(false, AF_INET6, tt);
 delete_route_connected_v6_net(tt);
 do_address_service(false, AF_INET6, tt);
 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 2
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: flichtenheld 
Gerrit-Attention: stipa 
Gerrit-MessageType: newpatchset
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-18 Thread stipa (Code Review)
Attention is currently required from: d12fk, flichtenheld, plaisthos.

stipa has posted comments on this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/482?usp=email )

Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..


Patch Set 2:

(2 comments)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/482/comment/6bccb548_434b4cc2 :
PS1, Line 19: However, due to bug we always attempted to remove DNS/WINS,
> Such a delay is the good reason I was looking for. […]
Done


File src/openvpn/tun.c:

http://gerrit.openvpn.net/c/openvpn/+/482/comment/60defa74_6e621889 :
PS1, Line 212: if (((family == AF_INET6) && (tt->options.dns6_len == 0))
> can be shortened to "len == 0"
Acknowledged



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 2
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: flichtenheld 
Gerrit-Attention: d12fk 
Gerrit-Comment-Date: Mon, 18 Dec 2023 15:18:31 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld 
Comment-In-Reply-To: d12fk 
Comment-In-Reply-To: stipa 
Gerrit-MessageType: comment
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-18 Thread flichtenheld (Code Review)
Attention is currently required from: plaisthos, stipa.

flichtenheld has posted comments on this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/482?usp=email )

Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..


Patch Set 1: Code-Review-1

(2 comments)

Patchset:

PS1:
Generally looks correct.


File src/openvpn/tun.c:

http://gerrit.openvpn.net/c/openvpn/+/482/comment/ce967642_7be70959 :
PS1, Line 212: if (((family == AF_INET6) && (tt->options.dns6_len == 0))
can be shortened to "len == 0"



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 1
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: stipa 
Gerrit-Comment-Date: Mon, 18 Dec 2023 14:37:10 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-18 Thread d12fk (Code Review)
Attention is currently required from: flichtenheld, plaisthos, stipa.

d12fk has posted comments on this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/482?usp=email )

Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..


Patch Set 1:

(1 comment)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/482/comment/bcb4535d_4ecbfd8b :
PS1, Line 19: However, due to bug we always attempted to remove DNS/WINS,
> Why delete something that we haven't added? We have this logic (do not delete 
> if not added) for DNS6 […]
Such a delay is the good reason I was looking for. Maybe could be added in a 
sentence to the commit message.



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 1
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: flichtenheld 
Gerrit-Attention: stipa 
Gerrit-Comment-Date: Mon, 18 Dec 2023 11:09:49 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: d12fk 
Comment-In-Reply-To: stipa 
Gerrit-MessageType: comment
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-17 Thread stipa (Code Review)
Attention is currently required from: d12fk, flichtenheld, plaisthos.

stipa has posted comments on this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/482?usp=email )

Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..


Patch Set 1:

(1 comment)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/482/comment/d7d9f828_cf70f1a1 :
PS1, Line 19: However, due to bug we always attempted to remove DNS/WINS,
> What's the issue with always trying to remove these? Is there an error 
> message in the log or somethi […]
Why delete something that we haven't added? We have this logic (do not delete 
if not added) for DNS6 already. Besides, in some cases it might take up to 3 
seconds.

2023-12-14 07:45:35 Closing DCO interface
2023-12-14 07:45:35 delete_route_ipv6(fd00:abcd:194:1::/64)
2023-12-14 07:45:35 IPv6 route deletion via service succeeded
2023-12-14 07:45:35 INET6 address service: remove fd00:abcd:194:1::1005/128
2023-12-14 07:45:38 WINS servers deleted using service



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 1
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: flichtenheld 
Gerrit-Attention: d12fk 
Gerrit-Comment-Date: Mon, 18 Dec 2023 07:53:38 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: d12fk 
Gerrit-MessageType: comment
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-16 Thread d12fk (Code Review)
Attention is currently required from: flichtenheld, plaisthos, stipa.

d12fk has posted comments on this change. ( 
http://gerrit.openvpn.net/c/openvpn/+/482?usp=email )

Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..


Patch Set 1:

(1 comment)

Commit Message:

http://gerrit.openvpn.net/c/openvpn/+/482/comment/4c9d6f7d_e58ded94 :
PS1, Line 19: However, due to bug we always attempted to remove DNS/WINS,
What's the issue with always trying to remove these? Is there an error message 
in the log or something else? Probably should be mention here if we have such a 
reason for this patch



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 1
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: d12fk 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: flichtenheld 
Gerrit-Attention: stipa 
Gerrit-Comment-Date: Sat, 16 Dec 2023 10:13:07 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [S] Change in openvpn[master]: tun.c: don't attempt to delete DNS and WINS servers if they're not set

2023-12-14 Thread stipa (Code Review)
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/+/482?usp=email

to review the following change.


Change subject: tun.c: don't attempt to delete DNS and WINS servers if they're 
not set
..

tun.c: don't attempt to delete DNS and WINS servers if they're not set

Commits

1c4a47f7 ("wintun: set adapter properties via interactive service")
18826de5 ("Set WINS servers via interactice service")

added functionality of add/remove DNS/WINS via interactive
service, which is used mostly by dco-win and wintun (tap-windows6
normally uses DHCP). There is a check in code - if DNS/WINS addresses
are not pushed, nothing is added.

However, due to bug we always attempted to remove DNS/WINS,
even if nothing was added. This change fixes this by improving
check "has DNS/WINS been pushed?".

While on it, convert do_XXX_service() functions to "void" from "bool",
since we never check their return values.

Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Signed-off-by: Lev Stipakov 
---
M src/openvpn/tun.c
1 file changed, 13 insertions(+), 23 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/82/482/1

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index f1b8699..9104d46 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -147,17 +147,16 @@
 return ret;
 }

-static bool
+static void
 do_dns_domain_service(bool add, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;

 if (!tt->options.domain) /* no  domain to add or delete */
 {
-return true;
+goto out;
 }

 /* Use dns_cfg_msg with addr_len = 0 for setting only the DOMAIN */
@@ -195,17 +194,14 @@
 }

 msg(M_INFO, "DNS domain %s using service", (add ? "set" : "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

-static bool
+static void
 do_dns_service(bool add, const short family, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;
@@ -213,9 +209,11 @@
 int addr_len = add ? len : 0;
 const char *ip_proto_name = family == AF_INET6 ? "IPv6" : "IPv4";

-if (addr_len == 0 && add) /* no addresses to add */
+if (((family == AF_INET6) && (tt->options.dns6_len == 0))
+|| ((family == AF_INET) && (tt->options.dns_len == 0)))
 {
-return true;
+/* nothing to do */
+goto out;
 }

 /* Use dns_cfg_msg with domain = "" for setting only the DNS servers */
@@ -272,26 +270,23 @@
 }

 msg(M_INFO, "%s dns servers %s using service", ip_proto_name, (add ? "set" 
: "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

-static bool
+static void
 do_wins_service(bool add, const struct tuntap *tt)
 {
-bool ret = false;
 ack_message_t ack;
 struct gc_arena gc = gc_new();
 HANDLE pipe = tt->options.msg_channel;
-int len = tt->options.wins_len;
-int addr_len = add ? len : 0;
+int addr_len = add ? tt->options.wins_len : 0;

-if (addr_len == 0 && add) /* no addresses to add */
+if (tt->options.wins_len == 0)
 {
-return true;
+/* nothing to do */
+goto out;
 }

 wins_cfg_message_t wins = {
@@ -338,11 +333,9 @@
 }

 msg(M_INFO, "WINS servers %s using service", (add ? "set" : "deleted"));
-ret = true;

 out:
 gc_free();
-return ret;
 }

 static bool
@@ -7019,10 +7012,7 @@
 {
 do_dns_domain_service(false, tt);
 }
-if (tt->options.dns6_len > 0)
-{
-do_dns_service(false, AF_INET6, tt);
-}
+do_dns_service(false, AF_INET6, tt);
 delete_route_connected_v6_net(tt);
 do_address_service(false, AF_INET6, tt);
 }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/482?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I21a36d24f8e213c780f55acbe3e4df555c93542a
Gerrit-Change-Number: 482
Gerrit-PatchSet: 1
Gerrit-Owner: stipa 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: flichtenheld 
Gerrit-MessageType: newchange
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel