--- net/ethernet/eth.c 2003/01/03 18:20:49 1.1 +++ net/ethernet/eth.c 2003/01/03 18:22:05 @@ -148,6 +148,30 @@ return 0; } +void check_mcast_list(struct sk_buff *skb, struct net_device *dev) +{ + struct dev_mc_list *dmi; + struct ethhdr *eth; + + if (skb->pkt_type != PACKET_OTHERHOST) + return; + + eth = skb->mac.ethernet; + + /* may not be necessary to bh_lock - fix later - JHS */ + spin_lock_bh(&dev->xmit_lock); + + for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { + if (memcmp(dmi->dmi_addr, eth->h_dest, dev->addr_len) == 0 + && dmi->dmi_addrlen == dev->addr_len) { + skb->pkt_type = PACKET_HOST; + break; + } + } + + spin_unlock_bh(&dev->xmit_lock); +} + /* * Determine the packet's protocol ID. The rule here is that we @@ -182,8 +206,14 @@ else if(1 /*dev->flags&IFF_PROMISC*/) { - if(memcmp(eth->h_dest,dev->dev_addr, ETH_ALEN)) - skb->pkt_type=PACKET_OTHERHOST; + if(memcmp(eth->h_dest,dev->dev_addr, ETH_ALEN)) { + skb->pkt_type = PACKET_OTHERHOST; + /* we override PACKET_OTHERHOST if MAC appears + * in our mcast list allows to have several + * allowed MACs for receives added via + * SIOCADDMULTI on the device*/ + check_mcast_list(skb,dev); + } } if (ntohs(eth->h_proto) >= 1536)