sonic-net / sonic-swss

SONiC Switch State Service (SwSS)
https://azure.github.io/SONiC
Other
170 stars 503 forks source link

Validate interface name length in cfgmgr #3217

Open arfeigin opened 1 month ago

arfeigin commented 1 month ago

This PR is accompanied by https://github.com/sonic-net/sonic-swss-common/pull/889 and https://github.com/sonic-net/sonic-utilities/pull/3397 What I did Validate interface name length does not exceed the limitation of IFNAMSIZ to align to kernel restrictions. This PR covers the cases of adding interface directly to the DB not using the cli - similar validation on the CLI side is implemented in a sonic-utilities PR.

Why I did it Kernel restricts interface name length to not exceed IFNAMSIZ and this was not checked which can lead to inconsistency when creating such interface as it will be created in config db but it will be blocked when trying to actually create such interface.

How I verified it Manual testing.

Details if related

arfeigin commented 1 month ago

Checkers fail as https://github.com/sonic-net/sonic-swss-common/pull/889 should be merged first so it will compile.

dprital commented 1 week ago

@prsunny , Can you please approve this PR ?