netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] netfilter: nft_meta: support for time matching
@ 2019-08-02  7:12 Ander Juaristi
  2019-08-02  7:36 ` Ander Juaristi
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Ander Juaristi @ 2019-08-02  7:12 UTC (permalink / raw)
  To: netfilter-devel

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.

This patch also introduces a new function, nft_reg_store64, to store
64-bit values in the register for comparison.

Signed-off-by: Ander Juaristi <a@juaristi.eus>
---
 include/net/netfilter/nf_tables.h        |  6 ++++
 include/uapi/linux/netfilter/nf_tables.h |  8 +++--
 net/netfilter/nft_meta.c                 | 39 ++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 9b624566b82d..f635b9c2e221 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -2,6 +2,7 @@
 #ifndef _NET_NF_TABLES_H
 #define _NET_NF_TABLES_H
 
+#include <asm/unaligned.h>
 #include <linux/list.h>
 #include <linux/netfilter.h>
 #include <linux/netfilter/nfnetlink.h>
@@ -119,6 +120,11 @@ static inline void nft_reg_store8(u32 *dreg, u8 val)
 	*(u8 *)dreg = val;
 }
 
+static inline void nft_reg_store64(u64 *dreg, u64 val)
+{
+	put_unaligned(val, dreg);
+}
+
 static inline u16 nft_reg_load16(u32 *sreg)
 {
 	return *(u16 *)sreg;
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index 82abaa183fc3..6d9dd120b466 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -799,6 +799,9 @@ enum nft_exthdr_attributes {
  * @NFT_META_OIFKIND: packet output interface kind name (dev->rtnl_link_ops->kind)
  * @NFT_META_BRI_IIFPVID: packet input bridge port pvid
  * @NFT_META_BRI_IIFVPROTO: packet input bridge vlan proto
+ * @NFT_META_TIME: a UNIX timestamp
+ * @NFT_META_TIME_DAY: day of week
+ * @NFT_META_TIME_HOUR: hour of day
  */
 enum nft_meta_keys {
 	NFT_META_LEN,
@@ -829,8 +832,9 @@ enum nft_meta_keys {
 	NFT_META_SECPATH,
 	NFT_META_IIFKIND,
 	NFT_META_OIFKIND,
-	NFT_META_BRI_IIFPVID,
-	NFT_META_BRI_IIFVPROTO,
+	NFT_META_TIME,
+	NFT_META_TIME_DAY,
+	NFT_META_TIME_HOUR,
 };
 
 /**
diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c
index f1b1d948c07b..57ac1f9aab56 100644
--- a/net/netfilter/nft_meta.c
+++ b/net/netfilter/nft_meta.c
@@ -28,6 +28,27 @@
 
 static DEFINE_PER_CPU(struct rnd_state, nft_prandom_state);
 
+static u8 nft_meta_weekday(u64 secs)
+{
+	u8 wday;
+	unsigned int dse;
+
+	secs -= 60 * sys_tz.tz_minuteswest;
+	dse = secs / 86400;
+	wday = (4 + dse) % 7;
+
+	return ++wday % 7;
+}
+
+static u32 nft_meta_hour(u64 secs)
+{
+	struct tm tm;
+
+	time64_to_tm(secs, 0, &tm);
+
+	return tm.tm_hour * 3600 + tm.tm_min * 60 + tm.tm_sec;
+}
+
 void nft_meta_get_eval(const struct nft_expr *expr,
 		       struct nft_regs *regs,
 		       const struct nft_pktinfo *pkt)
@@ -226,6 +247,15 @@ void nft_meta_get_eval(const struct nft_expr *expr,
 			goto err;
 		strncpy((char *)dest, out->rtnl_link_ops->kind, IFNAMSIZ);
 		break;
+	case NFT_META_TIME:
+		nft_reg_store64((u64 *)dest, ktime_get_real_ns());
+		break;
+	case NFT_META_TIME_DAY:
+		nft_reg_store8(dest, nft_meta_weekday(get_seconds()));
+		break;
+	case NFT_META_TIME_HOUR:
+		*dest = nft_meta_hour(get_seconds());
+		break;
 	default:
 		WARN_ON(1);
 		goto err;
@@ -338,6 +368,15 @@ int nft_meta_get_init(const struct nft_ctx *ctx,
 		len = sizeof(u8);
 		break;
 #endif
+	case NFT_META_TIME:
+		len = sizeof(u64);
+		break;
+	case NFT_META_TIME_DAY:
+		len = sizeof(u8);
+		break;
+	case NFT_META_TIME_HOUR:
+		len = sizeof(u32);
+		break;
 	default:
 		return -EOPNOTSUPP;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] netfilter: nft_meta: support for time matching
  2019-08-02  7:12 [PATCH v3] netfilter: nft_meta: support for time matching Ander Juaristi
@ 2019-08-02  7:36 ` Ander Juaristi
  2019-08-02  9:37   ` Florian Westphal
  2019-08-07 14:04 ` kbuild test robot
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Ander Juaristi @ 2019-08-02  7:36 UTC (permalink / raw)
  To: netfilter-devel



