Skip to content

Commit 8c7a772

Browse files
George Wilkiedavem330
authored andcommitted
team: use operstate consistently for linkup
When a port is added to a team, its initial state is derived from netif_carrier_ok rather than netif_oper_up. If it is carrier up but operationally down at the time of being added, the port state.linkup will be set prematurely. port state.linkup should be set consistently using netif_oper_up rather than netif_carrier_ok. Fixes: f1d22a1 ("team: account for oper state") Signed-off-by: George Wilkie <gwilkie@vyatta.att-mail.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c286909 commit 8c7a772

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/team/team.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
12561256
list_add_tail_rcu(&port->list, &team->port_list);
12571257
team_port_enable(team, port);
12581258
__team_compute_features(team);
1259-
__team_port_change_port_added(port, !!netif_carrier_ok(port_dev));
1259+
__team_port_change_port_added(port, !!netif_oper_up(port_dev));
12601260
__team_options_change_check(team);
12611261

12621262
netdev_info(dev, "Port device %s added\n", portname);
@@ -2915,7 +2915,7 @@ static int team_device_event(struct notifier_block *unused,
29152915

29162916
switch (event) {
29172917
case NETDEV_UP:
2918-
if (netif_carrier_ok(dev))
2918+
if (netif_oper_up(dev))
29192919
team_port_change_check(port, true);
29202920
break;
29212921
case NETDEV_DOWN:

0 commit comments

Comments
 (0)