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

add_neighbour example: set required link_local_address #67

Merged

Conversation

kaueraal
Copy link
Contributor

Adding (or replacing) a neighbour fails for me without setting a link local address. First, I receive error 22 and all reattempts receive error 17.

This e.g. also shows in the example. After building cargo build --example add_neighbour as a normal user I get the following when running it as root:

# ./add_neighbour eth0 10.17.31.55                                                                                                         
Received a netlink error message Invalid argument (os error 22)                                                                                                                     
# ./add_neighbour eth0 10.17.31.55                                                                                                         
Received a netlink error message File exists (os error 17) 

This is also in line with ip which also requires setting a link local address for me:

# ip neigh add 10.17.31.55 dev eth0
Error: No link layer address given.

Hence, I assume this is the correct behaviour. I don't know whether the example worked at some point and the behaviour in the kernel changed. I have cargo 1.78.0 (54d8815d0 2024-03-26), I run everything on a Debian 12 with kernel 6.1.76 and ip -V reports iproute2-6.1.0, libbpf 1.1.0.

To fix the example, I adjusted it in this MR to also get a link local address as argument:

# ./add_neighbour eth0 10.17.31.55 56:78:90:ab:cd:ef
Done

kaueraal and others added 2 commits June 24, 2024 09:22
Setting the link local address (aka the mac address)
is required for adding a neighbor. Hence, it should be
reflected in the example.
Signed-off-by: Gris Ge <[email protected]>
@cathay4t cathay4t force-pushed the example-add-neighbour-add-lladdress branch from 63efe9c to 178945d Compare June 24, 2024 01:22
@cathay4t cathay4t enabled auto-merge (rebase) June 24, 2024 01:26
@cathay4t cathay4t merged commit e0030d9 into rust-netlink:main Jun 24, 2024
3 checks passed
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