Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 421757

Summary: sys-apps/openrc-0.9.8.4 bonding options enumeration order
Product: Gentoo Hosted Projects Reporter: Lorand Kelemen <lorand.kelemen>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard: openrc:oldnet
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 417391    
Attachments: bonding.sh patch

Description Lorand Kelemen 2012-06-18 12:02:29 UTC
Created attachment 315659 [details]
bonding.sh patch

We are using bonding usually with two interfaces with ARP or MII link monitoring mode. (The bonding driver is not modular.)

We have the following problem:

/lib/rc/net/bonding.sh configures the bond mode in a loop, then after that it tries to configure all other bonding options in the next loop.

This way the following simple config breaks, because miimon is activated after downdelay is set:

config_bond0="192.168.0.2 netmask 255.255.255.0"
slaves_bond0="eth1 eth2"
mode_bond0="active-backup"
miimon_bond0="1000"
updelay_bond0="3000"
downdelay_bond0="2000"
primary_bond0="eth2" 
rc_net_bond0_need="net.eth1 net.eth2"

# /etc/init.d/net.bond0 restart
 * Caching service dependencies ...                                                                                                                    [ ok ]
 * Stopping sshd ...                                                                                                                                   [ ok ]
 * Unmounting network filesystems ...                                                                                                                  [ ok ]
 * Bringing down interface bond0
 *   Removing slaves from bond0 ...
 *     eth1 eth2                                                                                                                                       [ ok ]
 * Bringing up interface bond0
 *   Setting mode: active-backup
 *   Setting downdelay: 2000
/lib64/rc/net/bonding.sh: line 72: echo: write error: Operation not permitted
 *   Failed to configure downdelay (downdelay_bond0)
 *   Setting miimon: 1000
 *   Setting updelay: 3000
 *   Adding slaves to bond0 ...
 *     eth1 eth2                                                                                                                                       [ ok ]
 *   192.168.0.2 ...                                                                                                                                   [ ok ]
#  * Starting sshd ...
 * Mounting network filesystems ... 

It would be advisable to handle the 'miimon' value as a separate value like the 'mode' value.

I attached a patch, please review it.
Comment 1 William Hubbs gentoo-dev 2012-10-17 18:53:14 UTC
This patch has been applied in commit f671e0a.
Thanks for the report and the fix.