Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

rtnetlink/neigh: add new_bridge helper to add AF_BRIDGE neighs #203

Merged
merged 1 commit into from
Nov 28, 2021

Conversation

Tuetuopay
Copy link
Contributor

This allows to manipulate the FDB in addition to the ARP table.

While the same could be accomplished with .message_mut(), this is less cumbersome:

Before:

// 0.0.0.0 as a dummy IP, we don't need it for generic FDB entries
let mut req = handle.neighbours()
    .add(index, [0, 0, 0, 0].into())
    .state(NUD_PERMANENT)
    .link_local_address(&[0x8c, 0x8c, 0xde, 0xad, 0xbe, 0xef]);
let mut msg = req.message_mut();
msg.header.family = AF_BRIDGE as u8;
req.execute().await?;

After:

handle.neighbours().add_bridge(index, &[0x8c, 0x8c, 0xde, 0xad, 0xbe, 0xef]).execute().await?;

Copy link
Owner

@little-dude little-dude left a comment

Choose a reason for hiding this comment

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

Thanks, looks neat. I'll wait for tomorrow before merging in case someone else wants to take a look.

@little-dude little-dude merged commit 0011c77 into little-dude:master Nov 28, 2021
little-dude added a commit that referenced this pull request Nov 28, 2021
although #203 and
#202 had no direct
conflict, merging both broke rtnetlink:

```
 error[E0063]: missing field `replace` in initializer of `neighbour::add::NeighbourAddRequest`
  --> rtnetlink/src/neighbour/add.rs:58:9
   |
58 |         NeighbourAddRequest { handle, message }
   |         ^^^^^^^^^^^^^^^^^^^ missing `replace`
```
@little-dude little-dude mentioned this pull request Dec 29, 2021
mcginty pushed a commit to mcginty/netlink that referenced this pull request Jan 18, 2022
although little-dude#203 and
little-dude#202 had no direct
conflict, merging both broke rtnetlink:

```
 error[E0063]: missing field `replace` in initializer of `neighbour::add::NeighbourAddRequest`
  --> rtnetlink/src/neighbour/add.rs:58:9
   |
58 |         NeighbourAddRequest { handle, message }
   |         ^^^^^^^^^^^^^^^^^^^ missing `replace`
```
cathay4t pushed a commit to rust-netlink/rtnetlink that referenced this pull request Oct 7, 2022
although little-dude/netlink#203 and
little-dude/netlink#202 had no direct
conflict, merging both broke rtnetlink:

```
 error[E0063]: missing field `replace` in initializer of `neighbour::add::NeighbourAddRequest`
  --> rtnetlink/src/neighbour/add.rs:58:9
   |
58 |         NeighbourAddRequest { handle, message }
   |         ^^^^^^^^^^^^^^^^^^^ missing `replace`
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants