Commit d8126a0c authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

usb/gadget/ether.c minor manycast tweaks

Minor cleanup/clarification in the ethernet gadget driver, using standard
calls to test for Ethernet multicast and broadcast addresses.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1bb5f66b
...@@ -1894,13 +1894,13 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net) ...@@ -1894,13 +1894,13 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
if (!eth_is_promisc (dev)) { if (!eth_is_promisc (dev)) {
u8 *dest = skb->data; u8 *dest = skb->data;
if (dest [0] & 0x01) { if (is_multicast_ether_addr(dest)) {
u16 type; u16 type;
/* ignores USB_CDC_PACKET_TYPE_MULTICAST and host /* ignores USB_CDC_PACKET_TYPE_MULTICAST and host
* SET_ETHERNET_MULTICAST_FILTERS requests * SET_ETHERNET_MULTICAST_FILTERS requests
*/ */
if (memcmp (dest, net->broadcast, ETH_ALEN) == 0) if (is_broadcast_ether_addr(dest))
type = USB_CDC_PACKET_TYPE_BROADCAST; type = USB_CDC_PACKET_TYPE_BROADCAST;
else else
type = USB_CDC_PACKET_TYPE_ALL_MULTICAST; type = USB_CDC_PACKET_TYPE_ALL_MULTICAST;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment