Fixed IP validation in "config interface ip add/remove"#1709
Merged
bingwang-ms merged 1 commit intosonic-net:masterfrom Jul 15, 2021
Merged
Fixed IP validation in "config interface ip add/remove"#1709bingwang-ms merged 1 commit intosonic-net:masterfrom
bingwang-ms merged 1 commit intosonic-net:masterfrom
Conversation
Contributor
Author
|
@prsunny , @jleveque , @d-dashkov , |
Contributor
Author
|
The fix must be cherry-picked into 202012 as well |
prsunny
previously approved these changes
Jul 7, 2021
Contributor
Author
|
In fact, it's wrong approach to convert v6 addresses to upper case as well. Looks like RIF can be loaded from config_db.json into config_db in both lower and upper formats. Ideally, we should not change case of letters. |
2a968e3 to
dad8178
Compare
dad8178 to
b5eff4d
Compare
|
This pull request introduces 1 alert when merging b5eff4d5309fd03d7caea5eae80eff84dccaef45 into e8b6c5c - view on LGTM.com new alerts:
|
b5eff4d to
02a2552
Compare
- Renamed validate_ip_mask() to is_valid_ip_interface() as per code style - Updated is_valid_ip_interface() to do not modify the IP address - Updated UTs per changes Signed-off-by: Andriy Kokhan <[email protected]>
Contributor
Author
Contributor
Author
|
@lguohan , please review. |
Contributor
|
@d-dashkov can u pls review? |
d-dashkov
approved these changes
Jul 15, 2021
bingwang-ms
approved these changes
Jul 15, 2021
Contributor
|
Merged, thanks for the fix |
qiluo-msft
pushed a commit
that referenced
this pull request
Jul 15, 2021
…1709) - Renamed validate_ip_mask() to is_valid_ip_interface() as per code style - Updated is_valid_ip_interface() to do not modify the IP address - Updated UTs per changes Signed-off-by: Andriy Kokhan <[email protected]>
raphaelt-nvidia
pushed a commit
to raphaelt-nvidia/sonic-utilities
that referenced
this pull request
Aug 10, 2021
…onic-net#1709) - Renamed validate_ip_mask() to is_valid_ip_interface() as per code style - Updated is_valid_ip_interface() to do not modify the IP address - Updated UTs per changes Signed-off-by: Andriy Kokhan <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Andriy Kokhan [email protected]
Why I did it
After executing command that should delete ipv6 address from LAG, ipv6 address still remains.
This affects t0 VLAN TCs.
What I did
Reworked IP validation for "config interface ip remove" command added by #1414
Since the IP address is used as a part of a key in Redis DB, we should not modify IP address format provided by the user (e.g., convert "FC00::71/126" to "fc00::71/126" which causes VLAN TCs failure). At the same time we probably should not tolerate extra zeros in IPv4...
So, reworked IP validation in "config interface ip add/remove" command:
- Renamed validate_ip_mask() to is_valid_ip_interface() as per code style
- Updated is_valid_ip_interface() to do not modify the IP address
- Updated UTs per changes
How to verify it
deploy t0
sudo config interface ip remove PortChannel0001 FC00::71/126