netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "William N." <netfilter@riseup.net>
To: netfilter@vger.kernel.org
Subject: Combining/compacting 2 rules into 1
Date: Tue, 16 Apr 2024 17:47:48 -0000	[thread overview]
Message-ID: <20240416174748.5612bd27@localhost> (raw)

Hello,

I am trying to "compact" the following rules:

table netdev filter {
	chain ingress {
		type filter hook ingress device "eth0" priority -500;
		# ...

		meta protocol ip \
			tcp flags syn \
			tcp option maxseg size lt 536 \
			log prefix "TCP MSS: " \
			counter packets 0 bytes 0 \
			drop

		meta protocol ip6 \
			tcp flags syn \
			tcp option maxseg size lt 1220 \
			log prefix "TCP MSS: " \
			counter packets 0 bytes 0 \
			drop
	}
}

into something like:

table netdev filter {
	chain ingress {
		type filter hook ingress device "eth0" priority -500;
		# ...

		meta protocol tcp option maxseg size map lt {
				ip : 536,
				ip6 : 1220
			} \
			tcp flags syn \
			log prefix "TCP MSS: " \
			counter packets 0 bytes 0 \
			drop
	}
}

but I am getting errors, as my syntax is obviously wrong. The first error is:

Error: syntax error, unexpected size, expecting newline or semicolon
                meta protocol tcp option maxseg size map lt {
                                                ^^^^

What is the correct syntax for this?

             reply	other threads:[~2024-04-16 17:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 17:47 William N. [this message]
2024-04-16 18:54 ` Combining/compacting 2 rules into 1 Kerin Millar
2024-04-16 19:12   ` William N.
2024-04-16 20:08     ` Kerin Millar
2024-04-17  8:29       ` William N.
2024-04-17  8:54         ` Slavko
2024-04-17  9:16           ` Kerin Millar
2024-04-17  9:23             ` Slavko
2024-04-17  9:50               ` Kerin Millar
2024-04-17 14:12                 ` William N.
2024-04-17 15:30                   ` Slavko
2024-04-19 10:55   ` William N.
2024-04-19 11:01     ` Serhii
2024-04-19 11:18       ` William N.
2024-04-19 12:54       ` William N.
2024-04-19 14:31         ` Serhii
2024-04-20  2:36     ` Kerin Millar
2024-04-20  8:51       ` William N.
2024-04-20 19:19         ` Kerin Millar

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=20240416174748.5612bd27@localhost \
    --to=netfilter@riseup.net \
    --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;
as well as URLs for NNTP newsgroup(s).