From 2342efed279658867afdb9d4f804c0d9f1d0813c Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Sat, 10 Mar 2018 06:16:17 +0100 Subject: [PATCH] bpf_sock_filter: use print_xlat32 We can't simply use print_xlat here due to the way those SKF_*_OFF constants are defined. * bpf_sock_filter.c (print_sock_filter_k): Use print_xlat32 for printing SKF_AD_OFF, SKF_NET_OFF, and SKF_LL_OFF named constants. --- bpf_sock_filter.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bpf_sock_filter.c b/bpf_sock_filter.c index 7f8e16a8..599141e2 100644 --- a/bpf_sock_filter.c +++ b/bpf_sock_filter.c @@ -39,17 +39,18 @@ print_sock_filter_k(const struct bpf_filter_block *const fp) { if (BPF_CLASS(fp->code) == BPF_LD && BPF_MODE(fp->code) == BPF_ABS) { if (fp->k >= (unsigned int) SKF_AD_OFF) { - tprints("SKF_AD_OFF+"); + print_xlat32(SKF_AD_OFF); + tprints("+"); printxval(skf_ad, fp->k - (unsigned int) SKF_AD_OFF, "SKF_AD_???"); return true; } else if (fp->k >= (unsigned int) SKF_NET_OFF) { - tprintf("%s+%u", "SKF_NET_OFF", - fp->k - (unsigned int) SKF_NET_OFF); + print_xlat32(SKF_NET_OFF); + tprintf("+%u", fp->k - (unsigned int) SKF_NET_OFF); return true; } else if (fp->k >= (unsigned int) SKF_LL_OFF) { - tprintf("%s+%u", "SKF_LL_OFF", - fp->k - (unsigned int) SKF_LL_OFF); + print_xlat32(SKF_LL_OFF); + tprintf("+%u", fp->k - (unsigned int) SKF_LL_OFF); return true; } } -- 2.40.0