Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecf4ee41 authored by Shmulik Ladkani's avatar Shmulik Ladkani Committed by David S. Miller
Browse files

net: skbuff: Coding: Use eth_type_vlan() instead of open coding it



Fix 'skb_vlan_pop' to use eth_type_vlan instead of directly comparing
skb->protocol to ETH_P_8021Q or ETH_P_8021AD.

Signed-off-by: default avatarShmulik Ladkani <shmulik.ladkani@gmail.com>
Reviewed-by: default avatarPravin B Shelar <pshelar@ovn.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 636c2628
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -4567,8 +4567,7 @@ int skb_vlan_pop(struct sk_buff *skb)
	if (likely(skb_vlan_tag_present(skb))) {
		skb->vlan_tci = 0;
	} else {
		if (unlikely(skb->protocol != htons(ETH_P_8021Q) &&
			     skb->protocol != htons(ETH_P_8021AD)))
		if (unlikely(!eth_type_vlan(skb->protocol)))
			return 0;

		err = __skb_vlan_pop(skb, &vlan_tci);
@@ -4576,8 +4575,7 @@ int skb_vlan_pop(struct sk_buff *skb)
			return err;
	}
	/* move next vlan tag to hw accel tag */
	if (likely(skb->protocol != htons(ETH_P_8021Q) &&
		   skb->protocol != htons(ETH_P_8021AD)))
	if (likely(!eth_type_vlan(skb->protocol)))
		return 0;

	vlan_proto = skb->protocol;