Skip to content

Add helper function to validate interface name length#931

Merged
lguohan merged 10 commits intosonic-net:masterfrom
stepanblyschak:master_validate_interface_name_length
Nov 9, 2024
Merged

Add helper function to validate interface name length#931
lguohan merged 10 commits intosonic-net:masterfrom
stepanblyschak:master_validate_interface_name_length

Conversation

@stepanblyschak
Copy link
Copy Markdown
Contributor

@stepanblyschak stepanblyschak commented Oct 21, 2024

This PR is accompanied by sonic-net/sonic-buildimage#20108 and sonic-net/sonic-utilities#3580

Add helper function to validate that interface name length does not exceed allowed length configured as IFNAMSIZ. This will be used both by sonic-utilities CLI (config) and by cfgmgr.

@lguohan lguohan merged commit b686bb0 into sonic-net:master Nov 9, 2024
VladimirKuk pushed a commit to Marvell-switching/sonic-swss-common that referenced this pull request Nov 20, 2024
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Co-authored-by: afeigin <afeigin@nvidia.com>
qiluo-msft pushed a commit to sonic-net/sonic-utilities that referenced this pull request Dec 2, 2024
This PR is accompanied by sonic-net/sonic-swss-common#931 and sonic-net/sonic-buildimage#20108

What I did
Validate interface name length does not exceed the limitation of IFNAMSIZ to align to kernel restrictions.

How I did it
Add validation checks in the relevant config functions for the following interface types:

vxlan
vlan
vrf
loopback
subinterface
portchannel

How to verify it
UT tests added

Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
nmoray pushed a commit to nmoray/sonic-utilities that referenced this pull request Jun 25, 2025
This PR is accompanied by sonic-net/sonic-swss-common#931 and sonic-net/sonic-buildimage#20108

What I did
Validate interface name length does not exceed the limitation of IFNAMSIZ to align to kernel restrictions.

How I did it
Add validation checks in the relevant config functions for the following interface types:

vxlan
vlan
vrf
loopback
subinterface
portchannel

How to verify it
UT tests added

Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants