patch-2.2.13 linux/net/802/tr.c
Next file: linux/net/ax25/af_ax25.c
Previous file: linux/mm/page_alloc.c
Back to the patch index
Back to the overall index
- Lines: 53
- Date:
Tue Oct 19 17:14:02 1999
- Orig file:
v2.2.12/linux/net/802/tr.c
- Orig date:
Sat Apr 24 17:51:48 1999
diff -u --recursive --new-file v2.2.12/linux/net/802/tr.c linux/net/802/tr.c
@@ -189,22 +189,27 @@
skb_pull(skb,sizeof(struct trh_hdr)-TR_MAXRIFLEN+riflen);
- tr_add_rif_info(trh, dev);
-
- if(*trh->daddr & 1)
+ if(*trh->daddr & 0x80)
{
if(!memcmp(trh->daddr,dev->broadcast,TR_ALEN))
skb->pkt_type=PACKET_BROADCAST;
else
skb->pkt_type=PACKET_MULTICAST;
}
-
+ else if ( (trh->daddr[0] & 0x01) && (trh->daddr[1] & 0x00) && (trh->daddr[2] & 0x5E))
+ {
+ skb->pkt_type=PACKET_MULTICAST;
+ }
else if(dev->flags & IFF_PROMISC)
{
if(memcmp(trh->daddr, dev->dev_addr, TR_ALEN))
skb->pkt_type=PACKET_OTHERHOST;
}
+ if ((skb->pkt_type != PACKET_BROADCAST) &&
+ (skb->pkt_type != PACKET_MULTICAST))
+ tr_add_rif_info(trh,dev) ;
+
/*
* Strip the SNAP header from ARP packets since we don't
* pass them through to the 802.2/SNAP layers.
@@ -231,14 +236,18 @@
unsigned int hash;
rif_cache entry;
unsigned char *olddata;
+ unsigned char mcast_func_addr[] = {0xC0,0x00,0x00,0x04,0x00,0x00} ;
+
unsigned long flags;
spin_lock_irqsave(&rif_lock, flags);
/*
* Broadcasts are single route as stated in RFC 1042
- */
- if(!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN))
+ */
+
+ if ( (!memcmp(&(trh->daddr[0]),&(dev->broadcast[0]),TR_ALEN)) ||
+ (!memcmp(&(trh->daddr[0]),&(mcast_func_addr[0]), TR_ALEN)) )
{
trh->rcf=htons((((sizeof(trh->rcf)) << 8) & TR_RCF_LEN_MASK)
| TR_RCF_FRAME2K | TR_RCF_LIMITED_BROADCAST);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)