From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id D76CA1FF09B for ; Mon, 09 Nov 2026 15:05:52 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 81130213DD; Mon, 09 Nov 2026 15:05:52 +0100 (CET) Message-ID: Date: Mon, 9 Nov 2026 15:05:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox 1/3] fix #6121: network-api: api: add `bond-miimon` option for interfaces To: Christoph Heiss References: <20260925123459.424903-1-c.heiss@proxmox.com> <20260925123459.424903-2-c.heiss@proxmox.com> <37db266f-b721-4f04-b6d8-4e4add78badc@proxmox.com> <3a0bc117-c324-46c7-bc68-853b7df66c1d@proxmox.com> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <3a0bc117-c324-46c7-bc68-853b7df66c1d@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794233148535 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.433 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ER2N665KREDY646WE24J4CIVNFMQOGFK X-Message-ID-Hash: ER2N665KREDY646WE24J4CIVNFMQOGFK X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pbs-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 11/9/26 2:28 PM, Christoph Heiss wrote: > Thanks for the review! > > On 11/9/26 11:15, Christian Ebner wrote: >> one question inline. >> >> On 9/25/26 2:35 PM, Christoph Heiss wrote: >>> [..] >>> --- a/proxmox-network-api/src/api_types.rs >>> +++ b/proxmox-network-api/src/api_types.rs >>> @@ -228,6 +228,12 @@ pub const NETWORK_INTERFACE_LIST_SCHEMA: Schema = >>>               type: BondXmitHashPolicy, >>>               optional: true, >>>           }, >>> +        "bond-miimon": { >>> +            description: "Link monitoring interval in milliseconds >>> for bond interfaces.", >>> +            type: u8, >> >> isn't this to restrictive? >> >> At least the Kernel seem to accept larger values AFAICT: >> - https://github.com/torvalds/linux/blob/master/drivers/net/bonding/ >> bond_options.c#L149 >> - https://github.com/torvalds/linux/blob/master/drivers/net/bonding/ >> bond_main.c#L6174 > > Good catch. > > At least ifupdown2 says that the value range should be to 0-255 [0] - > which is what I did go off - but actually never enforces that. I.e. the > value is never validated against `validrange`, it's just a documentation > thing at the end. > > The netlink interface also indeed accepts a u32 [1] FWIW, so that's the > right thing to do. > > E.g. setting up `/etc/network/interfaces` with > >   auto bond0 >   iface bond0 inet manual >     bond-slaves nic1 foo >     bond-miimon 5000 >     bond-mode 802.3ad > > works just fine, `cat /sys/class/net/bond0/bonding/miimon` also shows > the correct value. > > I'll quickly send a v2 with that changed. > > [0] https://github.com/CumulusNetworks/ifupdown2/blob/master/ifupdown2/ > addons/bond.py#L80-L85 > [1] https://github.com/torvalds/linux/ > blob/7475ea8b58616b33c04afb976cf0fbaad9dd63fb/drivers/net/bonding/ > bond_netlink.c#L255 The actual limit enforced is i32::MAX afaict, so best to store as u32 and check for i32::MAX not being exceeded?