]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
add support for Linux 5.0 for DELUDE and TARPIT
authorrantal <rantal5030@gmail.com>
Wed, 14 Aug 2019 18:40:07 +0000 (18:40 +0000)
committerrantal <rantal5030@gmail.com>
Wed, 14 Aug 2019 18:40:07 +0000 (18:40 +0000)
extensions/xt_DELUDE.c
extensions/xt_TARPIT.c

index 618de5e1025473211e2476117c9499e322d84bc7..b384c8e1c85dc5e21335bf9c4785fce989110ab5 100644 (file)
@@ -107,8 +107,13 @@ static void delude_send_reset(struct net *net, struct sk_buff *oldskb,
 
        addr_type = RTN_UNSPEC;
 #ifdef CONFIG_BRIDGE_NETFILTER
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
+       if (hook != NF_INET_FORWARD || ((struct nf_bridge_info *)skb_ext_find(nskb, SKB_EXT_BRIDGE_NF) != NULL &&
+           ((struct nf_bridge_info *)skb_ext_find(nskb, SKB_EXT_BRIDGE_NF))->physoutdev))
+#else
        if (hook != NF_INET_FORWARD || (nskb->nf_bridge != NULL &&
            nskb->nf_bridge->physoutdev))
+#endif
 #else
        if (hook != NF_INET_FORWARD)
 #endif
index cb98e9eca63fdbe1c1304ec29362efe8454d349c..708e1c28df7aeae69ad5163b327027f9a011bcb7 100644 (file)
@@ -249,8 +249,13 @@ static void tarpit_tcp4(struct net *net, struct sk_buff *oldskb,
                niph->id = ~oldhdr->id + 1;
 
 #ifdef CONFIG_BRIDGE_NETFILTER
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
+       if (hook != NF_INET_FORWARD || ((struct nf_bridge_info *)skb_ext_find(nskb, SKB_EXT_BRIDGE_NF) != NULL &&
+           ((struct nf_bridge_info *)skb_ext_find(nskb, SKB_EXT_BRIDGE_NF))->physoutdev))
+#else
        if (hook != NF_INET_FORWARD || (nskb->nf_bridge != NULL &&
            nskb->nf_bridge->physoutdev != NULL))
+#endif
 #else
        if (hook != NF_INET_FORWARD)
 #endif