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.
This commit is contained in:
parent
f21f7033f9
commit
2342efed27
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user