Repository : ssh://git@diktynna/batman-adv On branches: main,main
commit dd9ae9988e292506ee92321b795dc021e8cfddd3 Author: Sven Eckelmann sven@narfation.org Date: Thu Jul 27 10:13:42 2023 +0200
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
dd9ae9988e292506ee92321b795dc021e8cfddd3 net/batman-adv/soft-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 85d00dc9..1bf1232a 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c @@ -156,7 +156,7 @@ static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu) struct batadv_priv *bat_priv = netdev_priv(dev);
/* 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;