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

[netlink] refill netlink cache when failing to get the link object by name #506

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

wangshengjun
Copy link
Contributor

@wangshengjun wangshengjun commented Jul 22, 2021

Why I did it
The getLinkByName may fail because of the outdated netlink cache

How I did it
Refill the netlink cache when we fail to get link object.

How to verify it

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@wangshengjun
Copy link
Contributor Author

@qiluo-msft Could you please review this PR?

@qiluo-msft qiluo-msft changed the title [netlink]refill netlink cache when failing to get the link object by … [netlink] refill netlink cache when failing to get the link object by name Jul 28, 2021
@@ -77,5 +77,13 @@ string LinkCache::ifindexToName(int ifindex)

struct rtnl_link* LinkCache::getLinkByName(const char *name)
Copy link
Contributor

Choose a reason for hiding this comment

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

getLinkByName

The change looks good to me. I am wondering how is this function used in application? I could not find any use cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getLinkByName

The change looks good to me. I am wondering how is this function used in application? I could not find any use cases.

Hi qiluo
Yes, the function is not yet used in the code. I use it when trying to do the optimization of VLAN interface creation through netlink.

@qiluo-msft qiluo-msft merged commit f89b2ac into sonic-net:master Jul 29, 2021
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.

2 participants