hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/tap.c
....@@ -523,7 +523,7 @@
523523 q->sock.state = SS_CONNECTED;
524524 q->sock.file = file;
525525 q->sock.ops = &tap_socket_ops;
526
- sock_init_data(&q->sock, &q->sk);
526
+ sock_init_data_uid(&q->sock, &q->sk, current_fsuid());
527527 q->sk.sk_write_space = tap_sock_write_space;
528528 q->sk.sk_destruct = tap_sock_destruct;
529529 q->flags = IFF_VNET_HDR | IFF_NO_PI | IFF_TAP;
....@@ -713,9 +713,8 @@
713713 skb_probe_transport_header(skb);
714714
715715 /* Move network header to the right position for VLAN tagged packets */
716
- if ((skb->protocol == htons(ETH_P_8021Q) ||
717
- skb->protocol == htons(ETH_P_8021AD)) &&
718
- __vlan_get_protocol(skb, skb->protocol, &depth) != 0)
716
+ if (eth_type_vlan(skb->protocol) &&
717
+ vlan_get_protocol_and_depth(skb, skb->protocol, &depth) != 0)
719718 skb_set_network_header(skb, depth);
720719
721720 rcu_read_lock();
....@@ -1165,9 +1164,8 @@
11651164 }
11661165
11671166 /* Move network header to the right position for VLAN tagged packets */
1168
- if ((skb->protocol == htons(ETH_P_8021Q) ||
1169
- skb->protocol == htons(ETH_P_8021AD)) &&
1170
- __vlan_get_protocol(skb, skb->protocol, &depth) != 0)
1167
+ if (eth_type_vlan(skb->protocol) &&
1168
+ vlan_get_protocol_and_depth(skb, skb->protocol, &depth) != 0)
11711169 skb_set_network_header(skb, depth);
11721170
11731171 rcu_read_lock();