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

Fix the EVPN orch may access invalid address #1661

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gord1306
Copy link
Contributor

@gord1306 gord1306 commented Mar 3, 2021

There is an private pointer in the EVPN orch which is used save the local vtep. But the local vtep is add/removed in the vxlan tunnel orch, the vxlan tunnel orch did not notify EVPN orch when remove the vtep and cause EVPN orch may access invalid address

What I did
Verify EVPN related configurations

Why I did it
Test EVPN feature

How I verified it
Delete local vtep first then del nvo, it may cause the nvo access invalid address

Details if related

@gord1306 gord1306 force-pushed the evpnorch_source_vtep branch from bbdf214 to 267243c Compare March 4, 2021 02:04
return false;
}

++it;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix alignment in various places. Have this incr line in for-loop itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@prsunny
Copy link
Collaborator

prsunny commented Mar 4, 2021

@srj102 to review

There is an private pointer in the EVPN orch which is used save the local
vtep. But the local vtep is add/removed in the vxlan tunnel orch, the
vxlan tunnel orch did not notify EVPN orch when remove the vtep and cause
EVPN orch may access invalid address
@gord1306 gord1306 force-pushed the evpnorch_source_vtep branch from 267243c to 661e109 Compare March 4, 2021 07:00
@gord1306
Copy link
Contributor Author

gord1306 commented Mar 5, 2021

retest this please

@prsunny
Copy link
Collaborator

prsunny commented Mar 9, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -1405,14 +1406,27 @@ bool VxlanTunnelOrch::delOperation(const Request& request)
return false;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

The sequence as I understand from the PR description is that the VXLAN_TUNNEL entry is deleted first and then the VXLAN_EVPN_NVO from the config DB.

  1. If the user were to use Click then this will never occur as there are validation checks at Click which will prevent this.
  2. If the user were not to use Click and instead delete the entries from the CONFIG DB through some other way, then we should put in all the relevant checks in VxlanMgr::doVxlanTunnelDeleteTask instead of the orchagent.
  3. Besides EVPN NVO checks will also have to be made to delete the VXLAN_TUNNEL_MAP entries in VxlanMgr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the point 1, could you help to provide the information about the validation checks, because I am not sure whether it is in the https://github.com/Azure/sonic-mgmt-common repo

Copy link
Contributor

Choose a reason for hiding this comment

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

Please refer to sonic-net/sonic-utilities#870
The changes are in sonic-utilities/config/vxlan.py

Specifically the following snippet.

def del_vxlan(db, vxlan_name):
"""Del VXLAN"""
ctx = click.get_current_context()

vxlan_keys = db.cfgdb.get_keys('VXLAN_EVPN_NVO')
if not vxlan_keys:
  vxlan_count = 0
else:
  vxlan_count = len(vxlan_keys)

if(vxlan_count > 0):
    ctx.fail("Please delete the EVPN NVO configuration.")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that maybe the difference. I am trying to use restapi to apply the config, and it has no validate check logic inside it. Is it better to add the same check logic (APP_DB not CONFIG_DB) in the vxlanmgrd ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does the REST API write to the CONFIG DB or APP DB ? If CONFIG DB then we should put in all the checks in vxlanmgrd. If it is being written to the APP DB directly then yes checks will need to be put in orchagent.
However I think it would be better to keep all the entry points to VXLAN functionality through vxlanmgr i.e. we write to config db

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.

3 participants