netdev
[Top] [All Lists]

Re: more on the bonding driver

To: jn@xxxxxxxxxxxxxx
Subject: Re: more on the bonding driver
From: Andrew Morton <andrewm@xxxxxxxxxx>
Date: Fri, 11 Aug 2000 19:30:27 +1000
Cc: "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>, xenon@xxxxxxxxx
References: <39939BC9.4AFEBAFE@it.swin.edu.au>
Sender: owner-netdev@xxxxxxxxxxx
John Newbigin wrote:
> 
> I have found a solution to another problem with the bonding driver.
> 
> If you ifconfig down an enslaved eth device, the bonding driver is not
> notified and if there is an attempt to use the device then a crash
> results.  I have added a one line fix to dev_close in net/core/dev.c
> 
>         /* if the device is a slave we should not touch it*/
>         if(dev->flags&IFF_SLAVE)
>                 return -EBUSY;
> 
> I put it after the check to see if the interface is up.
> 
> This may not be the best solution but it prevents the kernel crashes and
> as bond_release is not implemented there is not much point making the
> device release it's self.
> 
> Since I made this change and the one in my last message I have not been
> able to produce a crash.
> 
> (here is a script which will cause the crash on 2.2.16)
> #!/bin/bash
> insmod eepro100
> insmod bonding
> ifconfig bond0 192.168.1.2 up
> ifenslave bond0 eth0
> ifconfig eth0 down
> ifconfig bond0 down
> ifconfig bond0 192.168.1.2 up
> ifconfig bond0 down
> 
> Again, if someone could confirm this fix it would be good.
> 
> John.

I agree.

I've looked at the other users of IFF_SLAVE (eql.c and sbni.c).  They appear
to be OK with this change.  In fact I wonder if they're vulnerable to the
same problem in kernel 2.2.

<Prev in Thread] Current Thread [Next in Thread>
  • Re: more on the bonding driver, Andrew Morton <=