[Openvpn-devel] [L] Change in openvpn[master]: PUSH_UPDATE message sender: enabling the server to send PUSH_UPDATE c...

2025-08-18 Thread mrbff (Code Review)
Attention is currently required from: flichtenheld, mrbff, plaisthos, stipa.

Hello cron2, flichtenheld, plaisthos, stipa,

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

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

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


Change subject: PUSH_UPDATE message sender: enabling the server to send 
PUSH_UPDATE control messages
..

PUSH_UPDATE message sender: enabling the server to send PUSH_UPDATE control 
messages

Using the management interface you can now target one or more clients (via 
broadcast
or via cid) and send a PUSH_UPDATE control message
to update some options.

Change-Id: Ie82bcc7a8e583de9156b185d71d1a323ed8df3fc
Signed-off-by: Marco Baffo 
---
M CMakeLists.txt
M doc/management-notes.txt
M src/openvpn/manage.c
M src/openvpn/manage.h
M src/openvpn/multi.c
M src/openvpn/multi.h
M src/openvpn/push.h
M src/openvpn/push_util.c
M tests/unit_tests/openvpn/Makefile.am
M tests/unit_tests/openvpn/test_push_update_msg.c
10 files changed, 712 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/869/24

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3866e21..97f0310 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -862,6 +862,7 @@
src/openvpn/push_util.c
src/openvpn/options_util.c
src/openvpn/otime.c
+src/openvpn/list.c
 )

 if (TARGET test_argv)
diff --git a/doc/management-notes.txt b/doc/management-notes.txt
index f1d2930..ada536e 100644
--- a/doc/management-notes.txt
+++ b/doc/management-notes.txt
@@ -1028,6 +1028,35 @@
 stored outside of the filesystem (e.g. in Mac OS X Keychain)
 with OpenVPN via the management interface.

+COMMAND -- push-update-broad (OpenVPN 2.7 or higher)
+
+Send a message to every connected client to update options at runtime.
+The updatable options are: "block-ipv6", "block-outside-dns", "dhcp-option",
+"dns", "ifconfig", "ifconfig-ipv6", "redirect-gateway", "redirect-private",
+"route", "route-gateway", "route-ipv6", "route-metric", "topology",
+"tun-mtu", "keepalive". When a valid option is pushed, the receiving client 
will
+delete every previous value and set new value, so the update of the option will
+not be incremental even when theoretically possible (ex. with 
"redirect-gateway").
+The '-' symbol in front of an option means the option should be removed.
+When an option is used with '-', it cannot take any parameter.
+The '?' symbol in front of an option means the option's update is optional
+so if the client do not support it, that option will just be ignored without
+making fail the entire command. The '-' and '?' symbols can be used together.
+
+Option Format Ex.
+  `-?option`, `-option`, `?option parameters` are valid formats,
+  `?-option` is not a valid format.
+
+Example
+  push-update-broad "route 10.10.10.1 255.255.255.255, -dns, ?tun-mtu 1400"
+
+COMMAND -- push-update-cid (OpenVPN 2.7 or higher)
+
+Same as push-update-broad but you must target a single client using client id.
+
+Example
+  push-update-cid 42 "route 10.10.10.1 255.255.255.255, -dns, ?tun-mtu 1400"
+
 OUTPUT FORMAT
 -

diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index aed04f5..21231b5 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -23,7 +23,6 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-
 #include "syshead.h"

 #ifdef ENABLE_MANAGEMENT
@@ -41,6 +40,7 @@
 #include "manage.h"
 #include "openvpn.h"
 #include "dco.h"
+#include "push.h"

 #include "memdbg.h"

