From 76dacdc62c0e7812a8dfd31dc2765ce870eecf1c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 30 Sep 2020 08:09:06 +0200 Subject: [PATCH] dhcp: RA MTU only written once --- src/www/services_router_advertisements.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/www/services_router_advertisements.php b/src/www/services_router_advertisements.php index 55fca74e0..0bb6ab01c 100644 --- a/src/www/services_router_advertisements.php +++ b/src/www/services_router_advertisements.php @@ -1,7 +1,7 @@ + * Copyright (C) 2016-2020 Franco Fichtner * Copyright (C) 2014-2016 Deciso B.V. * Copyright (C) 2003-2004 Manuel Kasper * Copyright (C) 2010 Seth Mos @@ -136,8 +136,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (!empty($pconfig['AdvRouteLifetime']) && !val_int_in_range($pconfig['AdvRouteLifetime'], 1, 4294967295)) { $input_errors[] = sprintf(gettext('AdvRouteLifetime must be between %s and %s seconds.'), 1, 4294967295); } - if (!empty($pconfig['AdvLinkMTU']) && !val_int_in_range($pconfig['AdvLinkMTU'], 1280, 65535)) { - $input_errors[] = sprintf(gettext('AdvLinkMTU must be between %s and %s bytes.'), 1280, 65535); + $mtu_low = 1280; + $mtu_high = 65535; + if (!empty($pconfig['AdvLinkMTU']) && !val_int_in_range($pconfig['AdvLinkMTU'], $mtu_low, $mtu_high)) { + $input_errors[] = sprintf(gettext('AdvLinkMTU must be between %s and %s bytes.'), $mtu_low, $mtu_high); } }