ifdef CONFIG_X does not imply CONFIG_X_MODULE.
#pragma once
+#include <linux/kconfig.h>
struct tcphdr;
struct udphdr;
#define skb_ifindex(skb) (skb)->skb_iif
#define skb_nfmark(skb) (((struct sk_buff *)(skb))->mark)
-#ifdef CONFIG_NETWORK_SECMARK
+#if IS_ENABLED(CONFIG_NETWORK_SECMARK)
# define skb_secmark(skb) ((skb)->secmark)
#else
# define skb_secmark(skb) 0
* version 2 of the License, or any later version.
*/
#include <linux/ip.h>
+#include <linux/kconfig.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/list.h>
#include <net/route.h>
#include <linux/export.h>
#include "compat_skbuff.h"
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
# define WITH_IPV6 1
#endif
#pragma once
+#include <linux/kconfig.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include "compat_skbuff.h"
# warning Kernels below 4.16 not supported.
#endif
-#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
+#if IS_ENABLED(CONFIG_NF_CONNTRACK)
# if !defined(CONFIG_NF_CONNTRACK_MARK)
# warning You have CONFIG_NF_CONNTRACK enabled, but CONFIG_NF_CONNTRACK_MARK is not (please enable).
# endif
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+#include <linux/kconfig.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/version.h>
#include <linux/netfilter/x_tables.h>
-#ifdef CONFIG_BRIDGE_NETFILTER
+#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
# include <linux/netfilter_bridge.h>
#endif
#include <net/tcp.h>
sizeof(struct tcphdr), 0));
addr_type = RTN_UNSPEC;
-#ifdef CONFIG_BRIDGE_NETFILTER
+#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
if (par->state->hook != NF_INET_FORWARD ||
((struct nf_bridge_info *)skb_ext_find(nskb, SKB_EXT_BRIDGE_NF) != NULL &&
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/kconfig.h>
#include <linux/module.h>
-#ifdef CONFIG_NF_NAT
+#if IS_ENABLED(CONFIG_NF_NAT)
#include <linux/inet.h>
#include <linux/ip.h>
#include <linux/netdevice.h>
* version 2 of the License, or any later version, as published by the
* Free Software Foundation.
*/
-
#include <linux/ip.h>
+#include <linux/kconfig.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/udp.h>
#include <linux/netfilter/x_tables.h>
-#ifdef CONFIG_BRIDGE_NETFILTER
+#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
# include <linux/netfilter_bridge.h>
#endif
#include <net/ip.h>
#include <net/ip6_route.h>
#include <net/route.h>
#include "compat_xtables.h"
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
# define WITH_IPV6 1
#endif
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
+#include <linux/kconfig.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/sysrq.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include "compat_xtables.h"
-
-#if defined(CONFIG_CRYPTO) || defined(CONFIG_CRYPTO_MODULE)
+#if IS_ENABLED(CONFIG_CRYPTO)
# define WITH_CRYPTO 1
#endif
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
# define WITH_IPV6 1
#endif
static int __init sysrq_crypto_init(void)
{
-#if defined(WITH_CRYPTO)
+#ifdef WITH_CRYPTO
struct timespec64 now;
int ret;
* - Reply to TCP SYN,ACK,!RST,!FIN with RST to prevent spoofing
* - Reply to TCP !SYN,!RST,!FIN with ACK, window 0 bytes, rate-limited
*/
-
#include <linux/ip.h>
+#include <linux/kconfig.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/version.h>
#include <linux/netfilter_ipv6.h>
#include <linux/netfilter/x_tables.h>
-#ifdef CONFIG_BRIDGE_NETFILTER
+#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
# include <linux/netfilter_bridge.h>
#endif
#include <net/addrconf.h>
#include <net/tcp.h>
#include "compat_xtables.h"
#include "xt_TARPIT.h"
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
# define WITH_IPV6 1
#endif
else if (mode == XTTARPIT_HONEYPOT)
niph->id = ~oldhdr->id + 1;
-#ifdef CONFIG_BRIDGE_NETFILTER
+#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
if (par->state->hook != NF_INET_FORWARD ||
((struct nf_bridge_info *)skb_ext_find(nskb, SKB_EXT_BRIDGE_NF) != NULL &&
* Free Software Foundation.
*/
#include <linux/dccp.h>
+#include <linux/kconfig.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/icmp.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
#include "xt_length2.h"
#include "compat_xtables.h"
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
# define WITH_IPV6 1
#endif
#ifndef NEXTHDR_IPV4
#define HASH_LOG 9
#define PSD_HASH_SIZE (1 << HASH_LOG)
#define HASH_MAX 0x10
-
-#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
# define WITH_IPV6 1
#endif