summaryrefslogtreecommitdiffstats
path: root/include/json.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2025-08-29 01:07:05 +0200
committerPhil Sutter <phil@nwl.cc>2025-09-11 18:03:02 +0200
commit6c04d24d16f1d15f216f2b3c8e64c9062cd77487 (patch)
tree477c14c3523da0504db224655029bd0814f787c9 /include/json.h
parent2214a4836bc7c906dd1d16a21a59b9d9240af7b7 (diff)
monitor: Inform JSON printer when reporting an object delete event
Since kernel commit a1050dd07168 ("netfilter: nf_tables: Reintroduce shortened deletion notifications"), type-specific data is no longer dumped when notifying for a deleted object. JSON output was not aware of this and tried to print bogus data. Fixes: 9e88aae28e9f4 ("monitor: Use libnftables JSON output") Signed-off-by: Phil Sutter <phil@nwl.cc> Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/json.h')
-rw-r--r--include/json.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/json.h b/include/json.h
index 42e1c861..3b8d045f 100644
--- a/include/json.h
+++ b/include/json.h
@@ -113,7 +113,7 @@ void monitor_print_set_json(struct netlink_mon_handler *monh,
void monitor_print_element_json(struct netlink_mon_handler *monh,
const char *cmd, struct set *s);
void monitor_print_obj_json(struct netlink_mon_handler *monh,
- const char *cmd, struct obj *o);
+ const char *cmd, struct obj *o, bool delete);
void monitor_print_flowtable_json(struct netlink_mon_handler *monh,
const char *cmd, struct flowtable *ft);
void monitor_print_rule_json(struct netlink_mon_handler *monh,
@@ -252,7 +252,8 @@ static inline void monitor_print_element_json(struct netlink_mon_handler *monh,
}
static inline void monitor_print_obj_json(struct netlink_mon_handler *monh,
- const char *cmd, struct obj *o)
+ const char *cmd, struct obj *o,
+ bool delete)
{
/* empty */
}