From: Jo-Philipp Wich Date: Fri, 10 Nov 2017 13:20:50 +0000 (+0100) Subject: protocols: fix various interface patterns X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=932bae98738746e11d8b1b0bd9ac86009dd34452;p=project%2Fluci.git protocols: fix various interface patterns The virtual interface match patterns of various protocols were improperly quoted, causing them to over- or undermatch. Follow up of #1435. Signed-off-by: Jo-Philipp Wich --- diff --git a/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua b/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua index 5c3761c9cb..04d2e78b09 100644 --- a/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua +++ b/protocols/luci-proto-ipip/luasrc/model/network/proto_ipip.lua @@ -37,4 +37,4 @@ function proto.contains_interface(self, ifc) return (netmod:ifnameof(ifc) == self:ifname()) end -netmod:register_pattern_virtual("^ipip-%w") +netmod:register_pattern_virtual("^ipip%-%w") diff --git a/protocols/luci-proto-ipv6/luasrc/model/network/proto_6x4.lua b/protocols/luci-proto-ipv6/luasrc/model/network/proto_6x4.lua index d267ce9119..9a4396c5be 100644 --- a/protocols/luci-proto-ipv6/luasrc/model/network/proto_6x4.lua +++ b/protocols/luci-proto-ipv6/luasrc/model/network/proto_6x4.lua @@ -46,5 +46,5 @@ for _, p in ipairs({"6in4", "6to4", "6rd"}) do return (netmod:ifnameof(ifc) == self:ifname()) end - netmod:register_pattern_virtual("^%s-%%w" % p) + netmod:register_pattern_virtual("^%s%%-%%w" % p) end diff --git a/protocols/luci-proto-ipv6/luasrc/model/network/proto_aiccu.lua b/protocols/luci-proto-ipv6/luasrc/model/network/proto_aiccu.lua index 5896a278ce..e0d7fd3e21 100644 --- a/protocols/luci-proto-ipv6/luasrc/model/network/proto_aiccu.lua +++ b/protocols/luci-proto-ipv6/luasrc/model/network/proto_aiccu.lua @@ -46,4 +46,4 @@ function proto.contains_interface(self, ifname) end end -netmod:register_pattern_virtual("^aiccu-%%w") +netmod:register_pattern_virtual("^aiccu%-%w") diff --git a/protocols/luci-proto-ncm/luasrc/model/network/proto_ncm.lua b/protocols/luci-proto-ncm/luasrc/model/network/proto_ncm.lua index 6c5b34e083..4f835701ce 100644 --- a/protocols/luci-proto-ncm/luasrc/model/network/proto_ncm.lua +++ b/protocols/luci-proto-ncm/luasrc/model/network/proto_ncm.lua @@ -58,4 +58,4 @@ function proto.contains_interface(self, ifc) return (netmod:ifnameof(ifc) == self:ifname()) end -netmod:register_pattern_virtual("^ncm-%%w") +netmod:register_pattern_virtual("^ncm%-%w") diff --git a/protocols/luci-proto-openconnect/luasrc/model/network/proto_openconnect.lua b/protocols/luci-proto-openconnect/luasrc/model/network/proto_openconnect.lua index 0af77d0140..0944c7fe6a 100644 --- a/protocols/luci-proto-openconnect/luasrc/model/network/proto_openconnect.lua +++ b/protocols/luci-proto-openconnect/luasrc/model/network/proto_openconnect.lua @@ -42,4 +42,4 @@ function proto.contains_interface(self, ifc) end -netmod:register_pattern_virtual("^vpn-%w") +netmod:register_pattern_virtual("^vpn%-%w") diff --git a/protocols/luci-proto-ppp/luasrc/model/network/proto_ppp.lua b/protocols/luci-proto-ppp/luasrc/model/network/proto_ppp.lua index 7bbd78fa1e..1bcbd4808a 100644 --- a/protocols/luci-proto-ppp/luasrc/model/network/proto_ppp.lua +++ b/protocols/luci-proto-ppp/luasrc/model/network/proto_ppp.lua @@ -90,5 +90,5 @@ for _, p in ipairs({"ppp", "pptp", "pppoe", "pppoa", "3g", "l2tp", "pppossh"}) d end end - netmod:register_pattern_virtual("^%s-%%w" % p) + netmod:register_pattern_virtual("^%s%%-%%w" % p) end diff --git a/protocols/luci-proto-qmi/luasrc/model/network/proto_qmi.lua b/protocols/luci-proto-qmi/luasrc/model/network/proto_qmi.lua index cca8af109e..8a28ad4716 100644 --- a/protocols/luci-proto-qmi/luasrc/model/network/proto_qmi.lua +++ b/protocols/luci-proto-qmi/luasrc/model/network/proto_qmi.lua @@ -48,4 +48,4 @@ function proto.contains_interface(self, ifc) return (netmod:ifnameof(ifc) == self:ifname()) end -netmod:register_pattern_virtual("^qmi-%w") +netmod:register_pattern_virtual("^qmi%-%w") diff --git a/protocols/luci-proto-relay/luasrc/model/network/proto_relay.lua b/protocols/luci-proto-relay/luasrc/model/network/proto_relay.lua index 5d40fc72d5..a2dabf9afe 100644 --- a/protocols/luci-proto-relay/luasrc/model/network/proto_relay.lua +++ b/protocols/luci-proto-relay/luasrc/model/network/proto_relay.lua @@ -4,7 +4,7 @@ local netmod = luci.model.network local device = luci.util.class(netmod.interface) -netmod:register_pattern_virtual("^relay-%w") +netmod:register_pattern_virtual("^relay%-%w") local proto = netmod:register_protocol("relay") diff --git a/protocols/luci-proto-vpnc/luasrc/model/network/proto_vpnc.lua b/protocols/luci-proto-vpnc/luasrc/model/network/proto_vpnc.lua index f4cae0bd2a..6c3136e384 100644 --- a/protocols/luci-proto-vpnc/luasrc/model/network/proto_vpnc.lua +++ b/protocols/luci-proto-vpnc/luasrc/model/network/proto_vpnc.lua @@ -42,5 +42,5 @@ function proto.contains_interface(self, ifc) end -netmod:register_pattern_virtual("^vpn-%w") +netmod:register_pattern_virtual("^vpn%-%w")