Skip to content

[202106] [config] fix interface IPv6 address removal#1909

Merged
judyjoseph merged 1 commit intosonic-net:202106from
stepanblyschak:remove-ip-202106
Nov 3, 2021
Merged

[202106] [config] fix interface IPv6 address removal#1909
judyjoseph merged 1 commit intosonic-net:202106from
stepanblyschak:remove-ip-202106

Conversation

@stepanblyschak
Copy link
Copy Markdown
Contributor

Current code takes an input from the user, converts the IPv6 string to lower letters and removes lower case IPv6 string from CONFIG DB. This is a bug since, according to the schema CONFIG DB is case insensitive for IPv6 address.

  • What I did
    Fixed CLI for removing IPv6 address.
    Issue is that below command does not work if IP address is written in upper case in CONFIG DB, like this: FC00::1/64.
    'config interface ip remove Ethernet0 FC00::1/64'

  • How I did it
    Make it case insensitive
    Relaxed the validation of IP address, a built-in validation from ipaddress package in python is used.
    Refactored interface_ipaddr_dependent_on_interface -> get_interface_ipaddresses
    Separated some functions (has_static_routes_attached, flush_ip_neigh_in_kernel, can_remove_router_interface, remove_router_interface_ip_address, remove_router_interface, is_management_interface)

  • How to verify it
    Run UT. Try to reproduce the scenario described above.

Signed-off-by: Stepan Blyschak [email protected]

What I did

How I did it

How to verify it

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)

Current code takes an input from the user, converts the IPv6 string to lower letters and removes lower case IPv6 string from CONFIG DB. This is a bug since, according to the schema CONFIG DB is case insensitive for IPv6 address.

- What I did
Fixed CLI for removing IPv6 address.
Issue is that below command does not work if IP address is written in upper case in CONFIG DB, like this: FC00::1/64.
'config interface ip remove Ethernet0 FC00::1/64'

- How I did it
Make it case insensitive
Relaxed the validation of IP address, a built-in validation from ipaddress package in python is used.
Refactored interface_ipaddr_dependent_on_interface -> get_interface_ipaddresses
Separated some functions (has_static_routes_attached, flush_ip_neigh_in_kernel, can_remove_router_interface, remove_router_interface_ip_address, remove_router_interface, is_management_interface)

- How to verify it
Run UT. Try to reproduce the scenario described above.

Signed-off-by: Stepan Blyschak <[email protected]>
@prsunny prsunny changed the title [config] fix interface IPv6 address removal [202106] [config] fix interface IPv6 address removal Nov 3, 2021
@liat-grozovik liat-grozovik requested a review from prsunny November 3, 2021 17:45
@liat-grozovik
Copy link
Copy Markdown
Collaborator

@prsunny as this was prev reviewed and approved by you on master, could you please help to review and merge this one as well?

@prsunny
Copy link
Copy Markdown
Contributor

prsunny commented Nov 3, 2021

@judyjoseph , please merge

@judyjoseph judyjoseph merged commit 57de13b into sonic-net:202106 Nov 3, 2021
@judyjoseph
Copy link
Copy Markdown
Contributor

@judyjoseph , please merge

there was test failure, but found it was because the run was cancelled due to > 3hrs run. Merged the same.

stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 18, 2022
* c3691d3 [202012][pfcwd] Convert polling interval from ms to us in LUA scripts (sonic-net#1909)
* 549c804 Mux state order change (sonic-net#1902)
* 6b0b2c4 Update acl type check logic (sonic-net#1886)

Signed-off-by: Volodymyr Samotiy <[email protected]>
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