luci-proto-relay: propagate up state, do not forward netifd errors
Due to historical reasons, the relayd daemon configuration resides in the form of a fake "config interface" section in /etc/config/network without actually registering a protocol handler. This causes netifd to emit an "INVALID_PROTO" error for the interface which is technically correct, but confusing for LuCI users. This situation needs to be resolved upstream by either moving relayd configuration out of the network config, or by converting the relayd service into a proper protocol handler. Until this happens, do not report any netifd errors since we're not operating on an actual interface. While we're at it, also propagate the protocol up state from the fake virtual device to ensure that LuCI displays the relay bridge as "up" when all relayed interfaces are up as well. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
350be23eb9
commit
aae187dedf
1 changed files with 9 additions and 0 deletions
|
@ -32,6 +32,11 @@ function proto.is_virtual(self)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function proto.is_up(self)
|
||||||
|
local iface = self:get_interface()
|
||||||
|
return iface and iface:is_up() or false
|
||||||
|
end
|
||||||
|
|
||||||
function proto.get_interface(self)
|
function proto.get_interface(self)
|
||||||
return device(self.sid, self)
|
return device(self.sid, self)
|
||||||
end
|
end
|
||||||
|
@ -80,6 +85,10 @@ function proto.uptime(self)
|
||||||
return upt
|
return upt
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function proto.errors(self)
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function device.__init__(self, ifname, network)
|
function device.__init__(self, ifname, network)
|
||||||
self.ifname = ifname
|
self.ifname = ifname
|
||||||
|
|
Loading…
Reference in a new issue