From de02ad896a1aa425aedea415bcc1fa29f91de6ca Mon Sep 17 00:00:00 2001 From: Clemens Famulla-Conrad Date: Thu, 19 Oct 2023 14:28:17 +0200 Subject: [PATCH] bond: fix carrier-detect and num_unsol_na options --- rust/agama-migrate-wicked/src/interface.rs | 14 +++++++------- rust/agama-migrate-wicked/src/reader.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rust/agama-migrate-wicked/src/interface.rs b/rust/agama-migrate-wicked/src/interface.rs index 3b8a20a325..d571c76699 100644 --- a/rust/agama-migrate-wicked/src/interface.rs +++ b/rust/agama-migrate-wicked/src/interface.rs @@ -229,7 +229,7 @@ pub struct Bond { /* only on mode=active-backup */ pub num_grat_arp: Option, /* only on mode=active-backup */ - pub num_usol_na: Option, + pub num_unsol_na: Option, /* only on mode=[balance_tlb|balance_alb] */ pub lp_interval: Option, /* only on mode=[balance_tlb|balance_alb|balance_RR|active-backup] */ @@ -336,7 +336,7 @@ impl From for HashMap { if let Some(m) = &bond.miimon { h.insert(String::from("miimon"), format!("{}", m.frequency)); h.insert( - String::from("carrier_detect"), + String::from("use_carrier"), match m.carrier_detect { CarrierDetect::Ioctl => 0, CarrierDetect::Netif => 1, @@ -414,8 +414,8 @@ impl From for HashMap { if let Some(v) = &bond.num_grat_arp { h.insert(String::from("num_grat_arp"), v.to_string()); } - if let Some(v) = &bond.num_usol_na { - h.insert(String::from("num_usol_na"), v.to_string()); + if let Some(v) = &bond.num_unsol_na { + h.insert(String::from("num_unsol_na"), v.to_string()); } if let Some(v) = &bond.lp_interval { h.insert(String::from("lp_interval"), v.to_string()); @@ -660,7 +660,7 @@ mod tests { min_links: Some(3), primary_reselect: Some(PrimaryReselect::Better), num_grat_arp: Some(7), - num_usol_na: Some(13), + num_unsol_na: Some(13), lp_interval: Some(17), resend_igmp: Some(19), all_slaves_active: Some(true), @@ -693,13 +693,13 @@ mod tests { ("primary_reselect", String::from("better")), ("fail_over_mac", String::from("active")), ("num_grat_arp", 7.to_string()), - ("num_usol_na", 13.to_string()), + ("num_unsol_na", 13.to_string()), ("lp_interval", 17.to_string()), ("resend_igmp", 19.to_string()), ("all_slaves_active", 1.to_string()), // miimon ("miimon", 42.to_string()), - ("carrier_detect", 1.to_string()), + ("use_carrier", 1.to_string()), ("downdelay", 23.to_string()), ("updelay", 5.to_string()), // arpmon diff --git a/rust/agama-migrate-wicked/src/reader.rs b/rust/agama-migrate-wicked/src/reader.rs index 2856f83743..a41f727e57 100644 --- a/rust/agama-migrate-wicked/src/reader.rs +++ b/rust/agama-migrate-wicked/src/reader.rs @@ -110,7 +110,7 @@ mod tests { 11 better 13 - 17 + 17 19 23 true @@ -155,7 +155,7 @@ mod tests { min_links: Some(11), primary_reselect: Some(PrimaryReselect::Better), num_grat_arp: Some(13), - num_usol_na: Some(17), + num_unsol_na: Some(17), lp_interval: Some(19), resend_igmp: Some(23), all_slaves_active: Some(true),