patch-2.4.21 linux-2.4.21/drivers/net/fmv18x.c

Next file: linux-2.4.21/drivers/net/hamachi.c
Previous file: linux-2.4.21/drivers/net/fealnx.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/drivers/net/fmv18x.c linux-2.4.21/drivers/net/fmv18x.c
@@ -369,7 +369,7 @@
 {
 	struct net_local *lp = dev->priv;
 	int ioaddr = dev->base_addr;
-	short length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
+	short length = skb->len;
 	unsigned char *buf = skb->data;
 	unsigned long flags;
 
@@ -381,6 +381,15 @@
 				dev->name, length);
 		return 1;
 	}
+	
+	if (length < ETH_ZLEN)
+	{
+		skb = skb_padto(skb, ETH_ZLEN);
+		if(skb == NULL)
+			return 0;
+		length = ETH_ZLEN;
+	}
+	
 	if (net_debug > 4)
 		printk("%s: Transmitting a packet of length %lu.\n", dev->name,
 			   (unsigned long)skb->len);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)