Commit 8b1efc0f authored by Jarod Wilson's avatar Jarod Wilson Committed by David S. Miller

net: remove MTU limits on a few ether_setup callers

These few drivers call ether_setup(), but have no ndo_change_mtu, and thus
were overlooked for changes to MTU range checking behavior. They
previously had no range checks, so for feature-parity, set their min_mtu
to 0 and max_mtu to ETH_MAX_MTU (65535), instead of the 68 and 1500
inherited from the ether_setup() changes. Fine-tuning can come after we get
back to full feature-parity here.

CC: netdev@vger.kernel.org
Reported-by: default avatarAsbjoern Sloth Toennesen <asbjorn@asbjorn.st>
CC: Asbjoern Sloth Toennesen <asbjorn@asbjorn.st>
CC: R Parameswaran <parameswaran.r7@gmail.com>
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e8f0a89c
...@@ -649,7 +649,9 @@ static void br2684_setup_routed(struct net_device *netdev) ...@@ -649,7 +649,9 @@ static void br2684_setup_routed(struct net_device *netdev)
netdev->hard_header_len = sizeof(llc_oui_ipv4); /* worst case */ netdev->hard_header_len = sizeof(llc_oui_ipv4); /* worst case */
netdev->netdev_ops = &br2684_netdev_ops_routed; netdev->netdev_ops = &br2684_netdev_ops_routed;
netdev->addr_len = 0; netdev->addr_len = 0;
netdev->mtu = 1500; netdev->mtu = ETH_DATA_LEN;
netdev->min_mtu = 0;
netdev->max_mtu = ETH_MAX_MTU;
netdev->type = ARPHRD_PPP; netdev->type = ARPHRD_PPP;
netdev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; netdev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
netdev->tx_queue_len = 100; netdev->tx_queue_len = 100;
......
...@@ -221,6 +221,8 @@ void bnep_net_setup(struct net_device *dev) ...@@ -221,6 +221,8 @@ void bnep_net_setup(struct net_device *dev)
dev->addr_len = ETH_ALEN; dev->addr_len = ETH_ALEN;
ether_setup(dev); ether_setup(dev);
dev->min_mtu = 0;
dev->max_mtu = ETH_MAX_MTU;
dev->priv_flags &= ~IFF_TX_SKB_SHARING; dev->priv_flags &= ~IFF_TX_SKB_SHARING;
dev->netdev_ops = &bnep_netdev_ops; dev->netdev_ops = &bnep_netdev_ops;
......
...@@ -1247,6 +1247,8 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent, ...@@ -1247,6 +1247,8 @@ int dsa_slave_create(struct dsa_switch *ds, struct device *parent,
slave_dev->priv_flags |= IFF_NO_QUEUE; slave_dev->priv_flags |= IFF_NO_QUEUE;
slave_dev->netdev_ops = &dsa_slave_netdev_ops; slave_dev->netdev_ops = &dsa_slave_netdev_ops;
slave_dev->switchdev_ops = &dsa_slave_switchdev_ops; slave_dev->switchdev_ops = &dsa_slave_switchdev_ops;
slave_dev->min_mtu = 0;
slave_dev->max_mtu = ETH_MAX_MTU;
SET_NETDEV_DEVTYPE(slave_dev, &dsa_type); SET_NETDEV_DEVTYPE(slave_dev, &dsa_type);
netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one, netdev_for_each_tx_queue(slave_dev, dsa_slave_set_lockdep_class_one,
......
...@@ -66,7 +66,8 @@ static void irlan_eth_setup(struct net_device *dev) ...@@ -66,7 +66,8 @@ static void irlan_eth_setup(struct net_device *dev)
dev->netdev_ops = &irlan_eth_netdev_ops; dev->netdev_ops = &irlan_eth_netdev_ops;
dev->destructor = free_netdev; dev->destructor = free_netdev;
dev->min_mtu = 0;
dev->max_mtu = ETH_MAX_MTU;
/* /*
* Lets do all queueing in IrTTP instead of this device driver. * Lets do all queueing in IrTTP instead of this device driver.
......
...@@ -259,6 +259,8 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p ...@@ -259,6 +259,8 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p
session->mtu = dev->mtu - session->hdr_len; session->mtu = dev->mtu - session->hdr_len;
dev->mtu = session->mtu; dev->mtu = session->mtu;
dev->needed_headroom += session->hdr_len; dev->needed_headroom += session->hdr_len;
dev->min_mtu = 0;
dev->max_mtu = ETH_MAX_MTU;
priv = netdev_priv(dev); priv = netdev_priv(dev);
priv->dev = dev; priv->dev = dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment