On 10/11/24 9:06 PM, Jason Xing wrote:
+static int bpf_sock_set_timestamping(struct sock *sk, + struct so_timestamping *timestamping) +{ + u32 flags = timestamping->flags; + + if (flags & ~SOF_TIMESTAMPING_MASK) + return -EINVAL; + + if (!(flags & (SOF_TIMESTAMPING_TX_SCHED | SOF_TIMESTAMPING_TX_SOFTWARE | + SOF_TIMESTAMPING_TX_ACK)))
hmm... Does it mean at least one of the bit must be set and cannot be completely cleared once it has been set before?
+ return -EINVAL; + + WRITE_ONCE(sk->sk_tsflags[BPFPROG_TS_REQUESTOR], flags); + + return 0; +}