diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
-index d18eb60..739a98a 100644
+index f184fb5..0e08522 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -234,6 +234,125 @@ config RIONET_RX_SIZE
obj-$(CONFIG_MII) += mii.o
diff --git a/drivers/net/imq.c b/drivers/net/imq.c
new file mode 100644
-index 0000000..c60929b
+index 0000000..f80258f
--- /dev/null
+++ b/drivers/net/imq.c
@@ -0,0 +1,903 @@
+ struct nf_queue_entry *entry = kmemdup(e, e->size, GFP_ATOMIC);
+ if (entry) {
+ nf_queue_entry_get_refs(entry);
-+ return entry;
++ return entry;
+ }
+ return NULL;
+}
+#endif /* _IMQ_H */
+
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
-index 2d15e38..ebbecce 100644
+index 3143c84..e213b31 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -3330,6 +3330,19 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
+@@ -3341,6 +3341,19 @@ static inline void netif_tx_unlock_bh(struct net_device *dev)
} \
}
+#endif /* _IP6T_IMQ_H */
+
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
-index 2b0a30a..f8e727c 100644
+index 4355129..47914c0 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -38,6 +38,10 @@
/* A. Checksumming of received packets by device.
*
-@@ -557,6 +561,9 @@ struct sk_buff {
+@@ -566,6 +570,9 @@ struct sk_buff {
* first. This is owned by whoever has the skb queued ATM.
*/
char cb[48] __aligned(8);
unsigned long _skb_refdst;
void (*destructor)(struct sk_buff *skb);
-@@ -566,6 +573,9 @@ struct sk_buff {
+@@ -575,6 +582,9 @@ struct sk_buff {
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
struct nf_conntrack *nfct;
#endif
#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
struct nf_bridge_info *nf_bridge;
#endif
-@@ -633,6 +643,9 @@ struct sk_buff {
+@@ -642,6 +652,9 @@ struct sk_buff {
__u8 inner_protocol_type:1;
__u8 remcsum_offload:1;
/* 3 or 5 bit hole */
#ifdef CONFIG_NET_SCHED
__u16 tc_index; /* traffic control index */
-@@ -789,6 +802,12 @@ void kfree_skb_list(struct sk_buff *segs);
+@@ -798,6 +811,12 @@ void kfree_skb_list(struct sk_buff *segs);
void skb_tx_error(struct sk_buff *skb);
void consume_skb(struct sk_buff *skb);
void __kfree_skb(struct sk_buff *skb);
extern struct kmem_cache *skbuff_head_cache;
void kfree_skb_partial(struct sk_buff *skb, bool head_stolen);
-@@ -3335,6 +3354,10 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src,
+@@ -3344,6 +3363,10 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src,
if (copy)
dst->nfctinfo = src->nfctinfo;
#endif
dst->nf_bridge = src->nf_bridge;
nf_bridge_get(src->nf_bridge);
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
-index e863585..40904cb 100644
+index 9c5638a..b173aa7 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -31,6 +31,12 @@ struct nf_queue_handler {
+void nf_unregister_queue_imq_handler(void);
+#endif
- bool nf_queue_entry_get_refs(struct nf_queue_entry *entry);
+ void nf_queue_entry_get_refs(struct nf_queue_entry *entry);
void nf_queue_entry_release_refs(struct nf_queue_entry *entry);
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 401038d..4668849 100644
{
if (qdisc_run_begin(q))
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
-index 444faa8..e652d8d 100644
+index b2a8e63..d9feaa3 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
-@@ -502,6 +502,12 @@ static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
+@@ -506,6 +506,12 @@ static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
return sch->enqueue(skb, sch);
}
/* we overload the higher bits for encoding auxiliary data such as the queue
* number or errno values. Not nice, but better than additional function
diff --git a/net/core/dev.c b/net/core/dev.c
-index 6bb6470..13cda63 100644
+index ae00b89..1cdcd02 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -136,6 +136,9 @@
+@@ -137,6 +137,9 @@
#include <linux/errqueue.h>
#include <linux/hrtimer.h>
#include <linux/netfilter_ingress.h>
#include "net-sysfs.h"
-@@ -2675,7 +2678,12 @@ static int xmit_one(struct sk_buff *skb, struct net_device *dev,
+@@ -2705,7 +2708,12 @@ static int xmit_one(struct sk_buff *skb, struct net_device *dev,
unsigned int len;
int rc;
dev_queue_xmit_nit(skb, dev);
len = skb->len;
-@@ -2713,6 +2721,7 @@ out:
+@@ -2743,6 +2751,7 @@ out:
*ret = rc;
return skb;
}
static struct sk_buff *validate_xmit_vlan(struct sk_buff *skb,
netdev_features_t features)
-@@ -2801,6 +2810,7 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d
+@@ -2831,6 +2840,7 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d
}
return head;
}
static void qdisc_pkt_len_init(struct sk_buff *skb)
{
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
-index dad4dd3..9c71959 100644
+index b2df375..bc3c51e 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -79,6 +79,87 @@
/* Note : this field could be in headers_start/headers_end section
* It is not yet because we do not want to have a 16 bit hole
-@@ -3324,6 +3431,13 @@ void __init skb_init(void)
+@@ -3325,6 +3432,13 @@ void __init skb_init(void)
0,
SLAB_HWCACHE_ALIGN|SLAB_PANIC,
NULL);
/**
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
-index 92b1aa3..e5a5dd5 100644
+index e6a7bd15..c81496e 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
-@@ -64,9 +64,6 @@ static int ip6_finish_output2(struct sock *sk, struct sk_buff *skb)
+@@ -65,9 +65,6 @@ static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *
struct in6_addr *nexthop;
int ret;
if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr)) {
struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb));
-@@ -143,6 +140,13 @@ int ip6_output(struct sock *sk, struct sk_buff *skb)
+@@ -142,6 +139,13 @@ int ip6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
return 0;
}
net, sk, skb, NULL, dev,
ip6_finish_output,
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
-index 3e1b4ab..8721e48 100644
+index 4692782..dce47db 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
-@@ -784,6 +784,18 @@ config NETFILTER_XT_TARGET_LOG
+@@ -785,6 +785,18 @@ config NETFILTER_XT_TARGET_LOG
To compile it as a module, choose M here. If unsure, say N.
tristate '"MARK" target support'
depends on NETFILTER_ADVANCED
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
-index 70d026d..5469b14 100644
+index 7638c36..614ad8a 100644
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
-@@ -110,6 +110,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CT) += xt_CT.o
+@@ -108,6 +108,7 @@ obj-$(CONFIG_NETFILTER_XT_TARGET_CT) += xt_CT.o
obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o
obj-$(CONFIG_NETFILTER_XT_TARGET_HL) += xt_HL.o
obj-$(CONFIG_NETFILTER_XT_TARGET_HMARK) += xt_HMARK.o
obj-$(CONFIG_NETFILTER_XT_TARGET_LOG) += xt_LOG.o
obj-$(CONFIG_NETFILTER_XT_TARGET_NETMAP) += xt_NETMAP.o
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
-index 8e47f81..fa4ddd3 100644
+index f39276d..9877a27 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
-@@ -309,9 +309,11 @@ next_hook:
+@@ -311,9 +311,11 @@ next_hook:
ret = NF_DROP_GETERR(verdict);
if (ret == 0)
ret = -EPERM;
+ verdict >> NF_VERDICT_QBITS,
+ verdict & NF_VERDICT_MASK);
if (err < 0) {
- if (err == -ECANCELED)
- goto next_hook;
+ if (err == -ESRCH &&
+ (verdict & NF_VERDICT_FLAG_QUEUE_BYPASS))
diff --git a/net/netfilter/nf_internals.h b/net/netfilter/nf_internals.h
index 0655225..25d4141 100644
--- a/net/netfilter/nf_internals.h
int __init netfilter_queue_init(void);
diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
-index 96777f9..c42d671 100644
+index 5baa8e2..9740e8c 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -28,6 +28,23 @@
/* return EBUSY when somebody else is registered, return EEXIST if the
* same handler is registered, return 0 in case of success. */
void nf_register_queue_handler(const struct nf_queue_handler *qh)
-@@ -123,7 +140,8 @@ void nf_queue_nf_hook_drop(struct net *net, struct nf_hook_ops *ops)
+@@ -116,7 +133,8 @@ void nf_queue_nf_hook_drop(struct net *net, struct nf_hook_ops *ops)
int nf_queue(struct sk_buff *skb,
struct nf_hook_ops *elem,
struct nf_hook_state *state,
{
int status = -ENOENT;
struct nf_queue_entry *entry = NULL;
-@@ -133,7 +151,17 @@ int nf_queue(struct sk_buff *skb,
+@@ -124,7 +142,17 @@ int nf_queue(struct sk_buff *skb,
const struct nf_queue_handler *qh;
/* QUEUE == DROP if no one is waiting, to be safe. */
+
if (!qh) {
status = -ESRCH;
- goto err_unlock;
-@@ -219,8 +247,10 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
+ goto err;
+@@ -199,8 +227,10 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
local_bh_enable();
break;
case NF_QUEUE:
+ verdict >> NF_VERDICT_QBITS,
+ verdict & NF_VERDICT_MASK);
if (err < 0) {
- if (err == -ECANCELED)
- goto next_hook;
+ if (err == -ESRCH &&
+ (verdict & NF_VERDICT_FLAG_QUEUE_BYPASS))
diff --git a/net/netfilter/xt_IMQ.c b/net/netfilter/xt_IMQ.c
new file mode 100644
index 0000000..86d7b84
+MODULE_ALIAS("ip6t_IMQ");
+
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
-index cb5d4ad..0d818be 100644
+index e82a1ad..b55331d 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -108,6 +108,14 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate,