From acc687da84c5177bcf46d3757cb97243ab3c91c0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 16 Jul 2026 20:07:21 +0200 Subject: [PATCH] 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 --- package/utils/ucode-mod-bpf/src/bpf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 *