batman-adv: Avoid magic value for minimum MTU
authorSven Eckelmann <sven@narfation.org>
Thu, 27 Jul 2023 08:13:42 +0000 (10:13 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Thu, 3 Aug 2023 19:11:42 +0000 (21:11 +0200)
The header linux/if_ether.h already defines a constant for the minimum MTU.
So simply use it instead of having a magic constant in the code.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/soft-interface.c

index d3fdf82..f7947fa 100644 (file)
@@ -154,7 +154,7 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
 static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu)
 {
        /* check ranges */
-       if (new_mtu < 68 || new_mtu > batadv_hardif_min_mtu(dev))
+       if (new_mtu < ETH_MIN_MTU || new_mtu > batadv_hardif_min_mtu(dev))
                return -EINVAL;
 
        dev->mtu = new_mtu;