luci-app-openvpn: add missing proto param for ipv6 3179/head
authorFlorian Eckert <fe@dev.tdt.de>
Mon, 14 Oct 2019 08:44:25 +0000 (10:44 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Mon, 14 Oct 2019 08:44:25 +0000 (10:44 +0200)
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua

index 86a76d5c8da85d73b62ce0340646856f17de4e97..54f082a1fa45e34d619b0d4a7c430705df835796 100644 (file)
@@ -47,10 +47,6 @@ local basicParams = {
                "keepalive",
                "10 60",
                translate("Helper directive to simplify the expression of --ping and --ping-restart in server mode configurations") },
-       { ListValue,
-               "proto",
-               { "udp", "tcp-client", "tcp-server" },
-               translate("Use protocol") },
        { Flag,
                "client",
                0,
@@ -93,6 +89,20 @@ local basicParams = {
                translate("Local private key") },
 }
 
+local has_ipv6 = fs.access("/proc/net/ipv6_route")
+if has_ipv6 then
+       table.insert( basicParams, { ListValue,
+               "proto",
+               { "udp", "tcp-client", "tcp-server", "udp6", "tcp6-client", "tcp6-server" },
+               translate("Use protocol")
+       })
+else
+       table.insert( basicParams, { ListValue,
+               "proto",
+               { "udp", "tcp-client", "tcp-server" },
+               translate("Use protocol")
+       })
+end
 
 local m = Map("openvpn")
 m.redirect = luci.dispatcher.build_url("admin", "vpn", "openvpn")