OSDN Git Service

netfilter: nft_meta: support for time matching
authorAnder Juaristi <a@juaristi.eus>
Sat, 17 Aug 2019 11:17:53 +0000 (13:17 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 26 Aug 2019 09:03:14 +0000 (11:03 +0200)
commit63d10e12b00dfc8d8387bea9eaab376881335731
tree4205baa292347446edf203c8b5b79a7a3218c665
parenta1b840adafcbdc27da2982e7305c342204b8cfd8
netfilter: nft_meta: support for time matching

This patch introduces meta matches in the kernel for time (a UNIX timestamp),
day (a day of week, represented as an integer between 0-6), and
hour (an hour in the current day, or: number of seconds since midnight).

All values are taken as unsigned 64-bit integers.

The 'time' keyword is internally converted to nanoseconds by nft in
userspace, and hence the timestamp is taken in nanoseconds as well.

Signed-off-by: Ander Juaristi <a@juaristi.eus>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/netfilter/nf_tables.h
net/netfilter/nft_meta.c