Commit 83865726 authored by David S. Miller's avatar David S. Miller

Merge http://linux-isdn.bkbits.net/linux-2.5.net

into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents 184411aa 1ebb2981
...@@ -1470,64 +1470,6 @@ static void hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) ...@@ -1470,64 +1470,6 @@ static void hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *rgs)
spin_unlock(&hmp->lock); spin_unlock(&hmp->lock);
} }
#ifdef TX_CHECKSUM
/*
* Copied from eth_type_trans(), with reduced header, since we don't
* get it on RX, only on TX.
*/
static unsigned short hamachi_eth_type_trans(struct sk_buff *skb,
struct net_device *dev)
{
struct ethhdr *eth;
unsigned char *rawp;
skb->mac.raw=skb->data;
skb_pull(skb,dev->hard_header_len-8); /* artificially enlarged on tx */
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;
rawp = skb->data;
/*
* This is a magic hack to spot IPX packets. Older Novell breaks
* the protocol design and runs IPX over 802.3 without an 802.2 LLC
* layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
* won't work for fault tolerant netware but does for the rest.
*/
if (*(unsigned short *)rawp == 0xFFFF)
return htons(ETH_P_802_3);
/*
* Real 802.2 LLC
*/
return htons(ETH_P_802_2);
}
#endif /* TX_CHECKSUM */
/* This routine is logically part of the interrupt handler, but seperated /* This routine is logically part of the interrupt handler, but seperated
for clarity and better register allocation. */ for clarity and better register allocation. */
static int hamachi_rx(struct net_device *dev) static int hamachi_rx(struct net_device *dev)
...@@ -1632,12 +1574,7 @@ static int hamachi_rx(struct net_device *dev) ...@@ -1632,12 +1574,7 @@ static int hamachi_rx(struct net_device *dev)
skb_put(skb = hmp->rx_skbuff[entry], pkt_len); skb_put(skb = hmp->rx_skbuff[entry], pkt_len);
hmp->rx_skbuff[entry] = NULL; hmp->rx_skbuff[entry] = NULL;
} }
#ifdef TX_CHECKSUM
/* account for extra TX hard_header bytes */
skb->protocol = hamachi_eth_type_trans(skb, dev);
#else
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
#endif
#ifdef RX_CHECKSUM #ifdef RX_CHECKSUM
......
...@@ -103,16 +103,16 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, ...@@ -103,16 +103,16 @@ int eth_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
if (dev->flags & (IFF_LOOPBACK|IFF_NOARP)) if (dev->flags & (IFF_LOOPBACK|IFF_NOARP))
{ {
memset(eth->h_dest, 0, dev->addr_len); memset(eth->h_dest, 0, dev->addr_len);
return(dev->hard_header_len); return ETH_HLEN;
} }
if(daddr) if(daddr)
{ {
memcpy(eth->h_dest,daddr,dev->addr_len); memcpy(eth->h_dest,daddr,dev->addr_len);
return dev->hard_header_len; return ETH_HLEN;
} }
return -dev->hard_header_len; return -ETH_HLEN;
} }
...@@ -161,7 +161,7 @@ unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev) ...@@ -161,7 +161,7 @@ unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev)
unsigned char *rawp; unsigned char *rawp;
skb->mac.raw=skb->data; skb->mac.raw=skb->data;
skb_pull(skb,dev->hard_header_len); skb_pull(skb,ETH_HLEN);
eth= skb->mac.ethernet; eth= skb->mac.ethernet;
if(*eth->h_dest&1) if(*eth->h_dest&1)
......
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