mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 07:58:00 +02:00
nm-import-openvpn: improve importing 'comp-lzo' option
https://bugzilla.gnome.org/show_bug.cgi?id=769177 https://bugzilla.redhat.com/show_bug.cgi?id=1355688 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833166 https://git.gnome.org/browse/network-manager-openvpn/commit/?id=62bdd278d69cc396479af9d05a0b776d5ad386bf
This commit is contained in:
parent
e58cfa4fc1
commit
bc446c3ab8
1 changed files with 11 additions and 1 deletions
|
|
@ -143,6 +143,16 @@ function handle_proto(t, option, value)
|
||||||
t[option] = "yes"
|
t[option] = "yes"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function handle_comp_lzo(t, option, value)
|
||||||
|
value[2] = value[2] or "adaptive"
|
||||||
|
if value[2] == "no" then
|
||||||
|
value[2] = "no-by-default"
|
||||||
|
elseif value[2] ~= "yes" and value[2] ~= "adaptive" then
|
||||||
|
io.stderr:write(string.format("Warning: ignoring invalid argument '%s' in option 'comp-lzo'\n", value[2]))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
t[option] = value[2]
|
||||||
|
end
|
||||||
--[[
|
--[[
|
||||||
function handle_dev_old(t, option, value)
|
function handle_dev_old(t, option, value)
|
||||||
if not value[2] then io.stderr:write(string.format("Warning: ignoring invalid option '%s'\n", value[1])) end
|
if not value[2] then io.stderr:write(string.format("Warning: ignoring invalid option '%s'\n", value[1])) end
|
||||||
|
|
@ -271,7 +281,7 @@ vpn2nm = {
|
||||||
["keysize"] = { nm_opt="keysize", func=handle_generic, tbl=g_vpn_data },
|
["keysize"] = { nm_opt="keysize", func=handle_generic, tbl=g_vpn_data },
|
||||||
["keepalive"] = { nm_opt={"ping", "ping-restart"}, func=handle_keepalive, tbl=g_vpn_data },
|
["keepalive"] = { nm_opt={"ping", "ping-restart"}, func=handle_keepalive, tbl=g_vpn_data },
|
||||||
["client"] = { nm_opt="client", func=set_bool, tbl={} },
|
["client"] = { nm_opt="client", func=set_bool, tbl={} },
|
||||||
["comp-lzo"] = { nm_opt="comp-lzo", func=handle_yes, tbl=g_vpn_data },
|
["comp-lzo"] = { nm_opt="comp-lzo", func=handle_comp_lzo, tbl=g_vpn_data },
|
||||||
["float"] = { nm_opt="float", func=handle_yes, tbl=g_vpn_data },
|
["float"] = { nm_opt="float", func=handle_yes, tbl=g_vpn_data },
|
||||||
-- ["dev"] = { nm_opt="tap-dev", func=handle_dev_old },
|
-- ["dev"] = { nm_opt="tap-dev", func=handle_dev_old },
|
||||||
["dev"] = { nm_opt="dev", func=handle_generic, tbl=g_vpn_data },
|
["dev"] = { nm_opt="dev", func=handle_generic, tbl=g_vpn_data },
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue