--- zzzz-none-000/linux-2.6.39.4/drivers/net/usb/cdc_ether.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/drivers/net/usb/cdc_ether.c 2021-11-10 13:23:10.000000000 +0000 @@ -127,7 +127,10 @@ memset(info, 0, sizeof *info); info->control = intf; - while (len > 3) { + + /* == 20180119 AVM/WKR cdc parse security ported from cdc_ncm driver ==*/ + while ((len > 0) && (buf[0] > 2) && (buf[0] <= len)) { + if (buf [1] != USB_DT_CS_INTERFACE) goto next_desc; @@ -164,7 +167,11 @@ "ACM capabilities %02x, " "not really RNDIS?\n", acm->bmCapabilities); + +/* 20160715 AVM/WK: Fix from AVM-Kernel 2.6.32 for buggy ZTE rndis modems, ignore buggy descriptor */ +#if 0 goto bad_desc; +#endif } } break; @@ -326,6 +333,22 @@ usb_driver_release_interface(driver, info->data); return -ENODEV; } + + /* Some devices don't initialise properly. In particular + * the packet filter is not reset. There are devices that + * don't do reset all the way. So the packet filter should + * be set to a sane initial value. + */ + usb_control_msg(dev->udev, + usb_sndctrlpipe(dev->udev, 0), + USB_CDC_SET_ETHERNET_PACKET_FILTER, + USB_TYPE_CLASS | USB_RECIP_INTERFACE, + USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | USB_CDC_PACKET_TYPE_BROADCAST, + intf->cur_altsetting->desc.bInterfaceNumber, + NULL, + 0, + USB_CTRL_SET_TIMEOUT + ); return 0; bad_desc: