device: Fix an autoconnect corner case

Make sure device->autoconnect is set when entering the autoconnect state
after netdev UP event.  Otherwise the next time
device_set_autoconnect(device, false) is called it will exit early seeing
that device->autoconnect is false and not switch the device state.
This commit is contained in:
Andrew Zaborowski 2017-11-27 15:34:23 +01:00 committed by Denis Kenzior
parent 46c1e8fa60
commit 016dcd52d8
1 changed files with 1 additions and 0 deletions

View File

@ -2162,6 +2162,7 @@ static void device_netdev_notify(struct netdev *netdev,
switch (event) {
case NETDEV_WATCH_EVENT_UP:
device->autoconnect = true;
device_enter_state(device, DEVICE_STATE_AUTOCONNECT);
WATCHLIST_NOTIFY(&device_watches, device_watch_func_t,