The MTU throttle-down if a RNDIS device doesn't support a particular
packet size is being incorrectly logged. The attempted packet size is
being clobbered before it gets logged.
First patch; please inform if I'm doing this incorrectly. Diff'd
against latest official source as per the FAQ; forward port to current
git version is straightforward.
Signed-off-by: George Nassar <george.nassar@xxxxxxxxx>
diff -ur linux-2.6.31.4/drivers/net/usb/rndis_host.c linux/drivers/net/usb/rndis_host.c
--- linux-2.6.31.4/drivers/net/usb/rndis_host.c 2009-10-12 15:15:40.000000000 -0500
+++ linux/drivers/net/usb/rndis_host.c 2009-10-14 18:14:07.802625000 -0500
@@ -354,12 +354,12 @@
retval = -EINVAL;
goto halt_fail_and_release;
}
- dev->hard_mtu = tmp;
- net->mtu = dev->hard_mtu - net->hard_header_len;
dev_warn(&intf->dev,
"dev can't take %u byte packets (max %u), "
"adjusting MTU to %u\n",
- dev->hard_mtu, tmp, net->mtu);
+ dev->hard_mtu, tmp, tmp - net->hard_header_len);
+ dev->hard_mtu = tmp;
+ net->mtu = dev->hard_mtu - net->hard_header_len;
}
/* REVISIT: peripheral "alignment" request is ignored ... */