fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / irda / irlan / irlan_eth.c
index 04bb892..b0ccc45 100644 (file)
@@ -25,7 +25,6 @@
  *     
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/inetdevice.h>
@@ -222,7 +221,13 @@ int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb)
                ++self->stats.rx_dropped; 
                return 0;
        }
-       ASSERT(skb->len > 1, return 0;);
+       if (skb->len < ETH_HLEN) {
+               IRDA_DEBUG(0, "%s() : IrLAN frame too short (%d)\n",
+                          __FUNCTION__, skb->len);
+               ++self->stats.rx_dropped; 
+               dev_kfree_skb(skb);
+               return 0;
+       }
                
        /* 
         * Adopt this frame! Important to set all these fields since they 
@@ -261,12 +266,12 @@ void irlan_eth_flow_indication(void *instance, void *sap, LOCAL_FLOW flow)
 
        self = (struct irlan_cb *) instance;
 
-       ASSERT(self != NULL, return;);
-       ASSERT(self->magic == IRLAN_MAGIC, return;);
+       IRDA_ASSERT(self != NULL, return;);
+       IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;);
        
        dev = self->dev;
 
-       ASSERT(dev != NULL, return;);
+       IRDA_ASSERT(dev != NULL, return;);
        
        IRDA_DEBUG(0, "%s() : flow %s ; running %d\n", __FUNCTION__,
                   flow == FLOW_STOP ? "FLOW_STOP" : "FLOW_START",
@@ -304,7 +309,7 @@ void irlan_eth_send_gratuitous_arp(struct net_device *dev)
 #ifdef CONFIG_INET
        IRDA_DEBUG(4, "IrLAN: Sending gratuitous ARP\n");
        rcu_read_lock();
-       in_dev = __in_dev_get(dev);
+       in_dev = __in_dev_get_rcu(dev);
        if (in_dev == NULL)
                goto out;
        if (in_dev->ifa_list)
@@ -340,7 +345,7 @@ static void irlan_eth_set_multicast_list(struct net_device *dev)
 
        if (dev->flags & IFF_PROMISC) {
                /* Enable promiscuous mode */
-               WARNING("Promiscous mode not implemented by IrLAN!\n");
+               IRDA_WARNING("Promiscous mode not implemented by IrLAN!\n");
        } 
        else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) {
                /* Disable promiscuous mode, use normal mode. */