MultiWAN: restrict validator for weight field
When the user wants to create a new provider inside the MultiWAN page, he must enter a weight as an integer.
Current validator allows any non-negative integer number, but underlying implementation (
ip command) doesn't allow a value greater than 255.
The new validator must allow any integer number between 1 and 255.
#1 Updated by Giacomo Sanchietti almost 5 years ago
Reported error is:
Shorewall is not running Error: argument "1001" is wrong: "weight" is invalid ERROR: Command "ip -4 route replace default scope global table 250 nexthop via 10.0.3.2 dev eth1 weight 1001" Failed /usr/share/shorewall/lib.common: line 113: 3695 Terminated $SHOREWALL_SHELL $script $options $@
#6 Updated by Giacomo Sanchietti almost 5 years ago
- Status changed from MODIFIED to ON_QA
- Assignee deleted (
- % Done changed from 60 to 70
- Check the user can enter only values between 1 and 255
#8 Updated by Nicola Rauso almost 5 years ago
- File provider.png added
- Status changed from ON_QA to TRIAGED
- Assignee deleted (
- % Done changed from 70 to 20
The validator allows the presence of a blank before weight value but in that case shorewall configuration is not valid and the service could not restart.
Web inteface generates an error (see attachment) and into
"messages" log you find:
Feb 18 16:42:45 mynsrv logger: ERROR:Shorewall restart failed Feb 18 16:42:45 mynsrv esmith::event: [ERROR] Shorewall restart: ERROR: Invalid providers file entry (too many columns) /etc/shorewall/providers (line 24) Feb 18 16:42:45 mynsrv esmith::event: Action: /etc/e-smith/events/nethserver-firewall-base-save/S89nethserver-shorewall-restart FAILED: 1 [0.771475] Feb 18 16:42:45 mynsrv esmith::event: [INFO] service lsm restart Feb 18 16:42:45 mynsrv init: lsm main process (27737) killed by TERM signal Feb 18 16:42:46 mynsrv esmith::event: lsm start/running, process 28317 Feb 18 16:42:46 mynsrv esmith::event: [INFO] lsm restart Feb 18 16:42:46 mynsrv esmith::event: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [0.232769] Feb 18 16:42:46 mynsrv esmith::event: Event: nethserver-firewall-base-save FAILED Feb 18 16:42:46 mynsrv esmith::event: Action: /etc/e-smith/events/firewall-adjust/S20firewall-adjust FAILED: 1 [1.408746] Feb 18 16:42:46 mynsrv esmith::event: Event: firewall-adjust FAILEDinstalled package: