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

Neighbours and ifindex #446

Open
vincentbernat opened this Issue Jan 3, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@vincentbernat
Contributor

vincentbernat commented Jan 3, 2018

Hey!

I am trying to recover the list of neighbours for a given interface:

ipr.neigh('dump', ifindex=10)

Unfortunately, ifindex gets translated to ndm_ifindex. I need it to be converted to NDA_IFINDEX attribute. Is there an easy way to use the attribute? Instead, I can do:

ipr.neigh('dump', IFINDEX=10)

In this case, the Netlink request looks correct. However, later in the code, additional arguments are converted to a filter. So, I can do:

ipr.neigh('dump', IFINDEX=10, match=None)

And I get the expected results. Is there a better way?

Also, I would like to get both IPv4 and IPv6. Unfortunately, specifying AF_UNSPEC is changed to AF_INET. Should this line be removed?

@vincentbernat

This comment has been minimized.

Show comment
Hide comment
@vincentbernat

vincentbernat Jan 3, 2018

Contributor

The same problem applies to state. Also, this is limited to dump. For set, the kernel seems to be happy to get information directly from ndmsg.

Contributor

vincentbernat commented Jan 3, 2018

The same problem applies to state. Also, this is limited to dump. For set, the kernel seems to be happy to get information directly from ndmsg.

@svinota

This comment has been minimized.

Show comment
Hide comment
@svinota

svinota Jan 15, 2018

Owner

Looks like the code should be fixed. Working on it, thanks

Owner

svinota commented Jan 15, 2018

Looks like the code should be fixed. Working on it, thanks

@svinota svinota added the fr label Jan 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment