Skip to content

Commit

Permalink
xtables-addons: fix xt_DNETMAP load when nf NAT is built as a module
Browse files Browse the repository at this point in the history
  • Loading branch information
bitthief authored and ptpt52 committed Apr 26, 2024
1 parent b373e7e commit 9d97d96
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/extensions/xt_DNETMAP.c
+++ a/extensions/xt_DNETMAP.c
@@ -20,7 +20,7 @@

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
-#ifdef CONFIG_NF_NAT
+#if defined(CONFIG_NF_NAT) || defined(CONFIG_NF_NAT_MODULE)
#include <linux/inet.h>
#include <linux/ip.h>
#include <linux/netdevice.h>
@@ -916,7 +916,7 @@ static void __exit dnetmap_tg_exit(void)
xt_unregister_target(&dnetmap_tg_reg);
unregister_pernet_subsys(&dnetmap_net_ops);
}
-#else /* CONFIG_NF_NAT */
+#else /* CONFIG_NF_NAT || CONFIG_NF_NAT_MODULE */
static int __init dnetmap_tg_init(void)
{
pr_err("CONFIG_NF_NAT is not available in your kernel, hence this module cannot function.");

0 comments on commit 9d97d96

Please sign in to comment.