All of lore.kernel.org
 help / color / mirror / Atom feed
* Metering is not working with dynamic sets on nft v0.9.2
@ 2020-02-06 22:42 darius
  2020-02-07  9:48 ` ѽ҉ᶬḳ℠
  0 siblings, 1 reply; 8+ messages in thread
From: darius @ 2020-02-06 22:42 UTC (permalink / raw)
  To: netfilter


[-- Attachment #1.1: Type: text/plain, Size: 1097 bytes --]

Hello,
I was using meters by using 'meter' keyword, but apparently it is now
obsolete. So, I have decided to update rules and use dynamic sets
instead. For some reason I'm getting an error stating that rule is not
supported. Here is what was working before and still works:

ct state new meter mymeter { ip saddr timeout 30s limit rate over
50/second burst 50 packets } counter drop

Then I have tried to update this rule to the following:

...
set mymeter{
    type ipv4_addr; flags timeout, dynamic;
}
...
ct state new add @mymeter { ip saddr timeout 30s limit rate over
50/second burst 50 packets } counter drop

In this case nft throws fault message:

root@HOMEROUTER:/etc/config# /etc/init.d/firewall reload
/etc/config/ruleset.nft:416:9-187: Error: Could not process rule: Not
supported
        ct state new add @mymeter { ip saddr timeout 30s limit rate over
50/second burst 50 packets } counter drop

I'm running OpenWRT, kernel v4.14.167, nft v.0.9.2
Could anyone help to find out what I'm doing wrong? It seems that I did
it according to wiki.

Regards


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: Metering is not working with dynamic sets on nft v0.9.2
  2020-02-06 22:42 Metering is not working with dynamic sets on nft v0.9.2 darius
@ 2020-02-07  9:48 ` ѽ҉ᶬḳ℠
  2020-02-07 10:17   ` Florian Westphal
  0 siblings, 1 reply; 8+ messages in thread
From: ѽ҉ᶬḳ℠ @ 2020-02-07  9:48 UTC (permalink / raw)
  To: darius, netfilter

On 06/02/2020 22:42, darius wrote:
> Hello,
> I was using meters by using 'meter' keyword, but apparently it is now
> obsolete.

If not mistaken the intention is to replace meter with native set / map 
syntax but meter not yet being depreciated/retired.


> So, I have decided to update rules and use dynamic sets
> instead. For some reason I'm getting an error stating that rule is not
> supported. Here is what was working before and still works:
>
> ct state new meter mymeter { ip saddr timeout 30s limit rate over
> 50/second burst 50 packets } counter drop
>
> Then I have tried to update this rule to the following:
>
> ...
> set mymeter{
>      type ipv4_addr; flags timeout, dynamic;
> }
> ...
> ct state new add @mymeter { ip saddr timeout 30s limit rate over
> 50/second burst 50 packets } counter drop
>
> In this case nft throws fault message:
>
> root@HOMEROUTER:/etc/config# /etc/init.d/firewall reload
> /etc/config/ruleset.nft:416:9-187: Error: Could not process rule: Not
> supported
>          ct state new add @mymeter { ip saddr timeout 30s limit rate over
> 50/second burst 50 packets } counter drop
>
> I'm running OpenWRT, kernel v4.14.167, nft v.0.9.2
> Could anyone help to find out what I'm doing wrong? It seems that I did
> it according to wiki.
>
> Regards
>

Are NFT SETS otherwise working? If so then probably it is due to the 
inhabitation of the kernel version 4.14.x, least my understanding is 
that some SETS related features are only available as of kernel 4.15 | 4.18.

If SETS however generally printing the error then it likely would be 
caused by an unset kernel build configuration flag.




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

* Re: Metering is not working with dynamic sets on nft v0.9.2
  2020-02-07  9:48 ` ѽ҉ᶬḳ℠
@ 2020-02-07 10:17   ` Florian Westphal
  2020-02-07 11:00     ` Darius
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Westphal @ 2020-02-07 10:17 UTC (permalink / raw)
  To: ѽ҉ᶬḳ℠; +Cc: darius, netfilter

ѽ҉ᶬḳ℠ <vtol@gmx.net> wrote:
> On 06/02/2020 22:42, darius wrote:
> > Hello,
> > I was using meters by using 'meter' keyword, but apparently it is now
> > obsolete.

Not really, it will continue to work.

> If not mistaken the intention is to replace meter with native set / map
> syntax but meter not yet being depreciated/retired.

Yes.

> > root@HOMEROUTER:/etc/config# /etc/init.d/firewall reload
> > /etc/config/ruleset.nft:416:9-187: Error: Could not process rule: Not
> > supported
> >          ct state new add @mymeter { ip saddr timeout 30s limit rate over
> > 50/second burst 50 packets } counter drop
> > 
> > I'm running OpenWRT, kernel v4.14.167, nft v.0.9.2
> > Could anyone help to find out what I'm doing wrong? It seems that I did
> > it according to wiki.

Its a kernel bug.  The kernel picks the wrong set backend on 4.14, so
when it sees the rule (which requires a set that supports updates) it
will fail.

Contine to use mter syntax if that works for you.

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

