[PATCH] 2.[45] eexpress.c skb_padto fixes broke pppoe

Shane Shrybman (shrybman@sympatico.ca)
18 Jun 2003 18:28:46 -0400


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-28256-1055975484-0001-2
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Hi,

I posted this to linux-net and didn't get a reply so I am posting it
here. Please cc any replies.

The attached patch fixes the breakage caused by the recent skb_padto
security fixes. It applies to both 2.4.21 and 2.5.72 (with a little
fuzz). I have tested it on 2.4.21 but not on 2.5.

If it looks ok can it be included in 2.4 and 2.5?

Regards,

Shane

--=_courier-28256-1055975484-0001-2
Content-Type: text/x-diff; name="eexpress_skb_padto_fix.diff"; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=eexpress_skb_padto_fix.diff

--- linux-2.4.21aarc8A/drivers/net/eexpress.c.broken Fri Jun 13 10:51:34 2003
+++ linux-2.4.21aarc8A/drivers/net/eexpress.c Mon Jun 16 22:05:55 2003
@@ -640,7 +640,9 @@
static int eexp_xmit(struct sk_buff *buf, struct net_device *dev)
{
struct net_local *lp = (struct net_local *)dev->priv;
- short length = buf->len;
+ unsigned short length = (ETH_ZLEN < buf->len) ? buf->len :
+ ETH_ZLEN;
+
#ifdef CONFIG_SMP
unsigned long flags;
#endif
@@ -654,7 +656,6 @@
buf = skb_padto(buf, ETH_ZLEN);
if(buf == NULL)
return 0;
- length = buf->len;
}

disable_irq(dev->irq);

--=_courier-28256-1055975484-0001-2--