Skip to content

Commit

Permalink
luci-mod-network: remove old netifd version check which needs opkg
Browse files Browse the repository at this point in the history
master and 24 use much newer versions.

This will prevent a read error on the non-existent control file when
the system uses apk.

Signed-off-by: Paul Donald <[email protected]>
  • Loading branch information
systemcrash committed Dec 15, 2024
1 parent 367b67f commit e23f606
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ return view.extend({
network.getDSLModemType(),
network.getDevices(),
fs.lines('/etc/iproute2/rt_tables'),
L.resolveDefault(fs.read('/usr/lib/opkg/info/netifd.control')),
uci.changes()
]);
},
Expand Down Expand Up @@ -424,14 +423,11 @@ return view.extend({
},

render: function(data) {
var netifdVersion = (data[3] || '').match(/Version: ([^\n]+)/);

if (netifdVersion && netifdVersion[1] >= "2021-05-26") {
if (this.interfaceBridgeWithIfnameSections().length)
return this.renderBridgeMigration();
else if (this.deviceWithIfnameSections().length || this.interfaceWithIfnameSections().length)
return this.renderIfnameMigration();
}
if (this.interfaceBridgeWithIfnameSections().length)
return this.renderBridgeMigration();
else if (this.deviceWithIfnameSections().length || this.interfaceWithIfnameSections().length)
return this.renderIfnameMigration();

var dslModemType = data[0],
netDevs = data[1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"/proc/sys/net/ipv6/conf/*/mtu": [ "read" ],
"/proc/sys/net/ipv6/conf/*/hop_limit": [ "read" ],
"/usr/libexec/luci-peeraddr": [ "exec" ],
"/usr/lib/opkg/info/netifd.control": [ "read" ],
"/proc/sys/net/ipv[46]/conf/*": [ "read" ],
"/sys/class/net/*/brport/*": [ "read" ]
},
Expand Down

0 comments on commit e23f606

Please sign in to comment.