From: Yu Watanabe Date: Wed, 1 Dec 2021 12:07:22 +0000 (+0900) Subject: core/bpf-firewall: make bpf_firewall_supported() always set unsupported reason when... X-Git-Tag: v250-rc1~97^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F21591%2Fhead;p=thirdparty%2Fsystemd.git core/bpf-firewall: make bpf_firewall_supported() always set unsupported reason when BPF_FIREWALL_UNSUPPORTED is returned Otherwise, log_unit_full_errno() in emit_bpf_firewall_warning() will trigger an assertion. --- diff --git a/src/core/bpf-firewall.c b/src/core/bpf-firewall.c index 2c202f1ea60..2d154710e02 100644 --- a/src/core/bpf-firewall.c +++ b/src/core/bpf-firewall.c @@ -872,7 +872,10 @@ int bpf_firewall_supported(void) { /* YAY! */ } else { - log_debug("Wut? Kernel accepted our invalid BPF_PROG_DETACH call? Something is weird, assuming BPF firewalling is broken and hence not supported."); + bpf_firewall_unsupported_reason = + log_debug_errno(SYNTHETIC_ERRNO(EBADE), + "Wut? Kernel accepted our invalid BPF_PROG_DETACH call? " + "Something is weird, assuming BPF firewalling is broken and hence not supported."); return supported = BPF_FIREWALL_UNSUPPORTED; } @@ -900,7 +903,10 @@ int bpf_firewall_supported(void) { return supported = BPF_FIREWALL_SUPPORTED; } else { - log_debug("Wut? Kernel accepted our invalid BPF_PROG_ATTACH+BPF_F_ALLOW_MULTI call? Something is weird, assuming BPF firewalling is broken and hence not supported."); + bpf_firewall_unsupported_reason = + log_debug_errno(SYNTHETIC_ERRNO(EBADE), + "Wut? Kernel accepted our invalid BPF_PROG_ATTACH+BPF_F_ALLOW_MULTI call? " + "Something is weird, assuming BPF firewalling is broken and hence not supported."); return supported = BPF_FIREWALL_UNSUPPORTED; } }