vpnmain.cgi: Don't populate GREEN subnet when green doesn't exist
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 21 Jan 2019 14:34:19 +0000 (14:34 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Feb 2019 18:20:36 +0000 (18:20 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/vpnmain.cgi

index 0488f70..70a70a2 100644 (file)
@@ -1945,7 +1945,12 @@ END
        } else {
                $cgiparams{'AUTH'} = 'certgen';
        }
-       $cgiparams{'LOCAL_SUBNET'}              = "$netsettings{'GREEN_NETADDRESS'}/$netsettings{'GREEN_NETMASK'}";
+
+       if ($netsettings{"GREEN_NETADDRESS"} && $netsettings{"GREEN_NETMASK"}) {
+               $cgiparams{"LOCAL_SUBNET"} = $netsettings{'GREEN_NETADDRESS'} . "/" . $netsettings{'GREEN_NETMASK'};
+       } else {
+               $cgiparams{"LOCAL_SUBNET"} = "";
+       }
        $cgiparams{'CERT_EMAIL'}                = $vpnsettings{'ROOTCERT_EMAIL'};
        $cgiparams{'CERT_OU'}                   = $vpnsettings{'ROOTCERT_OU'};
        $cgiparams{'CERT_ORGANIZATION'} = $vpnsettings{'ROOTCERT_ORGANIZATION'};