[Bug 1957128] Re: ifenslave fails to detach slave from bonded interface

Haw Loeung 1957128 at bugs.launchpad.net
Wed Jan 12 02:49:08 UTC 2022


Looks fixed in more recent versions.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ifenslave in Ubuntu.
https://bugs.launchpad.net/bugs/1957128

Title:
  ifenslave fails to detach slave from bonded interface

Status in ifenslave package in Ubuntu:
  Invalid
Status in ifenslave source package in Xenial:
  Invalid

Bug description:
  Hi,

  When I try to detach a slave from a bonded interface, it fails as
  follows:

  | [hloeung at myhost etc]$ sudo ifenslave -v -d bond0 ens2f1
  | ens2f1: is not enslaved to bond0

  It's definitely part of the bond:

  | [hloeung at myhost etc]$ ls /sys/class/net/bond0/ -la | grep ens
  | lrwxrwxrwx  1 root root    0 Jan 12 02:36 lower_ens2f0 -> ../../../pci0000:00/0000:00:02.0/0000:05:00.0/net/ens2f0
  | lrwxrwxrwx  1 root root    0 Jan 12 02:36 lower_ens2f1 -> ../../../pci0000:00/0000:00:02.0/0000:05:00.1/net/ens2f1

  Running ifenslave with `sh -x` shows this:

  | ...
  | + [ -z ens2f1 ]
  | + master=bond0
  | + shift
  | + [ -d /sys/class/net/bond0 ]
  | + [ -d /sys/class/net/bond0/bonding ]
  | + [  = 1 ]
  | + [ -d /sys/class/net/ens2f1 ]
  | + [ -z 1 ]
  | + [ ! -h /sys/class/net/bond0/slave_ens2f1 ]
  | + echo ens2f1: is not enslaved to bond0
  | ens2f1: is not enslaved to bond0
  | + continue
  | + exit 0

  I think the bug is in this code:

  | if [ -z "$DETACH" ]; then
  |         if [ -h "/sys/class/net/$master/slave_$slave" ] ||
  |            [ -h "/sys/class/net/$master/lower_$slave" ]; then
  |                 echo "$slave: already enslaved to $master" >&2
  |                 continue
  |         fi
  | ...
  | else
  |         if [ ! -h "/sys/class/net/$master/slave_$slave" ] ||
  |            [ ! -h "/sys/class/net/$master/lower_$slave" ]; then
  |                 echo "$slave: is not enslaved to $master" >&2
  |                 continue
  |         fi

  Where rather than ||, it should be && in the else block (for
  detaching).

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifenslave/+bug/1957128/+subscriptions




More information about the foundations-bugs mailing list