bonding: use bond_is_lb() when it's appropriate
authorJiri Pirko <jpirko@redhat.com>
Wed, 27 May 2009 05:42:36 +0000 (05:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 May 2009 05:08:31 +0000 (22:08 -0700)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c
drivers/net/bonding/bonding.h

index 92a9d69c5650e91c6c8c536d345172d35b8acbdc..2f4329e91a4c06a67173b43bfdeb9e115e9d4451 100644 (file)
@@ -2405,8 +2405,7 @@ static void bond_miimon_commit(struct bonding *bond)
                                bond_3ad_handle_link_change(slave,
                                                            BOND_LINK_DOWN);
 
-                       if (bond->params.mode == BOND_MODE_TLB ||
-                           bond->params.mode == BOND_MODE_ALB)
+                       if (bond_is_lb(bond))
                                bond_alb_handle_link_change(bond, slave,
                                                            BOND_LINK_DOWN);
 
index ca849d2adf98d7a79861b6c333a6f0357fe789cf..41ceca12c68f3b3a07c831545a492b37ed25d547 100644 (file)
@@ -286,8 +286,7 @@ static inline unsigned long slave_last_rx(struct bonding *bond,
 static inline void bond_set_slave_inactive_flags(struct slave *slave)
 {
        struct bonding *bond = netdev_priv(slave->dev->master);
-       if (bond->params.mode != BOND_MODE_TLB &&
-           bond->params.mode != BOND_MODE_ALB)
+       if (!bond_is_lb(bond))
                slave->state = BOND_STATE_BACKUP;
        slave->dev->priv_flags |= IFF_SLAVE_INACTIVE;
        if (slave_do_arp_validate(bond, slave))