diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-10-14 16:40:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-14 16:40:20 +0200 |
commit | ce348cb0d3828171fb6a743208073f5cf8ecfec2 (patch) | |
tree | f344e231e4d3693a46f0e818494e0278c0af0941 | |
parent | 3607c819cb2753b3037e91520205c787758274a2 (diff) | |
parent | 18037444b57104a0a62f6c1c16f308ee2dd81a36 (diff) |
Merge pull request #3179 from TDT-AG/pr/20191014-luci-app-openvpn
luci-app-openvpn: add missing proto param for ipv6
-rw-r--r-- | applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua index 86a76d5c8d..54f082a1fa 100644 --- a/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua +++ b/applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua @@ -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") |