From 080f39526d696e1f1d73c70d64ae8b3291138630 Mon Sep 17 00:00:00 2001 From: Paul Wekesa Date: Tue, 17 Sep 2024 16:25:07 +0300 Subject: [PATCH] vrrp: automatic creation of macvlan address. 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 --- holo-interface/src/netlink.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/holo-interface/src/netlink.rs b/holo-interface/src/netlink.rs index 33d39fb3..db0378fc 100644 --- a/holo-interface/src/netlink.rs +++ b/holo-interface/src/netlink.rs @@ -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 {