From dcbfc8b14231f43695019ed456a355e37e4a8c84 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 27 Jan 2016 02:53:51 +0100 Subject: netlink_delinearize: only remove protocol if equal cmp is used Check for OP_EQ before removing a dependency, else we may zap wrong one, changing the meaning of the rule. Listing without patch: ip protocol udp udp dport ssh ip protocol udp udp dport ssh counter packets 1 bytes 308 ip protocol udp udp dport ssh With patch: ip protocol != tcp udp dport ssh ip protocol != udp udp dport ssh ip protocol != tcp counter packets 1 bytes 308 udp dport ssh Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- tests/py/ip/tcp.t | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/py/ip/tcp.t (limited to 'tests/py/ip/tcp.t') diff --git a/tests/py/ip/tcp.t b/tests/py/ip/tcp.t new file mode 100644 index 00000000..4dcfcb6b --- /dev/null +++ b/tests/py/ip/tcp.t @@ -0,0 +1,6 @@ +:input;type filter hook input priority 0 + +*ip;test-ip;input + +ip protocol tcp tcp dport ssh accept;ok;tcp dport 22 accept +ip protocol ne tcp udp dport ssh accept;ok;ip protocol != 6 udp dport 22 accept -- cgit v1.2.3