ip link add: support bond device creation#30
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for creating, configuring, and displaying network bond interfaces, including parsing various bond options and adding integration tests. The review feedback suggests several improvements: using the matched key instead of hardcoded strings in error messages for certain bond parameters, trimming whitespace when parsing comma-separated IP target lists to prevent parsing failures, and checking for empty target vectors to avoid formatting issues in the display output.
3fd128f to
1b9c849
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for creating and configuring network bond interfaces, including parsing bond parameters, updating serialization and display formatting, and adding integration tests. The review feedback highlights opportunities to improve parsing robustness and compatibility with standard iproute2 behavior. Specifically, it suggests filtering out empty segments when parsing comma-separated IP targets, supporting string descriptors for all_slaves_active, and allowing '0' and '1' values for boolean options like lacp_active, coupled_control, and broadcast_neighbor.
Introduced support `ip link add NAME type bond [OPTIONS]`. Accepts all bond options identical to iproute2. Uses netlink-packet-route FromStr/Display for all bond options (BondMode, BondArpValidate, BondArpAllTargets, BondPrimaryReselect, BondFailOverMac, BondAdSelect, BondXmitHashPolicy) via a generic parse_from_str helper. Added arp_ip_target, ns_ip6_target, ad_actor_sys_prio, ad_user_port_key, ad_actor_system display fields. Includes 7 integration tests for bond creation with various option combinations. Signed-off-by: Gris Ge <cnfourt@gmail.com>
Introduced support
ip link add NAME type bond [OPTIONS].Accepts all bond options identical to iproute2:
mode, active_slave, miimon, updelay, downdelay,
peer_notify_delay, use_carrier, arp_interval, arp_validate,
arp_all_targets, arp_ip_target, ns_ip6_target, primary,
primary_reselect, fail_over_mac, xmit_hash_policy,
resend_igmp, num_grat_arp/num_unsol_na, all_slaves_active,
min_links, lp_interval, packets_per_slave, tlb_dynamic_lb,
lacp_rate, lacp_active/ad_lacp_active, coupled_control,
broadcast_neighbor, ad_select, ad_user_port_key,
ad_actor_sys_prio, ad_actor_system, arp_missed_max
Uses netlink-packet-route FromStr/Display for all bond options
(BondMode, BondArpValidate, BondArpAllTargets, BondPrimaryReselect,
BondFailOverMac, BondAdSelect, BondXmitHashPolicy) via a generic
parse_from_str helper.
Added arp_ip_target, ns_ip6_target, ad_actor_sys_prio,
ad_user_port_key, ad_actor_system display fields.
Includes 7 integration tests for bond creation with various
option combinations.