Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Slavko <linux@slavino.sk>
To: "netfilter ML" <netfilter@vger.kernel.org>
Subject: Re: Sets update
Date: Tue, 23 Jul 2024 09:24:39 +0200	[thread overview]
Message-ID: <20240723092439.7b9f7b58@bonifac.skk> (raw)
In-Reply-To: <4a9d6e4b-61e8-4aa6-ac50-8cbb9357e398@app.fastmail.com>

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

Hi,

Dňa Sun, 21 Jul 2024 13:29:44 +0100 "Kerin Millar" <kfm@plushkava.net>
napísal:

> #!/bin/sh
> set -e
> tmpfile1=
> tmpfile2=
> trap 'rm -f -- "$tmpfile1" "$tmpfile2"' EXIT
> tmpfile1=$(mktemp)
> tmpfile2=$(mktemp)
> cat > "$tmpfile1"
> {
>    echo "delete element $* {"; sed 's/$/,/' "$tmpfile1"; echo "}"
>    echo "add    element $* {"; sed 's/$/,/' "$tmpfile1"; echo "}"
> } > "$tmpfile2"
> nft -f "$tmpfile2"

I play with that, i add one more "add" before "delete" and seems to
work, except after boot...

After boot the set is (obviously) empty, i try to fill it with something
as:

    curl -s https://my_local_URL | ./nft-addset.sh inet fw4 myset | nft -f-

But that fail with::

    /dev/stdin:1:1-2: Error: Could not process rule: Out of memory
    add    element inet fw4 myset {
    ^^

(The host has >6 GB of free RAM, the list has ~1700 items)

Initially i blame IP duplicates in downloaded list of IPs, but that was
unrelated to this error. When i remove the first "add" and "delete"
lines from script (thus just one "add"), it works. After initial fill it
works with all three commands (add+delete+add) on already filled set
and even when i flush that set, it still works. Only first fill (after
boot) ends with that error.

When i delete and create that set, i got "Out of memory" again, the set
is defined as::

    table inet fw4 {
	set myset {
		type ipv4_addr
		last counter
		timeout 2d
	}
    }

I tried to add "size" into it, but that doesn't help.

I roughly remember, that i read something about some memory limit in
container (i am not in container), but i am not able to find that
again to check if that is problem.

Please, what can cause that initial fill error, how i can debug/solve
it?

regards

-- 
Slavko
https://www.slavino.sk

[-- Attachment #2: Digitálny podpis OpenPGP --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2024-07-23  7:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21  7:44 Sets update Slavko
2024-07-21  9:58 ` Kerin Millar
2024-07-21 10:04   ` Kerin Millar
2024-07-21 11:23   ` Slavko
2024-07-21 12:29     ` Kerin Millar
2024-07-21 14:38       ` Slavko
2024-07-21 15:46         ` Kerin Millar
2024-07-23  7:24       ` Slavko [this message]
2024-07-23  7:37         ` Slavko
2024-07-23  9:39         ` Pablo Neira Ayuso
2024-07-23 10:23           ` Slavko
2024-07-23 11:32           ` Kerin Millar
2024-07-23 12:19             ` Pablo Neira Ayuso
2024-07-21 16:09   ` Eric
2024-07-21 16:46     ` Kerin Millar
2024-07-21 17:58   ` Slavko
2024-07-22 20:36   ` Pablo Neira Ayuso
2024-07-23  7:26     ` Slavko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240723092439.7b9f7b58@bonifac.skk \
    --to=linux@slavino.sk \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox