Files
packages/net/alfred
Josef SchlehoferandClaude Fable 5 2312f86f7e alfred: handle unreadable files in bat-hosts.lua
get_interface_address() calls io.open() and dereferences the result
without checking it. /sys/class/net does not contain interfaces
only: with the bonding module loaded it also holds the plain file
bonding_masters, which the `ls -1` in get_interfaces_names() returns
and which has no address below it. io.open() then returns nil and
the script dies with "attempt to index a nil value", so no bat-hosts
data is published at all on such a node.

Return nil when the file cannot be opened and skip those entries in
the caller, which would otherwise index the interface table with
nil. get_hostname() gets the same guard.

Reported-by: openwrt-ai[bot]
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-18 08:39:34 +02:00
..
…
…