@@ -131,8 +131,10 @@
 msg(M_CLIENT, "test n : Produce n lines of output for 
testing/debugging.");
 msg(M_CLIENT, "username type u: Enter username u for a queried 
OpenVPN username.");
 msg(M_CLIENT, "verb [n]   : Set log verbosity level to n, or 
show if n is absent.");
-msg(M_CLIENT,
-"version [n]: Set client's version to n or show current 
version of daemon.");
+msg(M_CLIENT, "version [n]: Set client's version to n or show 
current version of daemon.");
+msg(M_CLIENT, "push-update-broad options : Broadcast a message to update 
the specified options.");
+msg(M_CLIENT, "Ex. push-update-broad \"route 
something, -dns\"");
+msg(M_CLIENT, "push-update-cid CID options : Send an update message to the 
client identified by CID.");
 msg(M_CLIENT, "END");
 }

@@ -1306,6 +1308,48 @@
 }

 static void
+man_push_update(struct management *man, const char **p, const push_update_type 
type)
+{
+bool status = false;
+
+if (type == UPT_BROADCAST)
+{
+if (!man->persist.callback.push_update_broadcast)
+{
+man_command_unsupported("push-update-broad");
+return;
+}
+
+status = 
(*man->persist.callback.

[Openvpn-devel] [L] Change in openvpn[master]: PUSH_UPDATE message sender: enabling the server to send PUSH_UPDATE c...

2025-08-18 Thread mrbff (Code Review)
Attention is currently required from: cron2, flichtenheld, plaisthos, stipa.

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

Change subject: PUSH_UPDATE message sender: enabling the server to send 
PUSH_UPDATE control messages
..


Patch Set 23:

(1 comment)

File src/openvpn/manage.c:

http://gerrit.openvpn.net/c/openvpn/+/869/comment/3f50d336_21e71356 :
PS23, Line 136: msg(M_CLIENT, "version [n]: Set client's 
version to n or show current version of daemon.");
> Unfortunately a rebase accident has happened here, and now this line is 
> printed twice. […]
Done



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/869?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: Ie82bcc7a8e583de9156b185d71d1a323ed8df3fc
Gerrit-Change-Number: 869
Gerrit-PatchSet: 23
Gerrit-Owner: mrbff 
Gerrit-Reviewer: cron2 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-Reviewer: stipa 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: cron2 
Gerrit-Attention: flichtenheld 
Gerrit-Attention: stipa 
Gerrit-Comment-Date: Mon, 18 Aug 2025 14:20:26 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 
Gerrit-MessageType: comment
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


Re: [Openvpn-devel] [L] Change in openvpn[master]: PUSH_UPDATE message sender: enabling the server to send PUSH_UPDATE c...

2025-08-18 Thread Lighting
「小閃電,啟動自動賺 錢!」

隨時開戰、每筆真實到帳,醒來只管數

取得 Android 版 Outlook

From: mrbff (Code Review) 
Sent: Monday, August 18, 2025 10:20:26 PM
Cc: openvpn-devel ; plaisthos 

Subject: [Openvpn-devel] [L] Change in openvpn[master]: PUSH_UPDATE message 
sender: enabling the server to send PUSH_UPDATE c...


Attention is currently required from: cron2, flichtenheld, plaisthos, stipa.

View Change

1 comment:

  *   File src/openvpn/manage.c:

 *   Patch Set #23, Line 
136: 
msg(M_CLIENT, "version [n] : Set client's version to n or show current version 
of daemon.");

Unfortunately a rebase accident has happened here, and now this line is printed 
twice. […]

Done

To view, visit change 869. 
To unsubscribe, or for help writing mail filters, visit 
settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie82bcc7a8e583de9156b185d71d1a323ed8df3fc
Gerrit-Change-Number: 869
Gerrit-PatchSet: 23
Gerrit-Owner: mrbff 
Gerrit-Reviewer: cron2 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-Reviewer: stipa 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: cron2 
Gerrit-Attention: flichtenheld 
Gerrit-Attention: stipa 
Gerrit-Comment-Date: Mon, 18 Aug 2025 14:20:26 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 
Gerrit-MessageType: comment
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH v1] dns: fix systemd dns-updown script

2025-08-18 Thread Frank Lichtenheld
From: Heiko Hund 

In the resolvconf part of the script there was one instance of a dynamic
variable using _* left. The _* ones do not work as the regular ones, but
only when you directly place them within ${!}, not indirectly using a
variable.

Convert the code to use a loop and a check, like in all the other places
in the script.

Change-Id: Id800cad0e92e0abc0d96079fdb5a9d57578e1446
Signed-off-by: Heiko Hund 
Acked-by: Frank Lichtenheld 
---

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/+/1144
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld 


diff --git a/distro/dns-scripts/systemd-dns-updown.sh 
b/distro/dns-scripts/systemd-dns-updown.sh
index 9006e28..ed3947a 100644
--- a/distro/dns-scripts/systemd-dns-updown.sh
+++ b/distro/dns-scripts/systemd-dns-updown.sh
@@ -189,11 +189,13 @@
 domains+="${!domain_var} "
 done
 {
+local i=1
 local maxns=3
-local server_var=dns_server_${n}_address_*
-for addr_var in ${!server_var}; do
-[ $((maxns--)) -gt 0 ] || break
+while [ "${i}" -le "${maxns}" ]; do
+local addr_var=dns_server_${n}_address_${i}
+[ -n "${!addr_var}" ] || break
 echo "nameserver ${!addr_var}"
+i=$((i+1))
 done
 [ -z "$domains" ] || echo "search $domains"
 } | /sbin/resolvconf -a "$dev"


___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [XS] Change in openvpn[master]: dns: fix systemd dns-updown script

2025-08-18 Thread flichtenheld (Code Review)
Attention is currently required from: d12fk, plaisthos.

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

Change subject: dns: fix systemd dns-updown script
..


Patch Set 1: Code-Review+2

(1 comment)

Patchset:

PS1:
Ran t_client tests on a resolvconf system with and without this change. Can 
confirm it resolves the issue.



--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1144?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: Id800cad0e92e0abc0d96079fdb5a9d57578e1446
Gerrit-Change-Number: 1144
Gerrit-PatchSet: 1
Gerrit-Owner: d12fk 
Gerrit-Reviewer: flichtenheld 
Gerrit-Reviewer: plaisthos 
Gerrit-CC: openvpn-devel 
Gerrit-Attention: plaisthos 
Gerrit-Attention: d12fk 
Gerrit-Comment-Date: Mon, 18 Aug 2025 16:43:33 +
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