Skip to content

Commit

Permalink
vrrp: automatic creation of macvlan address.
Browse files Browse the repository at this point in the history
whenever a vrrp instance is created, we will have a
macvlan interface created that will handle the
requests that are incoming.

Signed-off-by: Paul Wekesa <[email protected]>
  • Loading branch information
Paul-weqe committed Sep 17, 2024
1 parent 1b849c9 commit 080f395
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions holo-interface/src/netlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,19 @@ pub(crate) async fn vlan_create(
pub(crate) async fn macvlan_create(
handle: &Handle,
name: String,
_mac_address: Option<[u8; 6]>,
mac_address: Option<[u8; 6]>,
parent_ifindex: u32,
) {
// Create netlink request
let request = handle.link().add().macvlan(
let mut request = handle.link().add().macvlan(
name.clone(),
parent_ifindex,
MACVLAN_MODE_BRIDGE,
);

// will be uncommented on upgrade of rtnetlink
//if Some(address) = mac_address {
// request.address(address);
//}
if let Some(address) = mac_address {
request = request.address(address.to_vec());
}

// Execute request.
if let Err(error) = request.execute().await {
Expand Down

0 comments on commit 080f395

Please sign in to comment.