lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Aug 2012 19:48:58 +0000
From:	JamesBetts <jimbob.betts@...glemail.com>
To:	netdev@...r.kernel.org
Cc:	steve@...well.net, JamesBetts <jimbob.betts@...glemail.com>
Subject: [PATCH 001/001] smsc95xx: Fix hard_header_len

This device may require up-to 12 bytes of headroom. Assign the needed_headroom
but stop lying about hard_header_len which is used in other places throughout
the kernel.

Without this patch it is not possible to use "IFB + tc filter ... action ... 
dev ifb0" as per
http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb.

Tested using Raspberry Pi as a router with trafficshaping and IFB.
---
 drivers/net/usb/smsc95xx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 0aee6c0..02293dd 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1071,8 +1071,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
 	dev->net->netdev_ops = &smsc95xx_netdev_ops;
 	dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
 	dev->net->flags |= IFF_MULTICAST;
-	dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
-	dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
+	dev->net->needed_headroom = SMSC95XX_TX_OVERHEAD_CSUM;
+	dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len + dev->net->needed_headroom;
 	return 0;
 }
 
-- 
1.7.4.1.433.gcd306
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists