<feed xmlns='http://www.w3.org/2005/Atom'>
<title>firewall4/tests/03_rules/17_protocol_invert, 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-10-28T13:07:03Z</updated>
<entry>
<title>fw4: honour negated protocol matches in rules</title>
<updated>2026-10-28T13:07:03Z</updated>
<author>
<name>John Crispin</name>
</author>
<published>2026-10-18T08:34:14Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/firewall4/commit/?id=384d1a9a2f414e599ffa62aa8b916ea6e455971c'/>
<id>urn:sha1:384d1a9a2f414e599ffa62aa8b916ea6e455971c</id>
<content type='text'>
parse_protocol() records a leading '!' in the invert flag, but the rule
template ignores it, so "option proto '!tcp'" silently renders as a
match on TCP. Emit "meta l4proto !=" for a negated protocol. A negated
list such as '!tcpudp' or '!tcp !udp' matches none of its protocols, so
it becomes a single rule against the whole set instead of one rule per
protocol. A rule that mixes negated and plain protocols, negates 'all',
or combines a negated protocol with port, ICMP type or port set matches
is refused with a warning.

Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
</content>
</entry>
</feed>
