Bug 427979 - Creating/deleting bridge causes link down on physical device
Creating/deleting bridge causes link down on physical device
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: initscripts Maintenance Team
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2008-01-08 08:26 EST by Vitaliy Gusev
Modified: 2008-05-13 04:57 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-12 16:18:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Vitaliy Gusev 2008-01-08 08:26:16 EST
Description of problem:

After next steps in loop:
 - creating bridge
 - adding interface to the bridge
 - deleting interface from bridge
 - deleting bridge
real ethernet interface can be shut down.

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. # ifconfig eth0 up

 for ((i=0; i < 10; i++)); do
        brctl addbr br0
        brctl addif br0 eth0
        brctl delif br0 eth0
        brctl delbr br0

Actual results:   

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:B2:BE:FA
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:1064 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3698 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:90044 (87.9 KiB)  TX bytes:4778800 (4.5 MiB)
          Interrupt:169 Base address:0x2000

Expected results:

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:B2:BE:FA
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::20c:29ff:feb2:befa/64 Scope:Link
          RX packets:1052 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3686 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:89252 (87.1 KiB)  TX bytes:4776920 (4.5 MiB)
          Interrupt:169 Base address:0x2000

Additional info:

kernel 2.6.18-53.1.4.el5
Comment 1 Bill Nottingham 2008-01-08 12:14:11 EST
Assigning to kernel - this example isn't actually doing anything in initscripts.
Comment 2 Vitaliy Gusev 2008-01-09 04:50:32 EST
No, i think it is initscripts bug. 


When bridge is removed then:

 - udevd executes /etc/sysconfig/network-scripts/net.hotplug  
(see /etc/udev/rules.d/60-net.rules) with ACTION==unregister
 - net.hotplug executes "/sbin/ifdown br0"
 - /sbin/ifdown calls  /etc/sysconfig/network-scripts/ifdown-eth ifcfg-eth0

See restricted udevmonitor output:

UEVENT[1194549743.798732] add@/class/net/br0
UDEV  [1194549743.807660] add@/class/net/br0
UEVENT[1194549744.250802] remove@/class/net/br0
UDEV  [1194549744.251577] remove@/class/net/br0
UEVENT[1194549744.257474] add@/class/net/br0
UEVENT[1194549744.709364] remove@/class/net/br0
UEVENT[1194549744.713048] add@/class/net/br0
UEVENT[1194549745.173957] remove@/class/net/br0
UEVENT[1194549745.179690] add@/class/net/br0
UDEV  [1194549745.643538] add@/class/net/br0
UEVENT[1194549745.654329] remove@/class/net/br0
UEVENT[1194549745.656494] add@/class/net/br0
UEVENT[1194549746.141029] remove@/class/net/br0
UEVENT[1194549746.145332] add@/class/net/br0
UEVENT[1194549746.584747] remove@/class/net/br0
UEVENT[1194549746.588475] add@/class/net/br0
UEVENT[1194549747.083554] remove@/class/net/br0
UEVENT[1194549747.089255] add@/class/net/br0
UEVENT[1194549747.544509] remove@/class/net/br0
UEVENT[1194549747.548615] add@/class/net/br0
UDEV  [1194549747.983485] remove@/class/net/br0
UEVENT[1194549748.001215] remove@/class/net/br0

After event "UEVENT add" udevd handled "remove". br0 existed then "remove" was 
handled. eth0 was added to br0 => br0 has same ethernet address with eth0. 
Script /sbin/ifdown executed /etc/sysconfig/network-scripts/ifdown-eth 

Comment 3 Bill Nottingham 2008-05-12 16:01:31 EDT
It's still a kernel bug, AFAICT.

The only way for:

brctl delif br0 eth0
brctl delbr br0

to generate a remove event for br0 with the hardware address of eth0 is if delif
returns before the bridge actually processes the removal.
Comment 4 Bill Nottingham 2008-05-12 16:18:05 EDT
OK, I see what you're saying, but it still doesn't make much sense.

You're adding the interface to the bridge. The interface is not supposed to have
an IP address on the bridge - the bridge is where you configure the IP address.

To get what you describe, you'd have to be adding and removing an already
configured interface to the bridge, which is essentially a configuration error.
Ergo, closing.
Comment 5 Vitaliy Gusev 2008-05-13 04:52:27 EDT
We can't add interface to the bridge if one is up? 
Comment 6 Vitaliy Gusev 2008-05-13 04:57:25 EDT
I know about IP address on the interface. This problem also occurs when eth0 
doesn't have IP.

Note You need to log in before you can comment on or make changes to this bug.