* Re: Metering is not working with dynamic sets on nft v0.9.2
  2020-02-07 10:17   ` Florian Westphal
@ 2020-02-07 11:00     ` Darius
  2020-02-07 11:06       ` Florian Westphal
  0 siblings, 1 reply; 8+ messages in thread
From: Darius @ 2020-02-07 11:00 UTC (permalink / raw)
  To: Florian Westphal, ѽ҉ᶬḳ℠; +Cc: netfilter

Ok, I'll keep using 'meter' keywork. Sets are working just perfectly, all sets instructions works as well.

But do you know if it is only 4.14 kernel affected? Is there any bug report and patch available for this issue for kernel 4.14?

Regards

> On February 7, 2020 11:17 AM Florian Westphal <fw@strlen.de> wrote:
> 
>  
> ѽ҉ᶬḳ℠ <vtol@gmx.net> wrote:
> > On 06/02/2020 22:42, darius wrote:
> > > Hello,
> > > I was using meters by using 'meter' keyword, but apparently it is now
> > > obsolete.
> 
> Not really, it will continue to work.
> 
> > If not mistaken the intention is to replace meter with native set / map
> > syntax but meter not yet being depreciated/retired.
> 
> Yes.
> 
> > > root@HOMEROUTER:/etc/config# /etc/init.d/firewall reload
> > > /etc/config/ruleset.nft:416:9-187: Error: Could not process rule: Not
> > > supported
> > >          ct state new add @mymeter { ip saddr timeout 30s limit rate over
> > > 50/second burst 50 packets } counter drop
> > > 
> > > I'm running OpenWRT, kernel v4.14.167, nft v.0.9.2
> > > Could anyone help to find out what I'm doing wrong? It seems that I did
> > > it according to wiki.
> 
> Its a kernel bug.  The kernel picks the wrong set backend on 4.14, so
> when it sees the rule (which requires a set that supports updates) it
> will fail.
> 
> Contine to use mter syntax if that works for you.

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

* Re: Metering is not working with dynamic sets on nft v0.9.2
  2020-02-07 11:00     ` Darius
@ 2020-02-07 11:06       ` Florian Westphal
  2020-02-07 11:08         ` Darius
  2020-02-08 21:49         ` darius
  0 siblings, 2 replies; 8+ messages in thread
From: Florian Westphal @ 2020-02-07 11:06 UTC (permalink / raw)
  To: Darius; +Cc: Florian Westphal, ѽ҉ᶬḳ℠, netfilter

Darius <dram@mailbox.org> wrote:
> Ok, I'll keep using 'meter' keywork. Sets are working just perfectly, all sets instructions works as well.
> 
> But do you know if it is only 4.14 kernel affected? Is there any bug report and patch available for this issue for kernel 4.14?

No idea.  I suspect its this patch:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=acab713177377d9e0889c46bac7ff0cfb9a90c4d

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

* Re: Metering is not working with dynamic sets on nft v0.9.2
  2020-02-07 11:06       ` Florian Westphal
@ 2020-02-07 11:08         ` Darius
  2020-02-08 21:49         ` darius
  1 sibling, 0 replies; 8+ messages in thread
From: Darius @ 2020-02-07 11:08 UTC (permalink / raw)
  To: Florian Westphal; +Cc: ѽ҉ᶬḳ℠, netfilter

Thanks! Will investigate a bit

Regards

> On February 7, 2020 12:06 PM Florian Westphal <fw@strlen.de> wrote:
> 
>  
> Darius <dram@mailbox.org> wrote:
> > Ok, I'll keep using 'meter' keywork. Sets are working just perfectly, all sets instructions works as well.
> > 
> > But do you know if it is only 4.14 kernel affected? Is there any bug report and patch available for this issue for kernel 4.14?
> 
> No idea.  I suspect its this patch:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=acab713177377d9e0889c46bac7ff0cfb9a90c4d

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

* Re: Metering is not working with dynamic sets on nft v0.9.2
  2020-02-07 11:06       ` Florian Westphal
  2020-02-07 11:08         ` Darius
@ 2020-02-08 21:49         ` darius
  2020-02-08 22:15           ` Florian Westphal
  1 sibling, 1 reply; 8+ messages in thread
From: darius @ 2020-02-08 21:49 UTC (permalink / raw)
  To: Florian Westphal; +Cc: ѽ҉ᶬḳ℠, netfilter


[-- Attachment #1.1: Type: text/plain, Size: 761 bytes --]

I have checked link provided by you. This patch is already implemented
on 4.14 kernel that runs on OpenWRT, but that does not help with the
error. I still have fault.
Any other ideas where to check? Just would be nice to find where is problem.

Regards

On 07.02.2020 12.06, Florian Westphal wrote:
> Darius <dram@mailbox.org> wrote:
>> Ok, I'll keep using 'meter' keywork. Sets are working just perfectly, all sets instructions works as well.
>>
>> But do you know if it is only 4.14 kernel affected? Is there any bug report and patch available for this issue for kernel 4.14?
> 
> No idea.  I suspect its this patch:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=acab713177377d9e0889c46bac7ff0cfb9a90c4d
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: Metering is not working with dynamic sets on nft v0.9.2
  2020-02-08 21:49         ` darius
@ 2020-02-08 22:15           ` Florian Westphal
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Westphal @ 2020-02-08 22:15 UTC (permalink / raw)
  To: darius; +Cc: Florian Westphal, ѽ҉ᶬḳ℠, netfilter

darius <dram@mailbox.org> wrote:
> I have checked link provided by you. This patch is already implemented
> on 4.14 kernel that runs on OpenWRT, but that does not help with the
> error. I still have fault.
> Any other ideas where to check? Just would be nice to find where is problem.

No.  If you know some C, edit net/netfilter/nf_tables.c, search for
nft_select_set_ops() and check which set type is picked.

ops needs to be "nft_set_rhash_type", thats the only one where
ops->update is non-NULL.

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

end of thread, other threads:[~2020-02-08 22:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 22:42 Metering is not working with dynamic sets on nft v0.9.2 darius
2020-02-07  9:48 ` ѽ҉ᶬḳ℠
2020-02-07 10:17   ` Florian Westphal
2020-02-07 11:00     ` Darius
2020-02-07 11:06       ` Florian Westphal
2020-02-07 11:08         ` Darius
2020-02-08 21:49         ` darius
2020-02-08 22:15           ` Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.