<feed xmlns='http://www.w3.org/2005/Atom'>
<title>firewall4/tests/03_rules/19_ipset_reference_syntax, branch master</title>
<subtitle>OpenWrt nftables firewall</subtitle>
<id>https://git.openwrt.org/project/firewall4/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/project/firewall4/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/'/>
<updated>2026-11-02T23:15:59Z</updated>
<entry>
<title>fw4: reject unknown tokens in ipset references</title>
<updated>2026-11-02T23:15:59Z</updated>
<author>
<name>Philipp Raschdorff</name>
</author>
<published>2026-10-17T20:01:42Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=daf6cf607cab1efbefca5715c9f781979c3664ba'/>
<id>urn:sha1:daf6cf607cab1efbefca5715c9f781979c3664ba</id>
<content type='text'>
parse_setmatch() ignores every token after the set name that is not a
direction (`src`, `dst`, `dest`). `option ipset 'setA setB'` is
therefore accepted as a reference to setA only, and the rule silently
matches fewer conditions than configured. With list support for the
option this mistake becomes likely.

Reject the value if it has more than three tokens or a token that is
not a direction. An invalid value drops the section with the usual
"specifies invalid value" warning (fail-closed).

This is a behaviour change: a configuration that relied on unknown
tokens being ignored loses the affected rule after the update. For an
ACCEPT rule that closes access; for a DROP or REJECT rule it removes
the block, which is the opposite of fail-closed. Both cases are reported
with a warning, but nothing else draws attention to them. If that risk
is considered too high, the alternative is to keep accepting the
reference and only warn about the ignored tokens; this patch is
submitted separately so that it can be discussed and dropped on its
own.

Co-Authored-By: Claude Fable 5.1 &lt;noreply@anthropic.com&gt;
Signed-off-by: Philipp Raschdorff &lt;p.raschdorff@googlemail.com&gt;
</content>
</entry>
<entry>
<title>fw4: fix parsing of repeated separators in ipset references</title>
<updated>2026-11-02T22:46:36Z</updated>
<author>
<name>Philipp Raschdorff</name>
</author>
<published>2026-10-17T20:01:38Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=ffa015c64f06280d7e76e532fad20868c9947f10'/>
<id>urn:sha1:ffa015c64f06280d7e76e532fad20868c9947f10</id>
<content type='text'>
parse_setmatch() split the direction tokens after the set name at single
spaces or commas. A value like `'set  src'` (two spaces) therefore
produced an empty token at index 0, the `src` landed at index 1 and
applied to the wrong set field.

Split at runs of separators and drop empty tokens, so `'set  src'` and
`'set, src'` mean the same as `'set src'`. Unknown tokens are still
ignored as before.

Co-Authored-By: Claude Fable 5.1 &lt;noreply@anthropic.com&gt;
Signed-off-by: Philipp Raschdorff &lt;p.raschdorff@googlemail.com&gt;
</content>
</entry>
</feed>
