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 <nbd@nbd.name>
This commit is contained in:
@@ -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 *
|
||||
|
||||
Reference in New Issue
Block a user