luci-base: handle default protocol for UCI interfaces
authorErik Karlsson <erik.karlsson@iopsys.eu>
Wed, 8 Jan 2025 11:22:44 +0000 (12:22 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Wed, 22 Jan 2025 14:49:14 +0000 (15:49 +0100)
The protocol defaults to 'none' in netifd if unspecified.

Signed-off-by: Erik Karlsson <erik.karlsson@iopsys.eu>
modules/luci-base/htdocs/luci-static/resources/network.js

index d71aa69fa361436d6018c708c1aff68cc559b915..394dffc3f535900e62c15eeac3f475500700bda0 100644 (file)
@@ -1655,7 +1655,7 @@ Network = baseclass.extend(/** @lends LuCI.network.prototype */ {
                if (name == null)
                        return null;
 
-               proto = (proto == null ? uci.get('network', name, 'proto') : proto);
+               proto = (proto == null ? (uci.get('network', name, 'proto') || 'none') : proto);
 
                var protoClass = _protocols[proto] || Protocol;
                return new protoClass(name);