Blame SOURCES/0044-xtables-monitor-Fix-ip6tables-rule-printing.patch

082114
From 538acaef0d8424bd61047e6f1b81e3bc8bd421ec Mon Sep 17 00:00:00 2001
082114
From: Phil Sutter <phil@nwl.cc>
082114
Date: Fri, 7 Aug 2020 16:42:07 +0200
082114
Subject: [PATCH] xtables-monitor: Fix ip6tables rule printing
082114
082114
When printing an ip6tables rule event, false family ops are used as they
082114
are initially looked up for AF_INET and reused no matter the current
082114
rule's family. In practice, this means that nft_rule_print_save() calls
082114
the wrong rule_to_cs, save_rule and clear_cs callbacks. Therefore, if a
082114
rule specifies a source or destination address, the address is not
082114
printed.
082114
082114
Fix this by performing a family lookup each time rule_cb is called.
082114
082114
Signed-off-by: Phil Sutter <phil@nwl.cc>
082114
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
082114
(cherry picked from commit ca69b0290dc509d72118f0a054a5c740cb913875)
082114
Signed-off-by: Phil Sutter <psutter@redhat.com>
082114
---
082114
 iptables/xtables-monitor.c | 2 ++
082114
 1 file changed, 2 insertions(+)
082114
082114
diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c
082114
index c2b31dbaa0795..92962a2a95f48 100644
082114
--- a/iptables/xtables-monitor.c
082114
+++ b/iptables/xtables-monitor.c
082114
@@ -93,6 +93,8 @@ static int rule_cb(const struct nlmsghdr *nlh, void *data)
082114
 	if (arg->nfproto && arg->nfproto != family)
082114
 		goto err_free;
082114
 
082114
+	arg->h->ops = nft_family_ops_lookup(family);
082114
+
082114
 	if (arg->is_event)
082114
 		printf(" EVENT: ");
082114
 	switch (family) {
082114
-- 
082114
2.31.1
082114