Skip to content
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

Handle learning duplicate IPs on different VRFs #3165

Merged
merged 10 commits into from
May 30, 2024

Conversation

theasianpianist
Copy link
Contributor

What I did
Fixes sonic-net/sonic-buildimage#18890

  • If we try to learn an existing neighbor on a different VLAN in the same VRF, delete the old neighbor entry before creating the new one.
  • For all other scenarios, proceed with neighbor learning normally.

Why I did it
Allow learning the same IP in two different VRFs

How I verified it
Run the C++ unit tests

Details if related

- If we try to learn an existing neighbor on a different VLAN in the same VRF, delete the old neighbor entry before creating the new one.
- For all other scenarios, proceed with neighbor learning normally.

Signed-off-by: Lawrence Lee <[email protected]>
dgsudharsan
dgsudharsan previously approved these changes May 24, 2024
@prsunny
Copy link
Collaborator

prsunny commented May 24, 2024

@theasianpianist , can you fix coverage?

Signed-off-by: Lawrence Lee <[email protected]>
@theasianpianist
Copy link
Contributor Author

@dgsudharsan Github is showing that you left some review comments, but I am unable to see them for some reason, can you please re-review w/ new changes?

dgsudharsan
dgsudharsan previously approved these changes May 24, 2024
{
SWSS_LOG_NOTICE("Neighbor %s already learned on %s, removing before adding new neighbor", ip_address.to_string().c_str(), vlan_port.c_str());
}
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing else

Signed-off-by: Lawrence Lee <[email protected]>
if (vrf_name.empty())
{
SWSS_LOG_NOTICE("Neighbor %s already learned on %s, removing before adding new neighbor", ip_address.to_string().c_str(), vlan_port.c_str());
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ -> new line

@liat-grozovik liat-grozovik merged commit ef9dcdb into sonic-net:master May 30, 2024
17 checks passed
@keboliu
Copy link
Collaborator

keboliu commented May 30, 2024

@theasianpianist would you please create a separate PR for 202311?

theasianpianist added a commit to theasianpianist/sonic-swss that referenced this pull request Jun 1, 2024
- What I did
Fixes sonic-net/sonic-buildimage#18890

If we try to learn an existing neighbor on a different VLAN in the same VRF, delete the old neighbor entry before creating the new one.
For all other scenarios, proceed with neighbor learning normally.

- Why I did it
Allow learning the same IP in two different VRFs

- How I verified it
Run the C++ unit tests

Signed-off-by: Lawrence Lee <[email protected]>
Co-authored-by: Prince Sunny <[email protected]>
yxieca pushed a commit that referenced this pull request Jun 3, 2024
- What I did
Fixes sonic-net/sonic-buildimage#18890

If we try to learn an existing neighbor on a different VLAN in the same VRF, delete the old neighbor entry before creating the new one.
For all other scenarios, proceed with neighbor learning normally.

- Why I did it
Allow learning the same IP in two different VRFs

- How I verified it
Run the C++ unit tests

Signed-off-by: Lawrence Lee <[email protected]>
Co-authored-by: Prince Sunny <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Neighbor]When two different Vlans in different VRFs have the same neighbor, one of them is not learnt
7 participants