Commit 7b8dfe28 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nfnetlink_queue: fix missing HW protocol

Locally generated IPv4 and IPv6 traffic gets skb->protocol unset,
thus passing zero.

ip6tables -I OUTPUT -j NFQUEUE
libmnl/examples/netfilter# ./nf-queue 0 &
ping6 ::1
packet received (id=1 hw=0x0000 hook=3)
                         ^^^^^^
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 409b545a
...@@ -637,9 +637,6 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum) ...@@ -637,9 +637,6 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
if (queue->copy_mode == NFQNL_COPY_NONE) if (queue->copy_mode == NFQNL_COPY_NONE)
return -EINVAL; return -EINVAL;
if ((queue->flags & NFQA_CFG_F_GSO) || !skb_is_gso(entry->skb))
return __nfqnl_enqueue_packet(net, queue, entry);
skb = entry->skb; skb = entry->skb;
switch (entry->pf) { switch (entry->pf) {
...@@ -651,6 +648,9 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum) ...@@ -651,6 +648,9 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
break; break;
} }
if ((queue->flags & NFQA_CFG_F_GSO) || !skb_is_gso(skb))
return __nfqnl_enqueue_packet(net, queue, entry);
nf_bridge_adjust_skb_data(skb); nf_bridge_adjust_skb_data(skb);
segs = skb_gso_segment(skb, 0); segs = skb_gso_segment(skb, 0);
/* Does not use PTR_ERR to limit the number of error codes that can be /* Does not use PTR_ERR to limit the number of error codes that can be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment