When mapping it to the comment match, otherwise, crash happens when
trying to save the ruleset listing.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
#include <xtables.h>
#include <linux/netfilter/nf_tables.h>
+#include <linux/netfilter/xt_comment.h>
#include <libmnl/libmnl.h>
#include <libnftnl/rule.h>
if (match == NULL)
return;
- m = calloc(1, sizeof(struct xt_entry_match) + len);
+ m = calloc(1, sizeof(struct xt_entry_match) +
+ sizeof(struct xt_comment_info));
if (m == NULL) {
fprintf(stderr, "OOM");
exit(EXIT_FAILURE);