]> err.no Git - linux-2.6/commitdiff
[IRDA]: Set proper IrLAP device address length
authorSamuel Ortiz <samuel.ortiz@nokia.com>
Fri, 10 Feb 2006 00:58:46 +0000 (16:58 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2006 00:58:46 +0000 (16:58 -0800)
This patch set IrDA's addr_len properly, i.e to 4 bytes, the size of the
IrLAP device address.

Signed-off-by: Samuel Ortiz <samuel.ortiz@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/irda/irlap.h
net/irda/irda_device.c

index f55e86e75030e1b4170bf033f8b68d5bb8809fcc..2127cae1e0a68d9818daa7c05a368d7b1c2e4b7b 100644 (file)
@@ -50,6 +50,9 @@
 /* May be different when we get VFIR */
 #define LAP_MAX_HEADER (LAP_ADDR_HEADER + LAP_CTRL_HEADER)
 
+/* Each IrDA device gets a random 32 bits IRLAP device address */
+#define LAP_ALEN 4
+
 #define BROADCAST  0xffffffff /* Broadcast device address */
 #define CBROADCAST 0xfe       /* Connection broadcast address */
 #define XID_FORMAT 0x01       /* Discovery XID format */
index 890bac0d4a56a310d530156aaf89501fee7c8b4a..e3debbdb67f5a0272db139cda75eef326e0db71b 100644 (file)
@@ -343,12 +343,12 @@ static void irda_task_timer_expired(void *data)
 static void irda_device_setup(struct net_device *dev)
 {
         dev->hard_header_len = 0;
-        dev->addr_len        = 0;
+        dev->addr_len        = LAP_ALEN;
 
         dev->type            = ARPHRD_IRDA;
         dev->tx_queue_len    = 8; /* Window size + 1 s-frame */
 
-       memset(dev->broadcast, 0xff, 4);
+       memset(dev->broadcast, 0xff, LAP_ALEN);
 
        dev->mtu = 2048;
        dev->flags = IFF_NOARP;