Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp657593ybg; Thu, 19 Mar 2020 06:31:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtKawR7p5xEOllr+MSjfMltLSLF7zqKvv562dHh1liD8xYb2cZfI3UUMmi2nyMH7Y6bIQbv X-Received: by 2002:a9d:282:: with SMTP id 2mr2288219otl.178.1584624713460; Thu, 19 Mar 2020 06:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584624713; cv=none; d=google.com; s=arc-20160816; b=MbTaOLoMEra+0aJmjsCOzpGmYCiOMnQhqPXKfTy20n8hhvKyl/52CwM1rzmVtzckfX ZDFERPq6NIk3pLgPaLG+yvCVhl9++O3YDI9iBiw0BGJ1qVXnGIbvIJO1myov+DLzlQod XynP7QH4yzqrZJIXmY8ceM612gmwOmfZRcOz4IJBJ1uG/ETba3CAV0GMUyurzy6sp22O EOYQUxM4WQRUXAP+cce3RSJsXJ3F1GtBmrnN5+5EioYtd8NCk34KGcTaW52/kH05BA88 l7kRSBQKdAe/ZANrNSpPfMrZ9TywGDMZTQBHFlPdsKzKxD24ksO0QKR9QsUMB/5rd23w Vxwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GgpvC+/xbWGHjt6NfyI6qpQwFM2HQwbZ7gbGv0Ngjl0=; b=LgJHz7hEunH5qxdrsPHEGvkiv/L8jjsIAqRriy42IpihTVyTGp2s8qrGMvCdjgbUkI XJSX3p6GmptCo8IdjHQYm1vkzALleQXeTeCRE0NgZE8Q0EHzi2Zpcc8Cri185r6ME9yP OQfx71qLRkq2eY2uWMvqnmB7hlHfp0TOoqfgIJAu5O+nbc7wX9lZng904KmsBS0Sf7NR BNKbSgLZmEWJV57Wpoky1aCT5qSRQrU3rno3IJXROyIi8c72gx/ybBD0Au/0RYXTs7UK tAaKe8cPPgzjk5waJcSgo1GWj05upfsyaZslNv70yWZq0KarwzIDyeJw4T2VhLF75Swb AJXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kZjAWD5b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23si1361271oti.18.2020.03.19.06.31.41; Thu, 19 Mar 2020 06:31:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kZjAWD5b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729762AbgCSNSP (ORCPT + 99 others); Thu, 19 Mar 2020 09:18:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:40164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729584AbgCSNSM (ORCPT ); Thu, 19 Mar 2020 09:18:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98E5421556; Thu, 19 Mar 2020 13:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584623892; bh=B7+I1mSmsDqDgm4UDj9cbHnSmDsai94jiaEQVKiE0ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kZjAWD5bUvXFWI08Y7lz8KxqzbkXfRzJDzAAec79QINQsFdWOhQVhGFJWmx2yzqKa RazdkgQwxYGFPa3hW+xsym4rm2v6lErevibM1hmcwQMt/7RR8L2ixR8GXqgxsUb9KF XUJfQquC4NsW8C4csxcoLpyOp9Mh7MaqaYLtqx64= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniele Palmas , =?UTF-8?q?Bj=C3=B8rn=20Mork?= , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 88/99] net: usb: qmi_wwan: restore mtu min/max values after raw_ip switch Date: Thu, 19 Mar 2020 14:04:06 +0100 Message-Id: <20200319124006.527255358@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200319123941.630731708@linuxfoundation.org> References: <20200319123941.630731708@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniele Palmas [ Upstream commit eae7172f8141eb98e64e6e81acc9e9d5b2add127 ] usbnet creates network interfaces with min_mtu = 0 and max_mtu = ETH_MAX_MTU. These values are not modified by qmi_wwan when the network interface is created initially, allowing, for example, to set mtu greater than 1500. When a raw_ip switch is done (raw_ip set to 'Y', then set to 'N') the mtu values for the network interface are set through ether_setup, with min_mtu = ETH_MIN_MTU and max_mtu = ETH_DATA_LEN, not allowing anymore to set mtu greater than 1500 (error: mtu greater than device maximum). The patch restores the original min/max mtu values set by usbnet after a raw_ip switch. Signed-off-by: Daniele Palmas Acked-by: Bjørn Mork Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/usb/qmi_wwan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 189715438328f..a8d5561afc7d4 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -274,6 +274,9 @@ static void qmi_wwan_netdev_setup(struct net_device *net) netdev_dbg(net, "mode: raw IP\n"); } else if (!net->header_ops) { /* don't bother if already set */ ether_setup(net); + /* Restoring min/max mtu values set originally by usbnet */ + net->min_mtu = 0; + net->max_mtu = ETH_MAX_MTU; clear_bit(EVENT_NO_IP_ALIGN, &dev->flags); netdev_dbg(net, "mode: Ethernet\n"); } -- 2.20.1