[Openvpn-devel,3/4] Ensure dynamic_name is always populated

Message ID 20220429170236.48239-4-kprovost@netgate.com
State Superseded
Headers show
Series
  • [Openvpn-devel,1/4] Handle (DCO) timeouts in client mode
Related show

Commit Message

Kristof Provost via Openvpn-devel April 29, 2022, 5:02 p.m.
From: Kristof Provost <kp@FreeBSD.org>

It's always used for open_tun_dco(), so we must ensure it's populated,
even if 'dev_node' is set.

Signed-off-by: Kristof Provost <kprovost@netgate.com>
---
 src/openvpn/tun.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Antonio Quartulli May 9, 2022, 11:52 a.m. | #1
Hi,

On 29/04/2022 19:02, Kristof Provost via Openvpn-devel wrote:
> From: Kristof Provost <kp@FreeBSD.org>
> 
> It's always used for open_tun_dco(), so we must ensure it's populated,
> even if 'dev_node' is set.
> 
> Signed-off-by: Kristof Provost <kprovost@netgate.com

I squashed this change in the dco branch.
Thanks a lot!

Regards,

Patch

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 245a6507..7976ad11 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -1755,6 +1755,7 @@  open_tun_generic(const char *dev, const char *dev_type, const char *dev_node,
         if (dev_node)
         {
             openvpn_snprintf(tunname, sizeof(tunname), "%s", dev_node);
+            strncpynt(dynamic_name, dev, sizeof(dynamic_name));
         }
         else
         {