Bug in net/ethernet/eth.c ??

Ben Greear (greear@cyberhighway.net)
Mon, 11 Jan 1999 21:14:56 -0700


Found in file: net/ethernet/eth.c, at line# 178 in release 2.1.131...
(Check out the last line of quoted code.)

unsigned short eth_type_trans(struct sk_buff *skb, struct device *dev)
{
struct ethhdr *eth;
unsigned char *rawp;

skb->mac.raw=skb->data;
skb_pull(skb,dev->hard_header_len);
eth= skb->mac.ethernet;

if(*eth->h_dest&1)
{
if(memcmp(eth->h_dest,dev->broadcast, ETH_ALEN)==0)
skb->pkt_type=PACKET_BROADCAST;
else
skb->pkt_type=PACKET_MULTICAST;
}

/*
* This ALLMULTI check should be redundant by 1.4
* so don't forget to remove it.
*
* Seems, you forgot to remove it. All silly devices
* seems to set IFF_PROMISC.
*/

else if(dev->flags&(IFF_PROMISC/*|IFF_ALLMULTI*/))
{
if(memcmp(eth->h_dest,dev->dev_addr, ETH_ALEN))
skb->pkt_type=PACKET_OTHERHOST;
}

if (ntohs(eth->h_proto) >= 1536)
return eth->h_proto;

...

I wonder if that last line should be more like:
return (ntohs(eth->h_proto);

-- 
Ben Greear (greear@cyberhighway.net)  http://www.primenet.com/~greear 
Author of ScryMUD:  mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/