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:

committed by
David S. Miller

parent
4e26c5fe55
commit
58aa2491aa
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user