Skip to content

Commit

Permalink
luci-mod-network: include prefix in interface name check
Browse files Browse the repository at this point in the history
The interface name check only considered the user input when validating
the length, which could result in the actual name exceeding the kernel
limit of 15 characters when the bridge/protocol prefix was included as
well. For example the interface name abcdefgh1234567 was accepted as
valid but with prefixes included (such as br-abcdefgh1234567 or
gre4-abcdefgh1234567) it exceeded the limit.

Signed-off-by: Daniel Nilsson <[email protected]>
  • Loading branch information
dannil committed Sep 20, 2024
1 parent a2c21a6 commit 2931aa2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ return view.extend({
var pr = network.getProtocol(proto.formvalue(section_id), value),
ifname = pr.isVirtual() ? '%s-%s'.format(pr.getProtocol(), value) : 'br-%s'.format(value);

if (value.length > 15)
if (ifname.length > 15)
return _('The interface name is too long');

return true;
Expand Down

0 comments on commit 2931aa2

Please sign in to comment.