team: do not allow to map disabled ports

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko
2012-06-26 06:52:46 +00:00
committed by David S. Miller
parent 122bb046bc
commit 52a4fd7780
3 changed files with 6 additions and 4 deletions

View File

@@ -359,7 +359,8 @@ static int lb_tx_hash_to_port_mapping_set(struct team *team,
unsigned char hash = ctx->info->array_index;
list_for_each_entry(port, &team->port_list, list) {
if (ctx->data.u32_val == port->dev->ifindex) {
if (ctx->data.u32_val == port->dev->ifindex &&
team_port_enabled(port)) {
rcu_assign_pointer(LB_HTPM_PORT_BY_HASH(lb_priv, hash),
port);
return 0;