Code: Select all
--- a/drivers/ipoe/ipoe.c.orig 2016-02-20 21:39:41.000000000 +0000
+++ b/drivers/ipoe/ipoe.c 2016-02-20 21:42:03.140000000 +0000
@@ -512,7 +513,11 @@
skb->vlan_tci = 0;
skb_set_queue_mapping(skb, 0);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
+ ip_local_out(pick_net(skb), skb->sk, skb);
+#else
- ip_local_out(skb);
+#endif
return NETDEV_TX_OK;
} else {
@@ -770,8 +775,10 @@
static unsigned int ipt_in_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *skb))
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
static unsigned int ipt_in_hook(const struct nf_hook_ops *ops, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *skb))
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
static unsigned int ipt_in_hook(const struct nf_hook_ops *ops, struct sk_buff *skb, const struct nf_hook_state *state)
+#else
+static unsigned int ipt_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state)
#endif
{
struct ipoe_session *ses = NULL;
@@ -884,8 +891,10 @@
static unsigned int ipt_out_hook(unsigned int hook, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *skb))
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
static unsigned int ipt_out_hook(const struct nf_hook_ops *ops, struct sk_buff *skb, const struct net_device *in, const struct net_device *out, int (*okfn)(struct sk_buff *skb))
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
static unsigned int ipt_out_hook(const struct nf_hook_ops *ops, struct sk_buff *skb, const struct nf_hook_state *state)
+#else
+static unsigned int ipt_out_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state)
#endif
{
int noff, iif;
@@ -2116,21 +2125,18 @@
.pf = PF_INET,
.hooknum = NF_INET_POST_ROUTING,
.priority = NF_IP_PRI_LAST,
- .owner = THIS_MODULE,
},
{
.hook = ipt_out_hook,
.pf = PF_INET,
.hooknum = NF_INET_LOCAL_OUT,
.priority = NF_IP_PRI_LAST,
- .owner = THIS_MODULE,
},
{
.hook = ipt_in_hook,
.pf = PF_INET,
.hooknum = NF_INET_PRE_ROUTING,
.priority = NF_IP_PRI_FIRST,
- .owner = THIS_MODULE,
},
};