Bug 442124 - bonding: incorrect backport creates possible incorrect interface flags
bonding: incorrect backport creates possible incorrect interface flags
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.7
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Andy Gospodarek
Martin Jenner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-11 17:04 EDT by Andy Gospodarek
Modified: 2014-06-29 19:00 EDT (History)
2 users (show)

See Also:
Fixed In Version: RHSA-2008-0665
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-24 15:28:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andy Gospodarek 2008-04-11 17:04:58 EDT
This commit to the RHEL4 git tree contains contains an error:

commit ea821e7617146fa966f4e61a8ce3a010fafad098
Author: Brad Peters <bpeters@redhat.com>
Date:   Wed Mar 12 17:00:54 2008 -0400

    [NET] bonding: add MAC based failover support to bonding driver

This hunk is incorrect:

@@ -1874,17 +1890,20 @@ static int bond_enslave(struct net_device *bond_dev,
struct net_device *slave_de
                 * and then set it to the master's address
                 */
                memcpy(new_slave->perm_hwaddr, slave_dev->dev_addr, ETH_ALEN);
-
-               /* set slave to master's mac address
-                * The application already set the master's
-                * mac address to that of the first slave
-                */
-               memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
-               addr.sa_family = slave_dev->type;
-               res = slave_dev->set_mac_address(slave_dev, &addr);
-               if (res) {
-                       dprintk("Error %d calling set_mac_address\n", res);
-                       goto err_unset_master;
+               if (!bond->params.fail_over_mac) {
+                       /*
+                       * Set slave to master's mac address.  The
+                       * application already set the master's mac
+                       * address to that of the first slave
+                       */
+                       memcpy(addr.sa_data, bond_dev->dev_addr,
+                               bond_dev->addr_len);
+                       addr.sa_family = slave_dev->type;
+                       res = slave_dev->set_mac_address(slave_dev, &addr);
+                       if (res) {
+                               dprintk("Error %d calling set_mac_address\n", res);
+                               goto err_free;
+                       }
                }

                /* open the slave since the application closed it */

This patch corrects the problem.

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index c883da8..b5592f4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1903,7 +1903,7 @@ static int bond_enslave(struct net_device *bond_dev,
struct net_device *slave_de
                        res = slave_dev->set_mac_address(slave_dev, &addr);
                        if (res) {
                                dprintk("Error %d calling set_mac_address\n", res);
-                               goto err_free;
+                               goto err_unset_master;
                        }
                }

As the code stands right now if a call to slave_dev->set_mac_address(slave_dev,
&addr) fails the IFF_SLAVE flag will continue to be set on an interface.  This
will prevent the device from being enslaved again and would require deletion of
that device before it could be used in a bond.

The impact is probably minimal, but it should be fixed since this code was
introduced in this update cycle.
Comment 1 Andy Gospodarek 2008-04-11 17:08:29 EDT
Correctly formatted patch available here:

http://sharks.rdu.redhat.com/?p=gospo/rhel4-gtest.git;a=commitdiff;h=289b80ca09a5d3ba0ce31b467828ab486f45b731

Hopefully I'll add this to my test kernels next week.
Comment 2 RHEL Product and Program Management 2008-04-11 17:09:30 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 3 Andy Gospodarek 2008-04-14 09:33:20 EDT
My test kernels have been updated to include a patch for this bugzilla.

http://people.redhat.com/agospoda/#rhel4

Please test them and report back your results.
Comment 6 Vivek Goyal 2008-06-12 14:31:20 EDT
Committed in 73.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
Comment 9 errata-xmlrpc 2008-07-24 15:28:57 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2008-0665.html

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