Page MenuHomeVyOS Platform

Interfaces: Interface names can exceed 15 characters
Open, NormalPublicBUG

Description

Linux interfaces are limited to 15 characters, but interface names are allowed to exceed that limit with no graceful handling of that error, causing an exception:

vyos@PE2# set dummy dum1000000000000
vyos@PE2# commit
[ interfaces dummy dum1000000000000 ]
Traceback (most recent call last):
  File "/usr/libexec/vyos/services/vyos-configd", line 156, in run_script
    script.apply(c)
  File "/usr/libexec/vyos/conf_mode/interfaces_dummy.py", line 58, in apply
    d = DummyIf(**dummy)
        ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 351, in __init__
    self._create()
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/dummy.py", line 34, in _create
    super()._create('dummy')
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 372, in _create
    self._cmd(cmd)
  File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 66, in _cmd
    return cmd(command, self.debug, env=env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/process.py", line 189, in cmd
    raise OSError(code, feedback)
FileNotFoundError: [Errno 2] failed to run command: None ip link add dev dum1000000000000 type dummy
returned:
exit code: 2

[[interfaces dummy dum1000000000000]] failed
Commit failed

Details

Version
1.4.3, 1.5
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)