From: Philip Prindeville Date: Sun, 26 Sep 2021 19:57:34 +0000 (+0200) Subject: xt_ECHO, xt_TARPIT: make properly conditional on IPv6 X-Git-Tag: v3.19~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=52b57ee801c8e69763639ee88910cd76881be9d8;p=thirdparty%2Fxtables-addons.git xt_ECHO, xt_TARPIT: make properly conditional on IPv6 Not all modules compile equally well when CONFIG_IPv6 is disabled. --- diff --git a/extensions/xt_ECHO.c b/extensions/xt_ECHO.c index a0b7185..1ead749 100644 --- a/extensions/xt_ECHO.c +++ b/extensions/xt_ECHO.c @@ -22,7 +22,11 @@ #include #include #include "compat_xtables.h" +#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) +# define WITH_IPV6 1 +#endif +#ifdef WITH_IPV6 static unsigned int echo_tg6(struct sk_buff *oldskb, const struct xt_action_param *par) { @@ -124,6 +128,7 @@ echo_tg6(struct sk_buff *oldskb, const struct xt_action_param *par) kfree_skb(newskb); return NF_DROP; } +#endif static unsigned int echo_tg4(struct sk_buff *oldskb, const struct xt_action_param *par) @@ -216,6 +221,7 @@ echo_tg4(struct sk_buff *oldskb, const struct xt_action_param *par) } static struct xt_target echo_tg_reg[] __read_mostly = { +#ifdef WITH_IPV6 { .name = "ECHO", .revision = 0, @@ -225,6 +231,7 @@ static struct xt_target echo_tg_reg[] __read_mostly = { .target = echo_tg6, .me = THIS_MODULE, }, +#endif { .name = "ECHO", .revision = 0, @@ -251,5 +258,7 @@ module_exit(echo_tg_exit); MODULE_AUTHOR("Jan Engelhardt "); MODULE_DESCRIPTION("Xtables: ECHO diagnosis target"); MODULE_LICENSE("GPL"); +#ifdef WITH_IPV6 MODULE_ALIAS("ip6t_ECHO"); +#endif MODULE_ALIAS("ipt_ECHO"); diff --git a/extensions/xt_TARPIT.c b/extensions/xt_TARPIT.c index 0b70dd9..9a7ae5c 100644 --- a/extensions/xt_TARPIT.c +++ b/extensions/xt_TARPIT.c @@ -532,4 +532,6 @@ MODULE_DESCRIPTION("Xtables: \"TARPIT\", capture and hold TCP connections"); MODULE_AUTHOR("Jan Engelhardt "); MODULE_LICENSE("GPL"); MODULE_ALIAS("ipt_TARPIT"); +#ifdef WITH_IPV6 MODULE_ALIAS("ip6t_TARPIT"); +#endif