-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add helper function to validate interface name length #931
base: master
Are you sure you want to change the base?
Add helper function to validate interface name length #931
Conversation
Signed-off-by: Stepan Blyschak <[email protected]>
common/interface.h
Outdated
|
||
#if defined(SWIG) && defined(SWIGPYTHON) | ||
%pythoncode %{ | ||
def is_interface_name_valid(iface_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If python could call isInterfaceNameValid
, no need to define another one just different with function name. We previoslyu defined some python function due to SWIG could not automatically translate function from one language to another, like C++ missing dynamic features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong argument besides that I wanted to keep original author's intent to have a function named in snake_case style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qiluo-msft Done
Signed-off-by: Stepan Blyschak <[email protected]>
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.