From: "cron2 (Code Review)" Date: Tue, 24 Sep 2024 13:12:57 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <8a650f0595d016a9d4a2b1631c9832219ea8f550-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="fPEaicx8oag="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Use print_tun_backend_driver instead of custom code to print type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --fPEaicx8oag= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#12) to the change originally created b= y plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/749?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Use print_tun_backend_driver instead of custom code to prin= t type ...................................................................... Use print_tun_backend_driver instead of custom code to print type Also show the device type that we opened always instead of certain conditions only. Change-Id: Ib8f12516dbe294e21d3fed77478fb7660d4600c1 Signed-off-by: Arne Schwabe Acked-by: Gert Doering Message-Id: <20240924125513.10710-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29= 386.html Signed-off-by: Gert Doering --- M src/openvpn/init.c M src/openvpn/tun.c M src/openvpn/tun.h 3 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/49/749/12 diff --git a/src/openvpn/init.c b/src/openvpn/init.c index fbf2c5b..cd9203a 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1876,6 +1876,7 @@ open_tun(c->options.dev, c->options.dev_type, c->options.dev_node, tt, &c->net_ctx); } + msg(M_INFO, "%s device [%s] opened", print_tun_backend_driver(tt->back= end_driver), tt->actual_name); } =20 @@ -2056,7 +2057,7 @@ do_close_tun_simple(struct context *c) { msg(D_CLOSE, "Closing %s interface", - dco_enabled(&c->options) ? "DCO" : "TUN/TAP"); + print_tun_backend_driver(c->c1.tuntap->backend_driver)); if (c->c1.tuntap) { diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 770e806..206ddc0 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6678,7 +6678,6 @@ * GUID using the registry */ tt->actual_name =3D string_alloc((const char *)actual_buffer, NULL); - msg(M_INFO, "%s device [%s] opened", print_tun_backend_driver(tt->back= end_driver), tt->actual_name); tt->adapter_index =3D get_adapter_index(*device_guid); } diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index b2c1b01..329cd10 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -361,6 +361,12 @@ void warn_on_use_of_common_subnets(openvpn_net_ctx_t *ctx); +/** + * Return a string representation of the tun backed driver type + */ +const char * +print_tun_backend_driver(enum tun_driver_type driver); + /* * Should ifconfig be called before or after * tun dev open? @@ -689,9 +695,6 @@ return tuntap_is_dco_win(tt) && (status < 0) && (openvpn_errno() =3D= =3D ERROR_NETNAME_DELETED); } -const char * -print_tun_backend_driver(enum tun_driver_type driver); - #else /* ifdef _WIN32 */ static inline bool -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/749?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: Ib8f12516dbe294e21d3fed77478fb7660d4600c1 Gerrit-Change-Number: 749 Gerrit-PatchSet: 12 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --fPEaicx8oag= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #12 to the change originally c= reated by plaisthos.

View Change

The following approvals got outdate= d and were removed: Code-Review+2 by cron2

Use print_tun_backend_driver instead of custom code =
to print type

Also show the device type that we opened always instea= d of certain
conditions only.

Change-Id: Ib8f12516dbe294e21d3fed7= 7478fb7660d4600c1
Signed-off-by: Arne Schwabe <arne@...1227...>Acked-by: Gert Doering <gert@...1296...>
Message-Id: <20240924= 125513.10710-1-gert@...1296...>
URL: https://www.mail-archive.com/ope= nvpn-devel@lists.sourceforge.net/msg29386.html
Signed-off-by: Gert Doeri= ng <gert@...1296...>
---
M src/openvpn/init.c
M src/openvpn/= tun.c
M src/openvpn/tun.h
3 files changed, 8 insertions(+), 5 deletio= ns(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/change=
s/49/749/12
diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index fbf2c5b..cd9203a 100644
--- a/src/openv= pn/init.c
+++ b/src/openvpn/init.c
@@ -1876= ,6 +1876,7 @@
open_tun(c->options.dev, c->op= tions.dev_type, c->options.dev_node,
t= t, &c->net_ctx);
}
+ msg(M_INFO, "%s device [%s] opened"= ;, print_tun_backend_driver(tt->backend_driver), tt->actual_name);
}


@@ -20= 56,7 +2057,7 @@
do_close_tun_simple(struct context *c)
{
msg(D_CLOSE, "Closing %s interfac= e",
- dco_e= nabled(&c->options) ? "DCO" : "TUN/TAP");=
+ print_tun_backend_= driver(c->c1.tuntap->backend_driver));

if (c->c1.tuntap)

{
diff -= -git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 770e806.= .206ddc0 100644
--- a/src/openvpn/tun.c
+++= b/src/openvpn/tun.c
@@ -6678,7 +6678,6 @@
= * GUID using the registry */
tt->actual_name = =3D string_alloc((const char *)actual_buffer, NULL);

- msg(M_INFO, "%s d= evice [%s] opened", print_tun_backend_driver(tt->backend_driver), t= t->actual_name);
tt->adapter_index =3D get_adapt= er_index(*device_guid);
}

diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h

index = b2c1b01..329cd10 100644
--- a/src/openvpn/tun.h
<= span>+++ b/src/openvpn/tun.h

@@ -361,6 +361,12 @@
void warn_on_use_of_common_subnets(openvpn_net_ct= x_t *ctx);

+/**
+ * Retu= rn a string representation of the tun backed driver type
+ */
+const char *
+print_tun_backend_driver(enum tun_driver_type driver);=
+
/*
* Should ifconfig be called before or after
= * tun dev open?
@@ -689,9 +695,6 @@
re= turn tuntap_is_dco_win(tt) && (status < 0) && (openvpn_e= rrno() =3D=3D ERROR_NETNAME_DELETED);
}
<= /span>
-const char *-print_tun_backend_driver(enum t= un_driver_type driver);
-
#else /* ifdef _WIN32 */

<= span> static inline bool


To view, visit= change 7= 49. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ib8f12516dbe294e21d3fed77478= fb7660d4600c1
Gerrit-Change-Number: 749
Gerrit-PatchSet: 12
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--fPEaicx8oag=--