From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Daniele Palmas" <dnlplm@gmail.com>, "Bjørn Mork" <bjorn@mork.no>,
"David S . Miller" <davem@davemloft.net>,
"Sasha Levin" <sashal@kernel.org>,
netdev@vger.kernel.org, linux-usb@vger.kernel.org
Subject: [PATCH AUTOSEL 4.14 11/19] net: usb: qmi_wwan: restore mtu min/max values after raw_ip switch
Date: Thu, 5 Mar 2020 12:15:32 -0500 [thread overview]
Message-ID: <20200305171540.30250-11-sashal@kernel.org> (raw)
In-Reply-To: <20200305171540.30250-1-sashal@kernel.org>
From: Daniele Palmas <dnlplm@gmail.com>
[ 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 <dnlplm@gmail.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 db70d4c5778a6..1f76998db44e4 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -275,6 +275,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
next prev parent reply other threads:[~2020-03-05 17:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 17:15 [PATCH AUTOSEL 4.14 01/19] ACPI: watchdog: Allow disabling WDAT at boot Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 02/19] HID: apple: Add support for recent firmware on Magic Keyboards Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 03/19] HID: core: fix off-by-one memset in hid_report_raw_event() Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 04/19] HID: core: increase HID report buffer size to 8KiB Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 05/19] HID: hiddev: Fix race in in hiddev_disconnect() Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 06/19] i2c: altera: Fix potential integer overflow Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 07/19] HID: i2c-hid: add Trekstor Surfbook E11B to descriptor override Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 08/19] MIPS: VPE: Fix a double free and a memory leak in 'release_vpe()' Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 09/19] cfg80211: check reg_rule for NULL in handle_channel_custom() Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 10/19] scsi: libfc: free response frame from GPN_ID Sasha Levin
2020-03-05 17:15 ` Sasha Levin [this message]
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 12/19] net: ks8851-ml: Fix IRQ handling and locking Sasha Levin
2020-03-05 17:15 ` [PATCH AUTOSEL 4.14 13/19] mac80211: rx: avoid RCU list traversal under mutex Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200305171540.30250-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bjorn@mork.no \
--cc=davem@davemloft.net \
--cc=dnlplm@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).