From: Felix Fietkau Date: Thu, 16 Jul 2026 18:07:21 +0000 (+0200) Subject: ucode-mod-bpf: fix error reporting in tc hook setup X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=acc687da84c5177bcf46d3757cb97243ab3c91c0;p=thirdparty%2Fopenwrt.git ucode-mod-bpf: fix error reporting in tc hook setup Failures in the detach path returned NULL without recording any error state, so error() reported a stale or empty error. Attach failures reported a hardcoded ENOENT regardless of the actual cause. Record errno for all failures; if_nametoindex, bpf_tc_attach and bpf_tc_detach all set it. Signed-off-by: Felix Fietkau --- diff --git a/package/utils/ucode-mod-bpf/src/bpf.c b/package/utils/ucode-mod-bpf/src/bpf.c index 45cd7114dd2..dba4ad8b999 100644 --- a/package/utils/ucode-mod-bpf/src/bpf.c +++ b/package/utils/ucode-mod-bpf/src/bpf.c @@ -680,9 +680,7 @@ out: return TRUE; error: - if (fd >= 0) - err_return(ENOENT, NULL); - return NULL; + err_return(errno, NULL); } static uc_value_t *