ifenslave can't delete interfaces from a bond

Bug #1298325 reported by Kees Hoekzema
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
ifenslave (Ubuntu)
Fix Released
High
Unassigned
Xenial
New
Undecided
Unassigned

Bug Description

Deleting an interface from a bond does not work and gives you an error: "$interface is not enslaved to $bond"

To reproduce:

# cat /etc/modprobe.d/bonding.conf
alias bond0 bonding
alias bond1 bonding
options bond0 mode=1 primary=em1 max_bonds=2
options bond1 mode=1 primary=em3 max_bonds=2

# modprobe bond0
# modprobe bond1
# ifenslave bond0 em1 em2
# ifenslave bond1 em3 em4

works (almost) fine, in /proc/net/bonding/bond* everything looks enslaved (but bond1 does not have a primary slave)

However, deleting an interface from a bond results in an error:
# ifenslave -d bond1 em4
em4: is not enslaved to bond1

em4 is still enslaved according to /proc/net/bonding/bond1

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ifenslave 2.4ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-19.40-generic 3.13.6
Uname: Linux 3.13.0-19-generic x86_64
ApportVersion: 2.13.3-0ubuntu1
Architecture: amd64
Date: Thu Mar 27 12:28:03 2014
InstallationDate: Installed on 2014-03-26 (1 days ago)
InstallationMedia: Ubuntu-Server 13.10 "Saucy Salamander" - Release amd64 (20131016)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_US:en
 TERM=linux
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ifenslave
UpgradeStatus: Upgraded to trusty on 2014-03-26 (1 days ago)

Revision history for this message
Kees Hoekzema (kees-r) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ifenslave (Ubuntu):
status: New → Confirmed
Revision history for this message
Kees (kees2014) wrote :

I experience the same issue.

As a workaround this works:
sudo su
echo -p5p5 /sys/class/net/bond1/bonding/slaves

Revision history for this message
T Parys (tparys) wrote :

Looks like a bad case of copy / paste. Lines 111-112 appear to be copied from lines 96-97, with the logical checks flipped. Looks like they forgot to swap the Boolean.

Patch attached. Could we get a dev to apply the fix?

Revision history for this message
T Parys (tparys) wrote :

Updated tags to include xenial, as bug is still present.

tags: added: xenial
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Patch to ifenslave" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in ifenslave (Ubuntu):
importance: Undecided → High
Revision history for this message
Brian Murray (brian-murray) wrote :

It looks like Debian is affected by the same bug, so it'd be worth forwarding the bug and your patch to Debian also. Thanks!

tags: added: yakkety
Changed in ifenslave (Ubuntu):
status: Confirmed → Triaged
tags: added: canonical-bootstack
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ifenslave - 2.9ubuntu1

---------------
ifenslave (2.9ubuntu1) bionic; urgency=low

  * Merge from Debian unstable. Remaining changes:
    - Upstart event based bond bringup:
      + Drop ethernet+wifi example
      + Drop two_ethernet example
      + Update ethernet+hotplug_wifi example
      + Update two_hotplug_ethernet example
      + Update pre-up and post-down scripts for event bringup
      + Update README.Debian examples
    - Update scripts to use /run/network/ifstate instead of
      /etc/network/run/ifstate

ifenslave (2.9) unstable; urgency=medium

  [ Peter Pentchev ]
  * Brown paper bag: fix the correct check for detaching interfaces,
    this time really closing #838918 and unbreaking attachment, too.

ifenslave (2.8) unstable; urgency=medium

  [ Peter Pentchev ]
  * Fix detaching interfaces after the /slave_ to /lower_ change
    (Closes: #838918, LP: #1298325).
  * Declare compliance with version 3.9.8 of the Debian Policy Manual.
  * Fix some typographical and grammatical errors.
  * Switch to the HTTPS scheme for the VCS and copyright format URLs.
  * Switch to cgit for the Vcs-Browser field.
  * Bump the debhelper compatibility version to 10 with no changes.
  * Stop suggesting that bugs be filed against ifenslave-2.6 when
    the package name is ifenslave now.

 -- Steve Langasek <email address hidden> Fri, 16 Mar 2018 16:04:23 -0700

Changed in ifenslave (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

Can we have that in Xenial as well?

Ante Karamatić (ivoks)
tags: added: 4010
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.