From patchwork Fri Jun 3 20:14:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Bohac X-Patchwork-Id: 98650 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 92F2EB6FA5 for ; Sat, 4 Jun 2011 06:14:32 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755520Ab1FCUO1 (ORCPT ); Fri, 3 Jun 2011 16:14:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48411 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752399Ab1FCUO0 (ORCPT ); Fri, 3 Jun 2011 16:14:26 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 468AA86A2E; Fri, 3 Jun 2011 22:14:24 +0200 (CEST) Date: Fri, 3 Jun 2011 22:14:24 +0200 From: Jiri Bohac To: Jay Vosburgh , Andy Gospodarek , "David S. Miller" , netdev@vger.kernel.org Cc: Pedro Garcia , Patrick McHardy Subject: [PATCH 2/2] bonding: restore NETIF_F_VLAN_CHALLENGED properly in bond_del_vlan() Message-ID: <20110603201424.GB24804@midget.suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110603200738.GA24804@midget.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since commit ad1afb00, bond_del_vlan() never restores NETIF_F_VLAN_CHALLENGED as intended. bond->vlan_list is never empty once the 8021q module is loaded, because the special VLAN 0 is always kept registered on the bond interface. Change the condition to check if bond->vlan_list contains exactly one item instead of checking for an empty list. Signed-off-by: Jiri Bohac diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 17b4dd9..4d317cd 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -329,9 +329,10 @@ static int bond_del_vlan(struct bonding *bond, unsigned short vlan_id) kfree(vlan); - if (list_empty(&bond->vlan_list) && + if (bond->vlan_list.next->next == &bond->vlan_list && (bond->slave_cnt == 0)) { - /* Last VLAN removed and no slaves, so + /* Last VLAN removed (the only member of vlan_list + * is the special vid == 0 vlan) and no slaves, so * restore block on adding VLANs. This will * be removed once new slaves that are not * VLAN challenged will be added.