- if (skb->protocol == ntohs(ETH_P_802_2))
- memcpy(sa, ((struct ethhdr *)skb->mac.raw)->h_source, ETH_ALEN);
- else if (skb->protocol == ntohs(ETH_P_TR_802_2))
- memcpy(sa, ((struct trh_hdr *)skb->mac.raw)->saddr, ETH_ALEN);
+ if (skb->protocol == htons(ETH_P_802_2))
+ memcpy(sa, eth_hdr(skb)->h_source, ETH_ALEN);
+ else if (skb->protocol == htons(ETH_P_TR_802_2)) {
+ memcpy(sa, tr_hdr(skb)->saddr, ETH_ALEN);
+ *sa &= 0x7F;
+ }