Skip to content

Commit

Permalink
net: dsa: tag_sja1105: appease sparse checks for ethertype accessors
Browse files Browse the repository at this point in the history
A comparison between a value from the packet and an integer constant
value needs to be done by converting the value from the packet from
net->host, or the constant from host->net. Not the other way around.
Even though it makes no practical difference, correct that.

Fixes: 38b5bee ("net: dsa: sja1105: prepare tagger for handling DSA tags and VLAN simultaneously")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed May 13, 2020
1 parent 51fa960 commit fb9f2e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/dsa/tag_sja1105.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ static bool sja1105_can_use_vlan_as_tags(const struct sk_buff *skb)
{
struct vlan_ethhdr *hdr = vlan_eth_hdr(skb);

if (hdr->h_vlan_proto == ntohs(ETH_P_SJA1105))
if (hdr->h_vlan_proto == htons(ETH_P_SJA1105))
return true;

if (hdr->h_vlan_proto != ntohs(ETH_P_8021Q))
if (hdr->h_vlan_proto != htons(ETH_P_8021Q))
return false;

return vid_is_dsa_8021q(ntohs(hdr->h_vlan_TCI) & VLAN_VID_MASK);
Expand Down

0 comments on commit fb9f2e9

Please sign in to comment.