Re: How to get system localtime/wall time from eBPF?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: How to get system localtime/wall time from eBPF?
- From: Jesper Dangaard Brouer <jbrouer@xxxxxxxxxx>
- Date: Mon, 20 Mar 2023 18:15:26 +0100
- In-reply-to: <CAK3+h2xYCBmP-0=uDUm1uKgfP8-v3KtG8Sy7Y0YR2x1gitHZrQ@mail.gmail.com>
- References: <CAK3+h2xYCBmP-0=uDUm1uKgfP8-v3KtG8Sy7Y0YR2x1gitHZrQ@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0
On 20/03/2023 16.33, Vincent Li wrote:
if I have a XDP based firewall to block ip access based on system
localtime/wall time, is it still impossible like what mentioned here
https://github.com/xdp-project/xdp-tutorial/issues/204#issuecomment-819419800?
If so, is there any way to workaround this?
You could use the BPF-helper named: bpf_ktime_get_tai_ns()
See man clock_gettime(2). It is the same as CLOCK_TAI, which is
(currently) offset with 37 sec to CLOCK_REALTIME which is wall-clock.
Perhaps kernel should be extended with a bpf_ktime_get_wall_ns() ?
--Jesper
[Index of Archives]
[Linux Networking Development]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite Campsites]