usb/gadget/ether.c minor manycast tweaks
authorDavid Brownell <david-b@pacbell.net>
Mon, 13 Nov 2006 02:09:44 +0000 (18:09 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Dec 2006 22:23:30 +0000 (14:23 -0800)
Minor cleanup/clarification in the ethernet gadget driver, using standard
calls to test for Ethernet multicast and broadcast addresses.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/ether.c

index 1c17d26..3bd1dfe 100644 (file)
@@ -1894,13 +1894,13 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
        if (!eth_is_promisc (dev)) {
                u8              *dest = skb->data;
 
-               if (dest [0] & 0x01) {
+               if (is_multicast_ether_addr(dest)) {
                        u16     type;
 
                        /* ignores USB_CDC_PACKET_TYPE_MULTICAST and host
                         * 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;
                        else
                                type = USB_CDC_PACKET_TYPE_ALL_MULTICAST;