Browse Source

fix xt_* calls on ubuntu 18.04 / linux 4.15

pull/20/head
Stefan Schwarz 6 years ago
parent
commit
48406ee5a1
  1. 2
      src/compat_xtables.h
  2. 2
      src/ts3init_match.c
  3. 2
      src/ts3init_target.c

2
src/compat_xtables.h

@ -90,7 +90,7 @@ static inline void proc_remove(struct proc_dir_entry *de)
static inline struct net *par_net(const struct xt_action_param *par) static inline struct net *par_net(const struct xt_action_param *par)
{ {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
return par->net; return xt_net(par);
#else #else
return dev_net((par->in != NULL) ? par->in : par->out); return dev_net((par->in != NULL) ? par->in : par->out);
#endif #endif

2
src/ts3init_match.c

@ -141,7 +141,7 @@ static inline __u8* get_payload(const struct sk_buff *skb, const struct xt_actio
static int calculate_cookie(const struct sk_buff *skb, const struct xt_action_param *par, static int calculate_cookie(const struct sk_buff *skb, const struct xt_action_param *par,
struct udphdr *udp, __u64 k0, __u64 k1, __u64* out) struct udphdr *udp, __u64 k0, __u64 k1, __u64* out)
{ {
switch (par->family) switch (xt_family(par))
{ {
case NFPROTO_IPV4: case NFPROTO_IPV4:
{ {

2
src/ts3init_target.c

@ -47,7 +47,7 @@ ts3init_send_ipv6_reply(struct sk_buff *oldskb, const struct xt_action_param *pa
struct udphdr *udp; struct udphdr *udp;
struct flowi6 fl; struct flowi6 fl;
struct dst_entry *dst = NULL; struct dst_entry *dst = NULL;
struct net *net = dev_net((par->in != NULL) ? par->in : par->out); struct net *net = dev_net((xt_in(par) != NULL) ? xt_in(par) : xt_out(par));
skb = alloc_skb(LL_MAX_HEADER + sizeof(*ip) + skb = alloc_skb(LL_MAX_HEADER + sizeof(*ip) +
sizeof(*udp) + payload_size, GFP_ATOMIC); sizeof(*udp) + payload_size, GFP_ATOMIC);

Loading…
Cancel
Save