hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/batman-adv/hard-interface.c
....@@ -632,7 +632,19 @@
632632 */
633633 void batadv_update_min_mtu(struct net_device *soft_iface)
634634 {
635
- soft_iface->mtu = batadv_hardif_min_mtu(soft_iface);
635
+ struct batadv_priv *bat_priv = netdev_priv(soft_iface);
636
+ int limit_mtu;
637
+ int mtu;
638
+
639
+ mtu = batadv_hardif_min_mtu(soft_iface);
640
+
641
+ if (bat_priv->mtu_set_by_user)
642
+ limit_mtu = bat_priv->mtu_set_by_user;
643
+ else
644
+ limit_mtu = ETH_DATA_LEN;
645
+
646
+ mtu = min(mtu, limit_mtu);
647
+ dev_set_mtu(soft_iface, mtu);
636648
637649 /* Check if the local translate table should be cleaned up to match a
638650 * new (and smaller) MTU.