udev / bonding interface race condition

While testing a redundant network interface in OpenSUSE 11.0 I ran into an error condition which prevents bonded interfaces coming up again on reboot. It appears to be related to the udev persistent net naming scheme, and can be easily reproduced.

eth0 and eth1 were configured as off, bond0 was configured as active-backup using eth0 and eth1 as slaves, largely as configured by yast, plus:

> BONDING_MODULE_OPTS=‘mode=1 miimon=100 use_carrier=0 primary=eth0’
> BONDING_SLAVE_0=‘eth0’
> BONDING_SLAVE_1=‘eth1’

added to /etc/sysconfig/ifcfg-bond0.
On rebooting to restart the network and initialize the bond0 interface all worked perfectly. On a second reboot, however, the eth1 interface was renamed to “eth1_rename”. since there was no eth1 slave the bonded interface failed to start (itself very odd because the redundancy of the bond should only require one working interface).

I noticed eth1’s MAC address had been replaced by one identical to eth0. This is evidently a normal thing for the bonding interface to do. on reboot this confuses udev’s persistent net naming rules, which use the MAC address to assign the interface name, into naming the interface eth1_rename_ren. It did not happen the first reboot because the interface had not yet reprogrammed the MAC address.

I was able to create a workaround for this problem by using lspci to determine the PCI bus ID, and changing lines in /etc/udev/rules.d/70-persistent-net.rules (“You can modify it,as long as you keep each rule on a single line”), such as changing:

SUBSYSTEM==“net”, ACTION==“add”, DRIVERS=="?", ATTR{address}==“00:1c:c0:33:00:5b”, ATTR{type}==“1”, KERNEL=="eth", NAME=“eth0”
to use the PCI bus ID to identify the devices:
SUBSYSTEM==“net”, ACTION==“add”, DRIVERS=="?", KERNELS==“0000:02:00.0”, ATTR{type}==“1”, KERNEL=="eth", NAME=“eth0”

Is there a different or easier workaround for this problem, and is it likely to cause problems, if the network card are not moved or PCI addresses change?