diff mbox

[ebtables-compat,5/7] ebtables-compat: include rule counters in ebtables rules

Message ID 20150119132757.7422.9007.stgit@nfdev.cica.es
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Arturo Borrero Jan. 19, 2015, 1:27 p.m. UTC
Counters are missing in ebtables rules.

This patch includes them just before the target, so counters are incremented
when the rule is about to take his action.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 iptables/nft-bridge.c |    3 +++
 1 file changed, 3 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/iptables/nft-bridge.c b/iptables/nft-bridge.c
index af67a5a..3ef1357 100644
--- a/iptables/nft-bridge.c
+++ b/iptables/nft-bridge.c
@@ -191,6 +191,9 @@  static int nft_bridge_add(struct nft_rule *r, void *data)
 			break;
 	}
 
+	if (add_counters(r, cs->counters.pcnt, cs->counters.bcnt) < 0)
+		return -1;
+
 	return _add_action(r, cs);
 }