====
Fixes:
- SYSRQ: fix double target initialization at module load
+- build: do not attempt to build IPv6 parts if CONFIG_IPV6=n
Enhancements:
- TARPIT gained IPv6 support
#endif
#include "compat_skbuff.h"
#include "compat_xtnu.h"
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+# define WITH_IPV6 1
+#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 22)
static int xtnu_match_run(const struct sk_buff *skb,
}
EXPORT_SYMBOL_GPL(HX_memmem);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) && defined(WITH_IPV6)
int xtnu_ipv6_skip_exthdr(const struct sk_buff *skb, int start,
uint8_t *nexthdrp, __be16 *fragoffp)
{
}
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0) && defined(WITH_IPV6)
int xtnu_ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
int target, unsigned short *fragoff, int *fragflg)
{
#include <net/tcp.h>
#include "compat_xtables.h"
#include "xt_TARPIT.h"
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+# define WITH_IPV6 1
+#endif
static bool xttarpit_tarpit(struct tcphdr *tcph, const struct tcphdr *oth)
{
kfree_skb(nskb);
}
+#ifdef WITH_IPV6
static void tarpit_tcp6(struct sk_buff *oldskb, unsigned int hook,
unsigned int mode)
{
free_nskb:
kfree_skb(nskb);
}
+#endif
static unsigned int
tarpit_tg4(struct sk_buff **pskb, const struct xt_action_param *par)
return NF_DROP;
}
+#ifdef WITH_IPV6
static unsigned int
tarpit_tg6(struct sk_buff **pskb, const struct xt_action_param *par)
{
tarpit_tcp6(*pskb, par->hooknum, info->variant);
return NF_DROP;
}
+#endif
static struct xt_target tarpit_tg_reg[] __read_mostly = {
{
.targetsize = sizeof(struct xt_tarpit_tginfo),
.me = THIS_MODULE,
},
+#ifdef WITH_IPV6
{
.name = "TARPIT",
.revision = 0,
.targetsize = sizeof(struct xt_tarpit_tginfo),
.me = THIS_MODULE,
},
+#endif
};
static int __init tarpit_tg_init(void)