-
Notifications
You must be signed in to change notification settings - Fork 739
Ensure --addr-pool mask accepts numbers only #4619
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
base: main
Are you sure you want to change the base?
Conversation
lum1n0us
left a comment
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.
LGTM. With minor comments
Co-authored-by: liang.he <liang.he@intel.com>
9237915 to
ed45cce
Compare
| #else | ||
| address = strtok_r(cp, "/", &nextptr); | ||
| mask = strtok_r(NULL, "/", &nextptr); | ||
| #endif |
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.
maybe we can have bh_strtok_r function for this?
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.
Agreed. However, I think we should use a new PR to implement that and merge it first. Does that sound good to you?
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.
Sounds good to me. Should I open a new PR for the implementation?
| #else | ||
| address = strtok_r(cp, "/", &nextptr); | ||
| mask = strtok_r(NULL, "/", &nextptr); | ||
| #endif |
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.
Agreed. However, I think we should use a new PR to implement that and merge it first. Does that sound good to you?
The
--addr-pooloption previously usedatoito parse the mask value.If non-numeric characters were included,
atoireturned0, causing the pool to unintentionally accept all IP addresses.This change ensures the mask accepts only numeric values, preventing unexpected behavior.