s390/qeth: extract helper to determine L2 cast type

This de-duplicates the L2 and L3 cast-type code, and makes the L2 code
a bit more robust by removing the fragile assumption that skb->data
always points to the Ethernet Header. This would break in code paths
where we pushed the HW header onto the skb.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Julian Wiedmann
2019-04-25 18:26:00 +02:00
committed by David S. Miller
parent 4e26c5fe55
commit 58aa2491aa
3 changed files with 14 additions and 18 deletions

View File

@@ -1918,13 +1918,7 @@ static int qeth_l3_get_cast_type(struct sk_buff *skb)
RTN_MULTICAST : RTN_UNICAST;
default:
/* ... and MAC address */
if (ether_addr_equal_64bits(eth_hdr(skb)->h_dest,
skb->dev->broadcast))
return RTN_BROADCAST;
if (is_multicast_ether_addr(eth_hdr(skb)->h_dest))
return RTN_MULTICAST;
/* default to unicast */
return RTN_UNICAST;
return qeth_get_ether_cast_type(skb);
}
}