Skip to content

Commit a348292

Browse files
ffainellidavem330
authored andcommitted
net: dsa: Obtain VLAN protocol from skb->protocol
Now that dsa_untag_bridge_pvid() is called after eth_type_trans() we are guaranteed that skb->protocol will be set to a correct value, thus allowing us to avoid calling vlan_eth_hdr(). Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1c5ad5a commit a348292

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎net/dsa/dsa_priv.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ dsa_slave_to_master(const struct net_device *dev)
201201
static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb)
202202
{
203203
struct dsa_port *dp = dsa_slave_to_port(skb->dev);
204-
struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);
205204
struct net_device *br = dp->bridge_dev;
206205
struct net_device *dev = skb->dev;
207206
struct net_device *upper_dev;
@@ -217,7 +216,7 @@ static inline struct sk_buff *dsa_untag_bridge_pvid(struct sk_buff *skb)
217216
return skb;
218217

219218
/* Move VLAN tag from data to hwaccel */
220-
if (!skb_vlan_tag_present(skb) && hdr->h_vlan_proto == htons(proto)) {
219+
if (!skb_vlan_tag_present(skb) && skb->protocol == htons(proto)) {
221220
skb = skb_vlan_untag(skb);
222221
if (!skb)
223222
return NULL;

0 commit comments

Comments
 (0)