Skip to content

Commit 4e48ed8

Browse files
Daniel Borkmanndavem330
authored andcommitted
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>
1 parent 6f2c9bd commit 4e48ed8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/netlink/af_netlink.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int __netlink_deliver_tap_skb(struct sk_buff *skb,
213213
nskb->protocol = htons((u16) sk->sk_protocol);
214214
nskb->pkt_type = netlink_is_kernel(sk) ?
215215
PACKET_KERNEL : PACKET_USER;
216-
216+
skb_reset_network_header(nskb);
217217
ret = dev_queue_xmit(nskb);
218218
if (unlikely(ret > 0))
219219
ret = net_xmit_errno(ret);

0 commit comments

Comments
 (0)