diff options
author | Daniel Nilsson <dannil+github@protonmail.com> | 2024-09-21 19:38:49 +0200 |
---|---|---|
committer | Paul Donald <newtwen+github@gmail.com> | 2024-10-07 17:18:33 +0200 |
commit | 300961bb1ba7d71b50288b97c0fdeae0c71253e7 (patch) | |
tree | d127be9b5772f400c95a7e135d5735c354bf9ac6 /modules/luci-base/root/usr | |
parent | 723eb386340c8da681aa2c5fb60101690b3231fc (diff) |
luci-mod-network: split interface name and protocol validation
The previous implementation of binding the protocol validation to the
name validation caused problems when creating a new interface where an
already existing interface had the new one's protocol as its name, as the
protocol would be used when validating if an interface of that name already
existed.
Consider the following case:
1. Interface 'gre' with protocol PPPoE is created
2. Interface 'foo' with protocol GRE tunnel over IPv4 (which resolves to
'gre') tries to be created
Creating interface 'foo' would error out during protocol validation as
'gre' would be passed to the name validation, which in turn would check if
an interface with name 'gre' already exists, which it does.
Instead of reusing the validation logic, simply trigger the name
validation manually as the protocol changes to properly pass the name of
the interface instead of the protocol. This also gives the benefit of
keeping all error states related to the name contained in the appropriate
UI element.
Fixes #7146
Tested-by: Tiago Gaspar <tiagogaspar8@gmail.com>
Signed-off-by: Daniel Nilsson <dannil+github@protonmail.com>
Diffstat (limited to 'modules/luci-base/root/usr')
0 files changed, 0 insertions, 0 deletions