diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2014-08-07 16:22:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-07 19:02:58 -0400 |
commit | 4e48ed883c72e78c5a910f8831ffe90c9b18f0ec (patch) | |
tree | fa600b832729d7a69ecf42af27eca5e7ec396135 | |
parent | 6f2c9bd85eee30fd77e6c65c097769ad0d6d7352 (diff) |
netlink: reset network header before passing to taps
netlink doesn't set any network header offset thus when the skb is
being passed to tap devices via dev_queue_xmit_nit(), it emits klog
false positives due to it being unset like:
...
[ 124.990397] protocol 0000 is buggy, dev nlmon0
[ 124.990411] protocol 0000 is buggy, dev nlmon0
...
So just reset the network header before passing to the device; for
packet sockets that just means nothing will change - mac and net
offset hold the same value just as before.
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/netlink/af_netlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index a324b4b34c90..2e152e5f2186 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -213,7 +213,7 @@ static int __netlink_deliver_tap_skb(struct sk_buff *skb, | |||
213 | nskb->protocol = htons((u16) sk->sk_protocol); | 213 | nskb->protocol = htons((u16) sk->sk_protocol); |
214 | nskb->pkt_type = netlink_is_kernel(sk) ? | 214 | nskb->pkt_type = netlink_is_kernel(sk) ? |
215 | PACKET_KERNEL : PACKET_USER; | 215 | PACKET_KERNEL : PACKET_USER; |
216 | 216 | skb_reset_network_header(nskb); | |
217 | ret = dev_queue_xmit(nskb); | 217 | ret = dev_queue_xmit(nskb); |
218 | if (unlikely(ret > 0)) | 218 | if (unlikely(ret > 0)) |
219 | ret = net_xmit_errno(ret); | 219 | ret = net_xmit_errno(ret); |