diff options
author | Martin KaFai Lau <[email protected]> | 2022-03-09 01:04:56 -0800 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2022-03-10 22:57:05 +0100 |
commit | 539de9328e3ab444efe51ddc7416ce2a3f0f23b2 (patch) | |
tree | f072bd14ec814bc1f408d924b7c138a753c215be /lib/string_helpers.c | |
parent | 3b5d4ddf8fe1f60082513f94bae586ac80188a03 (diff) |
bpf: Simplify insn rewrite on BPF_READ __sk_buff->tstamp
The skb->tc_at_ingress and skb->mono_delivery_time are at the same
byte offset. Thus, only one BPF_LDX_MEM(BPF_B) is needed
and both bits can be tested together.
/* BPF_READ: a = __sk_buff->tstamp */
if (skb->tc_at_ingress && skb->mono_delivery_time)
a = 0;
else
a = skb->tstamp;
Signed-off-by: Martin KaFai Lau <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions