[PATCH 2/4] usbnet: Accept mandatory USB_CDC_SET_ETHERNET_PACKET_FILTER request

Michael Brown posted 4 patches 3 years, 5 months ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>
[PATCH 2/4] usbnet: Accept mandatory USB_CDC_SET_ETHERNET_PACKET_FILTER request
Posted by Michael Brown 3 years, 5 months ago
The USB_CDC_SET_ETHERNET_PACKET_FILTER request is mandatory for
CDC-ECM devices.  Accept this request, ignoring the actual filter
value (to match the existing behaviour for RNDIS).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
---
 hw/usb/dev-network.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 61bf598870..155df935cd 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1122,6 +1122,12 @@ static void usb_net_handle_control(USBDevice *dev, USBPacket *p,
 #endif
         break;
 
+    case ClassInterfaceOutRequest | USB_CDC_SET_ETHERNET_PACKET_FILTER:
+        if (is_rndis(s)) {
+            goto fail;
+        }
+        break;
+
     default:
     fail:
         fprintf(stderr, "usbnet: failed control transaction: "
-- 
2.35.1