Skip to content

Commit

Permalink
multipeer: set "connected" state on SET_MODE
Browse files Browse the repository at this point in the history
Mostly due to existing client logic, set adapter to
"connected" state already in SET_MODE ioctl.

Signed-off-by: Lev Stipakov <[email protected]>
  • Loading branch information
lstipakov committed Nov 14, 2024
1 parent 71dba06 commit e333765
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,15 @@ OvpnSetMode(POVPN_DEVICE device, WDFREQUEST request)

LOG_INFO("Set mode", TraceLoggingValue(static_cast<int>(mode->Mode), "mode"));

switch (mode->Mode) {
case OVPN_MODE_P2P:
case OVPN_MODE_MP:
device->Mode = mode->Mode;
break;
if (mode->Mode == OVPN_MODE_MP) {
OvpnAdapterSetLinkState(OvpnGetAdapterContext(device->Adapter), MediaConnectStateConnected);

default:
device->Mode = mode->Mode;
}
else if (mode->Mode == OVPN_MODE_P2P) {
device->Mode = mode->Mode;
} else {
status = STATUS_INVALID_PARAMETER;
break;
}

return status;
Expand Down Expand Up @@ -426,8 +426,6 @@ OvpnMPStartVPN(POVPN_DEVICE device, WDFREQUEST request, ULONG_PTR* bytesReturned
*bytesReturned = sizeof(OVPN_MP_START_VPN);
}

OvpnAdapterSetLinkState(OvpnGetAdapterContext(device->Adapter), MediaConnectStateConnected);

done:
LOG_EXIT();

Expand Down

0 comments on commit e333765

Please sign in to comment.