aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bridge_loop_avoidance.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.c')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 264de88db320..5bb58d7bdd56 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -863,25 +863,25 @@ static int batadv_bla_process_claim(struct batadv_priv *bat_priv,
863 struct arphdr *arphdr; 863 struct arphdr *arphdr;
864 uint8_t *hw_src, *hw_dst; 864 uint8_t *hw_src, *hw_dst;
865 struct batadv_bla_claim_dst *bla_dst; 865 struct batadv_bla_claim_dst *bla_dst;
866 uint16_t proto; 866 __be16 proto;
867 int headlen; 867 int headlen;
868 unsigned short vid = BATADV_NO_FLAGS; 868 unsigned short vid = BATADV_NO_FLAGS;
869 int ret; 869 int ret;
870 870
871 ethhdr = eth_hdr(skb); 871 ethhdr = eth_hdr(skb);
872 872
873 if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) { 873 if (ethhdr->h_proto == htons(ETH_P_8021Q)) {
874 vhdr = (struct vlan_ethhdr *)ethhdr; 874 vhdr = (struct vlan_ethhdr *)ethhdr;
875 vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK; 875 vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK;
876 vid |= BATADV_VLAN_HAS_TAG; 876 vid |= BATADV_VLAN_HAS_TAG;
877 proto = ntohs(vhdr->h_vlan_encapsulated_proto); 877 proto = vhdr->h_vlan_encapsulated_proto;
878 headlen = sizeof(*vhdr); 878 headlen = sizeof(*vhdr);
879 } else { 879 } else {
880 proto = ntohs(ethhdr->h_proto); 880 proto = ethhdr->h_proto;
881 headlen = ETH_HLEN; 881 headlen = ETH_HLEN;
882 } 882 }
883 883
884 if (proto != ETH_P_ARP) 884 if (proto != htons(ETH_P_ARP))
885 return 0; /* not a claim frame */ 885 return 0; /* not a claim frame */
886 886
887 /* this must be a ARP frame. check if it is a claim. */ 887 /* this must be a ARP frame. check if it is a claim. */
@@ -1379,8 +1379,8 @@ int batadv_bla_is_backbone_gw(struct sk_buff *skb,
1379 1379
1380 ethhdr = (struct ethhdr *)(((uint8_t *)skb->data) + hdr_size); 1380 ethhdr = (struct ethhdr *)(((uint8_t *)skb->data) + hdr_size);
1381 1381
1382 if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) { 1382 if (ethhdr->h_proto == htons(ETH_P_8021Q)) {
1383 if (!pskb_may_pull(skb, hdr_size + sizeof(struct vlan_ethhdr))) 1383 if (!pskb_may_pull(skb, hdr_size + VLAN_ETH_HLEN))
1384 return 0; 1384 return 0;
1385 1385
1386 vhdr = (struct vlan_ethhdr *)(skb->data + hdr_size); 1386 vhdr = (struct vlan_ethhdr *)(skb->data + hdr_size);