On Tue, Jan 14, 2025 at 05:15:41PM +0100, Sven Eckelmann wrote:
On Monday, 13 January 2025 20:31:39 CET Linus Lüssing wrote:
hard_iface = batadv_netlink_get_hardif(bat_priv, cb);
if (IS_ERR(hard_iface) && PTR_ERR(hard_iface) != -ENONET) {
ret = PTR_ERR(hard_iface);
goto out_put_primary_if;
} else if (IS_ERR(hard_iface)) {
/* => PTR_ERR(hard_iface) == -ENOENT
No, this would mean that the error is "ENONET" (Machine is not on the network) and not ENOENT (No such file or directory). Is this a typo in the comment or did you actually wanted to use ENOENT in the rest of the code?
I wanted to use some less common error code, to reduce the risk that some future additions to batadv_netlink_get_hardif() might accidentally reuse this "soft error" case code for a real error case.
But in v8 seems like I forgot about that intention and then misread the ENONET as ENOENT :-). Leading to this typo. v9 should correct this.
Regards, Linus