summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2023-07-27 10:13:42 +0200
committerSimon Wunderlich <sw@simonwunderlich.de>2023-08-03 21:11:42 +0200
commite4b817804579624b47823d87e647ec6c3d3ab827 (patch)
tree9db7353979d0ae0de6c14b3488bdd9913875be18 /net
parentbbfb428a0cf6fbce4bcb34510a8eb0cf9b3841a4 (diff)
downloadlinux-e4b817804579624b47823d87e647ec6c3d3ab827.tar.gz
linux-e4b817804579624b47823d87e647ec6c3d3ab827.tar.bz2
linux-e4b817804579624b47823d87e647ec6c3d3ab827.zip
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 <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/soft-interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index d3fdf82282af..f7947fad06f2 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;