From: Sven Eckelmann Date: Thu, 27 Jul 2023 08:13:42 +0000 (+0200) Subject: batman-adv: Avoid magic value for minimum MTU X-Git-Tag: v6.6-rc1~162^2~86^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4b817804579624b47823d87e647ec6c3d3ab827;p=thirdparty%2Flinux.git batman-adv: Avoid magic value for minimum MTU 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 Signed-off-by: Simon Wunderlich --- diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index d3fdf82282afe..f7947fad06f25 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -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;