On 2/8/19 9:12, Ander Juaristi wrote:
> diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
> index 82abaa183fc3..6d9dd120b466 100644
> --- a/include/uapi/linux/netfilter/nf_tables.h
> +++ b/include/uapi/linux/netfilter/nf_tables.h
> @@ -799,6 +799,9 @@ enum nft_exthdr_attributes {
>    * @NFT_META_OIFKIND: packet output interface kind name (dev->rtnl_link_ops->kind)
>    * @NFT_META_BRI_IIFPVID: packet input bridge port pvid
>    * @NFT_META_BRI_IIFVPROTO: packet input bridge vlan proto
> + * @NFT_META_TIME: a UNIX timestamp
> + * @NFT_META_TIME_DAY: day of week
> + * @NFT_META_TIME_HOUR: hour of day
>    */
>   enum nft_meta_keys {
>   	NFT_META_LEN,
> @@ -829,8 +832,9 @@ enum nft_meta_keys {
>   	NFT_META_SECPATH,
>   	NFT_META_IIFKIND,
>   	NFT_META_OIFKIND,
> -	NFT_META_BRI_IIFPVID,
> -	NFT_META_BRI_IIFVPROTO,

I needed to remove these two so that the next three constants take the 
correct values (otherwise it won't work because the meta keys sent by 
userspace and those expected by the kernel don't match).

Those two constants NFT_META_BRI_IIFPVID and NFT_META_BRI_IIFVPROTO 
aren't defined in nftables, I don't know why.

I leave up to you to decide how to merge this: either manually give 
NFT_META_TIME the correct value, or replicate NFT_META_BRI_IIFPVID and
NFT_META_BRI_IIFVPROTO in nftables.

> +	NFT_META_TIME,
> +	NFT_META_TIME_DAY,
> +	NFT_META_TIME_HOUR,
>   };
>   
>   /**


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] netfilter: nft_meta: support for time matching
  2019-08-02  7:36 ` Ander Juaristi
@ 2019-08-02  9:37   ` Florian Westphal
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Westphal @ 2019-08-02  9:37 UTC (permalink / raw)
  To: Ander Juaristi; +Cc: netfilter-devel

Ander Juaristi <a@juaristi.eus> wrote:
> 
> 
> On 2/8/19 9:12, Ander Juaristi wrote:
> > diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
> > index 82abaa183fc3..6d9dd120b466 100644
> > --- a/include/uapi/linux/netfilter/nf_tables.h
> > +++ b/include/uapi/linux/netfilter/nf_tables.h
> > @@ -799,6 +799,9 @@ enum nft_exthdr_attributes {
> >    * @NFT_META_OIFKIND: packet output interface kind name (dev->rtnl_link_ops->kind)
> >    * @NFT_META_BRI_IIFPVID: packet input bridge port pvid
> >    * @NFT_META_BRI_IIFVPROTO: packet input bridge vlan proto
> > + * @NFT_META_TIME: a UNIX timestamp
> > + * @NFT_META_TIME_DAY: day of week
> > + * @NFT_META_TIME_HOUR: hour of day
> >    */
> >   enum nft_meta_keys {
> >   	NFT_META_LEN,
> > @@ -829,8 +832,9 @@ enum nft_meta_keys {
> >   	NFT_META_SECPATH,
> >   	NFT_META_IIFKIND,
> >   	NFT_META_OIFKIND,
> > -	NFT_META_BRI_IIFPVID,
> > -	NFT_META_BRI_IIFVPROTO,
> 
> I needed to remove these two so that the next three constants take the
> correct values (otherwise it won't work because the meta keys sent by
> userspace and those expected by the kernel don't match).

This breaks the build.

> Those two constants NFT_META_BRI_IIFPVID and NFT_META_BRI_IIFVPROTO aren't
> defined in nftables, I don't know why.

The userspace patch has not been applied yet, only the kernel one.

You can include a pre-patch in your series that adds the enums.

"sync meta keys with kernel" or similar.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] netfilter: nft_meta: support for time matching
  2019-08-02  7:12 [PATCH v3] netfilter: nft_meta: support for time matching Ander Juaristi
  2019-08-02  7:36 ` Ander Juaristi
@ 2019-08-07 14:04 ` kbuild test robot
  2019-08-07 15:27 ` kbuild test robot
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2019-08-07 14:04 UTC (permalink / raw)
  To: Ander Juaristi; +Cc: kbuild-all, netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]

Hi Ander,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc3 next-20190807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ander-Juaristi/netfilter-nft_meta-support-for-time-matching/20190804-141253
config: m68k-defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> ERROR: "__udivdi3" [net/netfilter/nf_tables.ko] undefined!

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 14845 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] netfilter: nft_meta: support for time matching
  2019-08-02  7:12 [PATCH v3] netfilter: nft_meta: support for time matching Ander Juaristi
  2019-08-02  7:36 ` Ander Juaristi
  2019-08-07 14:04 ` kbuild test robot
@ 2019-08-07 15:27 ` kbuild test robot
  2019-08-07 17:14 ` kbuild test robot
  2019-08-09 11:49 ` Pablo Neira Ayuso
  4 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2019-08-07 15:27 UTC (permalink / raw)
  To: Ander Juaristi; +Cc: kbuild-all, netfilter-devel

Hi Ander,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc3 next-20190807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ander-Juaristi/netfilter-nft_meta-support-for-time-matching/20190804-141253
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-rc1-7-g2b96cd8-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

   include/linux/sched.h:609:43: sparse: sparse: bad integer constant expression
   include/linux/sched.h:609:73: sparse: sparse: invalid named zero-width bitfield `value'
   include/linux/sched.h:610:43: sparse: sparse: bad integer constant expression
   include/linux/sched.h:610:67: sparse: sparse: invalid named zero-width bitfield `bucket_id'
   net/bridge/netfilter/nft_meta_bridge.c:41:14: sparse: sparse: undefined identifier 'NFT_META_BRI_IIFPVID'
   net/bridge/netfilter/nft_meta_bridge.c:52:14: sparse: sparse: undefined identifier 'NFT_META_BRI_IIFVPROTO'
>> net/bridge/netfilter/nft_meta_bridge.c:41:14: sparse: sparse: incompatible types for 'case' statement
   net/bridge/netfilter/nft_meta_bridge.c:52:14: sparse: sparse: incompatible types for 'case' statement
   net/bridge/netfilter/nft_meta_bridge.c:88:14: sparse: sparse: undefined identifier 'NFT_META_BRI_IIFPVID'
   net/bridge/netfilter/nft_meta_bridge.c:89:14: sparse: sparse: undefined identifier 'NFT_META_BRI_IIFVPROTO'
   net/bridge/netfilter/nft_meta_bridge.c:88:14: sparse: sparse: incompatible types for 'case' statement
   net/bridge/netfilter/nft_meta_bridge.c:89:14: sparse: sparse: incompatible types for 'case' statement
   net/bridge/netfilter/nft_meta_bridge.c:41:14: sparse: sparse: Expected constant expression in case statement
   net/bridge/netfilter/nft_meta_bridge.c:52:14: sparse: sparse: Expected constant expression in case statement
   net/bridge/netfilter/nft_meta_bridge.c:88:14: sparse: sparse: Expected constant expression in case statement
   net/bridge/netfilter/nft_meta_bridge.c:89:14: sparse: sparse: Expected constant expression in case statement

vim +/case +41 net/bridge/netfilter/nft_meta_bridge.c

30e103fe24debc wenxu 2019-07-05  20  
30e103fe24debc wenxu 2019-07-05  21  static void nft_meta_bridge_get_eval(const struct nft_expr *expr,
30e103fe24debc wenxu 2019-07-05  22  				     struct nft_regs *regs,
30e103fe24debc wenxu 2019-07-05  23  				     const struct nft_pktinfo *pkt)
30e103fe24debc wenxu 2019-07-05  24  {
30e103fe24debc wenxu 2019-07-05  25  	const struct nft_meta *priv = nft_expr_priv(expr);
30e103fe24debc wenxu 2019-07-05  26  	const struct net_device *in = nft_in(pkt), *out = nft_out(pkt);
30e103fe24debc wenxu 2019-07-05  27  	u32 *dest = &regs->data[priv->dreg];
9d6a1ecdc99717 wenxu 2019-07-05  28  	const struct net_device *br_dev;
30e103fe24debc wenxu 2019-07-05  29  
30e103fe24debc wenxu 2019-07-05  30  	switch (priv->key) {
30e103fe24debc wenxu 2019-07-05  31  	case NFT_META_BRI_IIFNAME:
9d6a1ecdc99717 wenxu 2019-07-05  32  		br_dev = nft_meta_get_bridge(in);
9d6a1ecdc99717 wenxu 2019-07-05  33  		if (!br_dev)
30e103fe24debc wenxu 2019-07-05  34  			goto err;
30e103fe24debc wenxu 2019-07-05  35  		break;
30e103fe24debc wenxu 2019-07-05  36  	case NFT_META_BRI_OIFNAME:
9d6a1ecdc99717 wenxu 2019-07-05  37  		br_dev = nft_meta_get_bridge(out);
9d6a1ecdc99717 wenxu 2019-07-05  38  		if (!br_dev)
30e103fe24debc wenxu 2019-07-05  39  			goto err;
30e103fe24debc wenxu 2019-07-05  40  		break;
c54c7c685494fc wenxu 2019-07-05 @41  	case NFT_META_BRI_IIFPVID: {
c54c7c685494fc wenxu 2019-07-05  42  		u16 p_pvid;
c54c7c685494fc wenxu 2019-07-05  43  
c54c7c685494fc wenxu 2019-07-05  44  		br_dev = nft_meta_get_bridge(in);
c54c7c685494fc wenxu 2019-07-05  45  		if (!br_dev || !br_vlan_enabled(br_dev))
c54c7c685494fc wenxu 2019-07-05  46  			goto err;
c54c7c685494fc wenxu 2019-07-05  47  
c54c7c685494fc wenxu 2019-07-05  48  		br_vlan_get_pvid_rcu(in, &p_pvid);
c54c7c685494fc wenxu 2019-07-05  49  		nft_reg_store16(dest, p_pvid);
c54c7c685494fc wenxu 2019-07-05  50  		return;
c54c7c685494fc wenxu 2019-07-05  51  	}
2a3a93ef0ba516 wenxu 2019-07-05  52  	case NFT_META_BRI_IIFVPROTO: {
2a3a93ef0ba516 wenxu 2019-07-05  53  		u16 p_proto;
2a3a93ef0ba516 wenxu 2019-07-05  54  
2a3a93ef0ba516 wenxu 2019-07-05  55  		br_dev = nft_meta_get_bridge(in);
2a3a93ef0ba516 wenxu 2019-07-05  56  		if (!br_dev || !br_vlan_enabled(br_dev))
2a3a93ef0ba516 wenxu 2019-07-05  57  			goto err;
2a3a93ef0ba516 wenxu 2019-07-05  58  
2a3a93ef0ba516 wenxu 2019-07-05  59  		br_vlan_get_proto(br_dev, &p_proto);
2a3a93ef0ba516 wenxu 2019-07-05  60  		nft_reg_store16(dest, p_proto);
2a3a93ef0ba516 wenxu 2019-07-05  61  		return;
2a3a93ef0ba516 wenxu 2019-07-05  62  	}
30e103fe24debc wenxu 2019-07-05  63  	default:
30e103fe24debc wenxu 2019-07-05  64  		goto out;
30e103fe24debc wenxu 2019-07-05  65  	}
30e103fe24debc wenxu 2019-07-05  66  
9d6a1ecdc99717 wenxu 2019-07-05  67  	strncpy((char *)dest, br_dev->name, IFNAMSIZ);
30e103fe24debc wenxu 2019-07-05  68  	return;
30e103fe24debc wenxu 2019-07-05  69  out:
30e103fe24debc wenxu 2019-07-05  70  	return nft_meta_get_eval(expr, regs, pkt);
30e103fe24debc wenxu 2019-07-05  71  err:
30e103fe24debc wenxu 2019-07-05  72  	regs->verdict.code = NFT_BREAK;
30e103fe24debc wenxu 2019-07-05  73  }
30e103fe24debc wenxu 2019-07-05  74  

:::::: The code at line 41 was first introduced by commit
:::::: c54c7c685494fc0f1662091d4d0c4fc26e810471 netfilter: nft_meta_bridge: add NFT_META_BRI_IIFPVID support

:::::: TO: wenxu <wenxu@ucloud.cn>
:::::: CC: Pablo Neira Ayuso <pablo@netfilter.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] netfilter: nft_meta: support for time matching
  2019-08-02  7:12 [PATCH v3] netfilter: nft_meta: support for time matching Ander Juaristi
                   ` (2 preceding siblings ...)
  2019-08-07 15:27 ` kbuild test robot
@ 2019-08-07 17:14 ` kbuild test robot
  2019-08-09 11:49 ` Pablo Neira Ayuso
  4 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2019-08-07 17:14 UTC (permalink / raw)
  To: Ander Juaristi; +Cc: kbuild-all, netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]

Hi Ander,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc3 next-20190807]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Ander-Juaristi/netfilter-nft_meta-support-for-time-matching/20190804-141253
config: i386-randconfig-g003-201931 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-10) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   ld: net/netfilter/nft_meta.o: in function `nft_meta_weekday':
>> net/netfilter/nft_meta.c:37: undefined reference to `__udivdi3'

vim +37 net/netfilter/nft_meta.c

    30	
    31	static u8 nft_meta_weekday(u64 secs)
    32	{
    33		u8 wday;
    34		unsigned int dse;
    35	
    36		secs -= 60 * sys_tz.tz_minuteswest;
  > 37		dse = secs / 86400;
    38		wday = (4 + dse) % 7;
    39	
    40		return ++wday % 7;
    41	}
    42	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36613 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] netfilter: nft_meta: support for time matching
  2019-08-02  7:12 [PATCH v3] netfilter: nft_meta: support for time matching Ander Juaristi
                   ` (3 preceding siblings ...)
  2019-08-07 17:14 ` kbuild test robot
