#include "compat_xtables.h"
#define PFX KBUILD_MODNAME ": "
-static void delude_send_reset(struct net *net, struct sk_buff *oldskb,
- unsigned int hook)
+static void delude_send_reset(struct net *net, struct sock *sk,
+ struct sk_buff *oldskb, unsigned int hook)
{
struct tcphdr _otcph, *tcph;
const struct tcphdr *oth;
/* ip_route_me_harder expects skb->dst to be set */
skb_dst_set(nskb, dst_clone(skb_dst(oldskb)));
- if (ip_route_me_harder(net, nskb->sk, nskb, addr_type))
+ if (ip_route_me_harder(net, sk, nskb, addr_type))
goto free_nskb;
else
niph = ip_hdr(nskb);
* a problem, as that is supported since Linux 2.6.35. But since we do not
* actually want to have a connection open, we are still going to drop it.
*/
- delude_send_reset(par_net(par), skb, par->state->hook);
+ delude_send_reset(par_net(par), par->state->sk, skb, par->state->hook);
return NF_DROP;
}
goto free_nskb;
nf_ct_attach(newskb, oldskb);
- ip6_local_out(par_net(par), newskb->sk, newskb);
+ ip6_local_out(par_net(par), par->state->sk, newskb);
return NF_DROP;
free_nskb:
/* ip_route_me_harder expects the skb's dst to be set */
skb_dst_set(newskb, dst_clone(skb_dst(oldskb)));
- if (ip_route_me_harder(par_net(par), newskb->sk, newskb, RTN_UNSPEC) != 0)
+ if (ip_route_me_harder(par_net(par), par->state->sk, newskb,
+ RTN_UNSPEC) != 0)
goto free_nskb;
newip->ttl = ip4_dst_hoplimit(skb_dst(newskb));
return true;
}
-static void tarpit_tcp4(struct net *net, struct sk_buff *oldskb,
- unsigned int hook, unsigned int mode)
+static void tarpit_tcp4(struct net *net, struct sock *sk,
+ struct sk_buff *oldskb, unsigned int hook, unsigned int mode)
{
struct tcphdr _otcph, *tcph;
const struct tcphdr *oth;
#endif
addr_type = RTN_LOCAL;
- if (ip_route_me_harder(net, nskb->sk, nskb, addr_type))
+ if (ip_route_me_harder(net, sk, nskb, addr_type) != 0)
goto free_nskb;
else
niph = ip_hdr(nskb);
}
#ifdef WITH_IPV6
-static void tarpit_tcp6(struct net *net, struct sk_buff *oldskb,
- unsigned int hook, unsigned int mode)
+static void tarpit_tcp6(struct net *net, struct sock *sock,
+ struct sk_buff *oldskb, unsigned int hook, unsigned int mode)
{
struct sk_buff *nskb;
struct tcphdr *tcph, oth;
/* We are not interested in fragments */
if (iph->frag_off & htons(IP_OFFSET))
return NF_DROP;
- tarpit_tcp4(par_net(par), skb, par->state->hook, info->variant);
+ tarpit_tcp4(par_net(par), par->state->sk, skb, par->state->hook,
+ info->variant);
return NF_DROP;
}
pr_debug("addr is not unicast.\n");
return NF_DROP;
}
- tarpit_tcp6(par_net(par), skb, par->state->hook, info->variant);
+ tarpit_tcp6(par_net(par), par->state->sk, skb, par->state->hook,
+ info->variant);
return NF_DROP;
}
#endif