From 86f32c944d39dc812c19ad0ed27f1cb728d13f2d Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 3 Jun 2025 12:40:38 +0200 Subject: [PATCH] ovpnmain.cgi: Tell the server the subnet in the old-fashioned way Signed-off-by: Michael Tremer --- html/cgi-bin/ovpnmain.cgi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index a7bc0c02a..fd3e38e84 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -240,8 +240,10 @@ sub writeserverconf { print CONF "# Topology\n"; print CONF "topology subnet\n\n"; - my @tempovpnsubnet = split("\/",$vpnsettings{'DOVPN_SUBNET'}); - print CONF "server $tempovpnsubnet[0] $tempovpnsubnet[1]\n"; + my $netaddress = &Network::get_netaddress($vpnsettings{'DOVPN_SUBNET'}); + my $subnetmask = &Network::get_netmask($vpnsettings{'DOVPN_SUBNET'}); + + print CONF "server $netaddress $subnetmask\n"; print CONF "tun-mtu $vpnsettings{'DMTU'}\n"; # Write custom routes -- 2.39.5