We should not assume mac header is set in output path.
Use skb_eth_hdr() instead of eth_hdr() to fix the issue,
and remove now redundant skb_reset_mac_header().
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/hyperv/netvsc_drv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 1d43c73fd73f10200ee0c69c9221a2a44971b08a..d78ed0f3a3bd1de37a05187b4d7f499099041668 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -533,8 +533,7 @@ static int netvsc_xmit(struct sk_buff *skb, struct net_device *net, bool xdp_tx)
if (skb->protocol == htons(ETH_P_8021Q)) {
u16 vlan_tci;
- skb_reset_mac_header(skb);
- if (eth_type_vlan(eth_hdr(skb)->h_proto)) {
+ if (eth_type_vlan(skb_eth_hdr(skb)->h_proto)) {
if (unlikely(__skb_vlan_pop(skb, &vlan_tci) != 0)) {
++net_device_ctx->eth_stats.vlan_error;
goto drop;--
2.55.0.966.g6673acef38-goog