Development
This commit is contained in:
parent
6c3abca58c
commit
96f6e32c8f
9 changed files with 294 additions and 166 deletions
|
|
@ -42,8 +42,10 @@ def physicalinterface_save():
|
|||
flash('Both WAN and LAN interfaces are required.', 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
|
||||
if wan == lan:
|
||||
flash('WAN and LAN interfaces must be different.', 'error')
|
||||
# WAN and LAN must be distinct physical interfaces
|
||||
err = validate.check_wan_lan_unique(wan, lan)
|
||||
if err:
|
||||
flash(err, 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
|
||||
if not verify_config_hash(request.form.get('config_hash', '')):
|
||||
|
|
@ -51,9 +53,11 @@ def physicalinterface_save():
|
|||
return redirect(f'/{_PAGE}')
|
||||
|
||||
available = _get_system_interfaces()
|
||||
# Interfaces must exist on this system (checked against physical-only interface list)
|
||||
for iface in (wan, lan):
|
||||
if available and iface not in available:
|
||||
flash(f"Interface '{iface}' does not exist on this system.", 'error')
|
||||
err = validate.check_interface_exists(iface, available)
|
||||
if err:
|
||||
flash(err, 'error')
|
||||
return redirect(f'/{_PAGE}')
|
||||
|
||||
cfg = load_config()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue