From patchwork Tue Sep 6 18:30:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Brown X-Patchwork-Id: 1674998 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MMYxD5tdMz1yhP for ; Wed, 7 Sep 2022 04:36:00 +1000 (AEST) Received: from localhost ([::1]:50432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVdQU-0008FW-Lo for incoming@patchwork.ozlabs.org; Tue, 06 Sep 2022 14:35:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVdMJ-0003HC-3F for qemu-devel@nongnu.org; Tue, 06 Sep 2022 14:31:39 -0400 Received: from blyat.fensystems.co.uk ([54.246.183.96]:56010) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVdMH-0004sk-In for qemu-devel@nongnu.org; Tue, 06 Sep 2022 14:31:38 -0400 Received: from dolphin.home (unknown [IPv6:2a00:23c6:5486:8700:72b3:d5ff:feb1:e101]) by blyat.fensystems.co.uk (Postfix) with ESMTPSA id 9EE8D44271; Tue, 6 Sep 2022 18:31:34 +0000 (UTC) From: Michael Brown To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Michael Brown Subject: [PATCH 2/4] usbnet: Accept mandatory USB_CDC_SET_ETHERNET_PACKET_FILTER request Date: Tue, 6 Sep 2022 19:30:51 +0100 Message-Id: <20220906183053.3625472-3-mcb30@ipxe.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220906183053.3625472-1-mcb30@ipxe.org> References: <20220906183053.3625472-1-mcb30@ipxe.org> MIME-Version: 1.0 Received-SPF: pass client-ip=54.246.183.96; envelope-from=mcb30@ipxe.org; helo=blyat.fensystems.co.uk X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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: "