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

support linux altname #369

Open
calvin2021y opened this issue Dec 21, 2023 · 2 comments
Open

support linux altname #369

calvin2021y opened this issue Dec 21, 2023 · 2 comments

Comments

@calvin2021y
Copy link

IFLA_ALT_IFNAME is not used.

rtnl_link_get_by_name with altname will return not exits.

@calvin2021y
Copy link
Author

@thom311

Can you give some tips about how to do it?

@thom311
Copy link
Owner

thom311 commented Dec 11, 2024

First, libnl3 needs to learn about altnames and the struct rtnl_link needs to expose those (an rtnl_link_get_altnames() akin to rtnl_link_get_name())

The netlink attribute is called IFLA_ALT_IFNAME. In sense, it is similar to IFLA_IFNAME. Search libnl3 for IFLA_IFNAME.

The major difference is that the IFLA_ALT_IFNAME attribute can appear multiple times and there can be any number of altnames.

I'd look at IFLA_ALT_IFNAME in kernel, iproute2 and systemd projects, to see how they handle that.

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

No branches or pull requests

2 participants