adhoc: set operstate on Start/Stop

Similar to 06aa84cca set the operstate when AdHoc is started and
stopped as it is no longer always set by netdev (only for station/p2p
interface types)
This commit is contained in:
James Prestwood 2021-04-30 15:40:01 -07:00 committed by Denis Kenzior
parent 29dd246f5e
commit 8606bd6435
1 changed files with 10 additions and 0 deletions

View File

@ -494,6 +494,11 @@ static void adhoc_join_cb(struct netdev *netdev, int result, void *user_data)
return;
}
l_rtnl_set_linkmode_and_operstate(iwd_get_rtnl(),
netdev_get_ifindex(adhoc->netdev),
IF_LINK_MODE_DEFAULT, IF_OPER_UP,
NULL, NULL, NULL);
adhoc->sta_watch_id = netdev_station_watch_add(netdev,
adhoc_station_changed_cb, adhoc);
@ -649,6 +654,11 @@ static struct l_dbus_message *adhoc_dbus_stop(struct l_dbus *dbus,
if (netdev_leave_adhoc(adhoc->netdev, adhoc_leave_cb, adhoc))
return dbus_error_failed(message);
l_rtnl_set_linkmode_and_operstate(iwd_get_rtnl(),
netdev_get_ifindex(adhoc->netdev),
IF_LINK_MODE_DORMANT, IF_OPER_DOWN,
NULL, NULL, NULL);
adhoc->pending = l_dbus_message_ref(message);
return NULL;