Skip to content

Commit

Permalink
be2net: clear promiscuous bits in adapter->flags while disabling prom…
Browse files Browse the repository at this point in the history
…iscuous mode

We should clear promiscuous bits in adapter->flags while disabling promiscuous
mode. Else we will not put interface back into VLAN promisc mode if the vlans
already added exceeds the maximum limit.

Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Somnath kotur authored and David S. Miller committed Mar 3, 2014
1 parent c502224 commit 7ad0945
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,14 @@ static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid)
return status;
}

static void be_clear_promisc(struct be_adapter *adapter)
{
adapter->promiscuous = false;
adapter->flags &= ~BE_FLAGS_VLAN_PROMISC;

be_cmd_rx_filter(adapter, IFF_PROMISC, OFF);
}

static void be_set_rx_mode(struct net_device *netdev)
{
struct be_adapter *adapter = netdev_priv(netdev);
Expand All @@ -1170,9 +1178,7 @@ static void be_set_rx_mode(struct net_device *netdev)

/* BE was previously in promiscuous mode; disable it */
if (adapter->promiscuous) {
adapter->promiscuous = false;
be_cmd_rx_filter(adapter, IFF_PROMISC, OFF);

be_clear_promisc(adapter);
if (adapter->vlans_added)
be_vid_config(adapter);
}
Expand Down

0 comments on commit 7ad0945

Please sign in to comment.