@ 2019-08-09 11:49 ` Pablo Neira Ayuso
  4 siblings, 0 replies; 7+ messages in thread
From: Pablo Neira Ayuso @ 2019-08-09 11:49 UTC (permalink / raw)
  To: Ander Juaristi; +Cc: netfilter-devel

On Fri, Aug 02, 2019 at 09:12:33AM +0200, Ander Juaristi wrote:
> diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
> index 9b624566b82d..f635b9c2e221 100644
> --- a/include/net/netfilter/nf_tables.h
> +++ b/include/net/netfilter/nf_tables.h
> @@ -2,6 +2,7 @@
>  #ifndef _NET_NF_TABLES_H
>  #define _NET_NF_TABLES_H
>  
> +#include <asm/unaligned.h>
>  #include <linux/list.h>
>  #include <linux/netfilter.h>
>  #include <linux/netfilter/nfnetlink.h>
> @@ -119,6 +120,11 @@ static inline void nft_reg_store8(u32 *dreg, u8 val)
>  	*(u8 *)dreg = val;
>  }
>  
> +static inline void nft_reg_store64(u64 *dreg, u64 val)
> +{
> +	put_unaligned(val, dreg);
> +}

Could you make an initial patch to add nft_reg_load64() and
nft_reg_store64()? That patch should also update nft_byteorder to use
it. That would be patch 1/2.

Then, you place this patch 2/2 to add time support after 1/2.

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-09 11:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-02  7:12 [PATCH v3] netfilter: nft_meta: support for time matching Ander Juaristi
2019-08-02  7:36 ` Ander Juaristi
2019-08-02  9:37   ` Florian Westphal
2019-08-07 14:04 ` kbuild test robot
2019-08-07 15:27 ` kbuild test robot
2019-08-07 17:14 ` kbuild test robot
2019-08-09 11:49 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).