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

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

diff -urN linux-2.4.20/drivers/net/am79c961a.c linux-2.4.21/drivers/net/am79c961a.c
@@ -409,10 +409,19 @@
 am79c961_sendpacket(struct sk_buff *skb, struct net_device *dev)
 {
 	struct dev_priv *priv = (struct dev_priv *)dev->priv;
-	unsigned int length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
+	unsigned int length = skb->len;
 	unsigned int hdraddr, bufaddr;
 	unsigned int head;
 	unsigned long flags;
+	
+	/* FIXME: I thought the 79c961 could do padding - RMK ??? */
+	if(length < ETH_ZLEN)
+	{
+		skb = skb_padto(skb, ETH_ZLEN);
+		if(skb == NULL)
+			return 0;
+		length = ETH_ZLEN;
+	}
 
 	head = priv->txhead;
 	hdraddr = priv->txhdr + (head << 3);

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