Fix batch of minor bugs (#40197)
Fix ~40 minor bugs / issues.
Feng Wang committed
Apr 22, 2026 at 10:03 UTC
58bd525afed80f69994666b7224d0ad9dc163004
33 files changed
+62
-64
src/linux/inc/lxwil.h
+2
-2
@@ -223,7 +223,7 @@ inline int ResultFromCaughtException()
223
#define THROW_LAST_ERROR() THROW_ERRNO(errno);
224
225
#define THROW_INVALID() THROW_ERRNO(EINVAL)
226
-#define THROW_UNEXCEPTED() THROW_ERRNO(EINVAL)
226
+#define THROW_UNEXPECTED() THROW_ERRNO(EINVAL)
227
#define THROW_INVALID_IF(Condition) THROW_ERRNO_IF(EINVAL, (Condition))
228
#define THROW_UNEXPECTED_IF(Condition) THROW_ERRNO_IF(EINVAL, (Condition))
229
@@ -437,7 +437,7 @@ public:
437
static unique_pipe create(int flags)
438
{
439
int pipe[2] = {-1, -1};
440
- if (pipe2(pipe, flags) < -1)
440
+ if (pipe2(pipe, flags) < 0)
441
{
442
THROW_ERRNO(errno);
443
}
src/linux/init/DnsServer.cpp
-1
@@ -193,7 +193,6 @@ try
193
// whenever there is new data on the TCP connection.
194
epoll_event event{};
195
event.events = EPOLLIN;
196
- event.data.fd = localContext->m_tcpConnection.get();
196
event.data.ptr = localContext.get();
197
Syscall(epoll_ctl, m_epollFd.get(), EPOLL_CTL_ADD, localContext->m_tcpConnection.get(), &event);
198
src/linux/init/SecCompDispatcher.cpp
+5
-5
@@ -104,8 +104,8 @@ void SecCompDispatcher::Run()
104
}
105
int result = 0;
106
GNS_LOG_INFO(
107
- "Notified for arch {:X} syscall {} with id {}lu for pid {} with args ({}lX, {}lX, {}lX, {}lX, {}lX, "
108
- "{}lX)",
107
+ "Notified for arch {:X} syscall {} with id {} for pid {} with args ({:X}, {:X}, {:X}, {:X}, {:X}, "
108
+ "{:X})",
109
callInfo->data.arch,
110
callInfo->data.nr,
111
callInfo->id,
@@ -140,14 +140,14 @@ void SecCompDispatcher::Run()
140
resultInfo->val = 0;
141
resultInfo->flags = result == 0 ? SECCOMP_USER_NOTIF_FLAG_CONTINUE : 0;
142
143
- GNS_LOG_INFO("Responding to notification with id {}lu for pid {}, result {}", callInfo->id, callInfo->pid, result);
143
+ GNS_LOG_INFO("Responding to notification with id {} for pid {}, result {}", callInfo->id, callInfo->pid, result);
144
try
145
{
146
Syscall(ioctl, m_notifyFd.get(), SECCOMP_IOCTL_NOTIF_SEND, resultInfo);
147
}
148
catch (std::exception& e)
149
{
150
- GNS_LOG_ERROR("Failed to respond to notification with id {}lu for pid {}, {}", callInfo->id, callInfo->pid, e.what());
150
+ GNS_LOG_ERROR("Failed to respond to notification with id {} for pid {}, {}", callInfo->id, callInfo->pid, e.what());
151
}
152
}
153
}
@@ -211,7 +211,7 @@ std::optional<std::vector<gsl::byte>> SecCompDispatcher::ReadProcessMemory(uint6
211
}
212
catch (std::exception& e)
213
{
214
- GNS_LOG_ERROR("Failed to read process memory for pid {}, cookie {}u, {}", Pid, Cookie, e.what());
214
+ GNS_LOG_ERROR("Failed to read process memory for pid {}, cookie {}, {}", Pid, Cookie, e.what());
215
return std::nullopt;
216
}
217
}
src/linux/init/config.cpp
+1
-1
@@ -2247,7 +2247,7 @@ try
2247
const auto* Message = gslhelpers::try_get_struct<LX_INIT_MOUNT_DRVFS>(Buffer);
2248
if (!Message)
2249
{
2250
- LOG_ERROR("Unexpected sizeof for LX_INIT_MOUNT_DRVFS: {}u", Buffer.size());
2250
+ LOG_ERROR("Unexpected sizeof for LX_INIT_MOUNT_DRVFS: {}", Buffer.size());
2251
return -1;
2252
}
2253
src/linux/init/main.cpp
+5
-5
@@ -324,7 +324,7 @@ try
324
325
sched_param Parameter{};
326
Parameter.sched_priority = 0;
327
- THROW_LAST_ERROR_IF(pthread_setschedparam(pthread_self(), SCHED_IDLE, &Parameter) < 0);
327
+ THROW_LAST_ERROR_IF(pthread_setschedparam(pthread_self(), SCHED_IDLE, &Parameter) != 0);
328
329
//
330
// Periodically check if the machine is idle by querying procfs for CPU usage.
@@ -342,7 +342,7 @@ try
342
long long int const ReclaimThreshold = (get_nprocs() * sysconf(_SC_CLK_TCK) * SleepDuration / std::chrono::seconds(1)) / 200; // 0.5%
343
long long int ReclaimWindow[20] = {}; // 10 minutes
344
long long int ReclaimWindowLength = COUNT_OF(ReclaimWindow);
345
- bool ReclaimIdling;
345
+ bool ReclaimIdling = false;
346
347
//
348
// Fall back to drop cache if the required cgroup path is not present.
@@ -429,7 +429,7 @@ try
429
if (PageReportingOrder != 0 && (Start - Stop) > IdleThreshold)
430
{
431
std::this_thread::sleep_for(std::chrono::seconds(1));
432
- const long long int Stop = GetUserCpuTime();
432
+ Stop = GetUserCpuTime();
433
THROW_LAST_ERROR_IF(Stop == -1);
434
if ((Stop - Start) < IdleThreshold)
435
{
@@ -471,7 +471,7 @@ Return Value:
471
return {};
472
}
473
474
- struct sockaddr_nl Address;
474
+ struct sockaddr_nl Address{};
475
Address.nl_family = AF_NETLINK;
476
if (bind(Fd.get(), (struct sockaddr*)&Address, sizeof(Address)) < 0)
477
{
@@ -587,7 +587,7 @@ Return Value:
587
std::string content = wsl::shared::string::ReadFile<char, char>(std::format("/sys/block/{}/dev", BlockDeviceName).c_str());
588
auto separator = content.find(':');
589
590
- if (separator == 0 || separator - 1 >= content.size() || separator == std::string::npos)
590
+ if (separator == std::string::npos || separator == 0 || separator + 1 == content.size())
591
{
592
LOG_ERROR("Failed to parse device number '{}' for device '{}'", content.c_str(), BlockDeviceName.c_str());
593
THROW_ERRNO(EINVAL);
src/linux/init/plan9.cpp
+1
-1
@@ -184,7 +184,7 @@ void RunPlan9Server(const char* socketPath, const char* logFile, int logLevel, b
184
limit.rlim_cur = limit.rlim_max;
185
if (setrlimit(RLIMIT_NOFILE, &limit) < 0)
186
{
187
- LOG_ERROR("setrlimit(RLIMIT_NOFILE, {}lu, {}lu) failed {}", limit.rlim_cur, limit.rlim_max, errno);
187
+ LOG_ERROR("setrlimit(RLIMIT_NOFILE, {}, {}) failed {}", limit.rlim_cur, limit.rlim_max, errno);
188
}
189
190
// Open the root.
src/linux/init/util.cpp
+1
-4
@@ -172,6 +172,7 @@ Return Value:
172
if (!InteropConnection)
173
{
174
LOG_ERROR("accept4 failed {}", errno);
175
+ return {};
176
}
177
178
timeval Timeout{};
@@ -784,10 +785,6 @@ Return Value:
785
if (Output)
786
{
787
(*Output) += Buffer.data();
787
- if (Result < 0)
788
- {
789
- goto ErrorExit;
790
- }
788
}
789
else
790
{
src/linux/init/wslinfo.cpp
+1
-1
@@ -8,7 +8,7 @@ Module Name:
8
9
Abstract:
10
11
- This file wslpath function definitions.
11
+ This file contains wslinfo function definitions.
12
13
--*/
14
src/linux/mountutil/mountutil.c
+1
@@ -232,6 +232,7 @@ int MountParseMountInfoLine(char* line, PMOUNT_ENTRY entry)
232
{
233
goto ParseMountInfoLineEnd;
234
}
235
+ break;
236
237
case MountFieldRoot:
238
entry->Root = current;
src/linux/netlinkutil/Interface.cpp
+3
-3
@@ -356,7 +356,7 @@ void Interface::SetActiveChild(const Interface& child_interface)
356
void Interface::CreateTunTapAdapter(const std::string& name, bool TunAdapter)
357
{
358
wil::unique_fd fd;
359
- if (name.size() > IFNAMSIZ)
359
+ if (name.size() >= IFNAMSIZ)
360
{
361
throw RuntimeErrorWithSourceLocation("Tun adapter name exceeds IFNAMSIZ");
362
}
@@ -644,7 +644,7 @@ void Interface::EnableNetworkSetting(const char* settingName, int addressFamily)
644
645
wil::unique_fd fd(Syscall(open, settingFilePath.c_str(), (O_WRONLY | O_CLOEXEC)));
646
647
- Syscall(write, fd.get(), c_value1, sizeof(c_value1));
647
+ Syscall(write, fd.get(), c_value1, sizeof(c_value1) - 1);
648
}
649
650
void Interface::DisableNetworkSetting(const char* settingName, int addressFamily)
@@ -654,7 +654,7 @@ void Interface::DisableNetworkSetting(const char* settingName, int addressFamily
654
655
wil::unique_fd fd(Syscall(open, settingFilePath.c_str(), (O_WRONLY | O_CLOEXEC)));
656
657
- Syscall(write, fd.get(), c_value0, sizeof(c_value0));
657
+ Syscall(write, fd.get(), c_value0, sizeof(c_value0) - 1);
658
}
659
660
void Interface::ResetIpv6State()
src/linux/netlinkutil/NetlinkMessage.hxx
+1
-1
@@ -70,7 +70,7 @@ std::vector<const TAttribute*> NetlinkMessage<TMessage>::Attributes(int type) co
70
std::format(
71
"Attribute at offset {}: attempted to access beyond attribute offset ({} > {})",
72
(reinterpret_cast<const char*>(e) - &*m_responseBegin),
73
- sizeof(TMessage),
73
+ sizeof(TAttribute),
74
e->rta_len));
75
}
76
src/linux/plan9/p9file.cpp
+1
-1
@@ -1060,7 +1060,7 @@ LX_INT File::Access(AccessFlags flags)
1060
}
1061
1062
std::string parentPath;
1063
- const int index = name.find_last_of('/');
1063
+ const auto index = name.find_last_of('/');
1064
if (index != std::string::npos)
1065
{
1066
parentPath = name.substr(0, index);
src/linux/plan9/p9file.h
+1
-1
@@ -33,7 +33,7 @@ struct Root final : public IRoot
33
std::vector<char> buffer(bufsize);
34
passwd pwd{};
35
passwd* result = nullptr;
36
- if (getpwuid_r(uid, &pwd, buffer.data(), buffer.size(), &result) < 0 || result == nullptr)
36
+ if (getpwuid_r(uid, &pwd, buffer.data(), buffer.size(), &result) != 0 || result == nullptr)
37
{
38
Plan9TraceLoggingProvider::LogMessage(std::format("getpwuid_r failed for uid: {}, errno={}", uid, errno));
39
return;
src/linux/plan9/p9io.cpp
+7
-7
@@ -24,14 +24,14 @@ CoroutineIoIssuer::CoroutineIoIssuer(int fd) : m_FileDescriptor(fd)
24
void CoroutineIoIssuer::Callback(sigval value)
25
{
26
const auto operation = static_cast<CoroutineIoOperation*>(value.sival_ptr);
27
- auto bytesTransferred = aio_return(&operation->ControlBlock);
28
- int error = 0;
29
- if (bytesTransferred < 0)
27
+ auto error = aio_error(&operation->ControlBlock);
28
+ if (error == EINPROGRESS)
29
{
31
- error = aio_error(&operation->ControlBlock);
30
+ return;
31
}
32
+ auto bytesTransferred = aio_return(&operation->ControlBlock);
33
34
- operation->Result = {error, static_cast<size_t>(bytesTransferred)};
34
+ operation->Result = {-error, error == 0 ? static_cast<size_t>(bytesTransferred) : 0};
35
if (!operation->DoneOrCoroutine.exchange(true))
36
{
37
return;
@@ -55,7 +55,7 @@ bool CoroutineIoIssuer::PreIssue(CoroutineIoOperation& operation, CancelToken& t
55
}
56
57
// The operation has already been cancelled. Don't even issue the IO.
58
- operation.Result = {ECANCELED, 0};
58
+ operation.Result = {-ECANCELED, 0};
59
operation.DoneOrCoroutine = true;
60
return false;
61
}
@@ -286,7 +286,7 @@ Task<IoResult> WriteAsync(CoroutineIoIssuer& file, std::uint64_t offset, gsl::sp
286
cb.aio_offset = offset;
287
if (aio_write(&cb) < 0)
288
{
289
- return {errno, 0};
289
+ return {-errno, 0};
290
}
291
292
return {};
src/linux/plan9/p9readdir.cpp
+1
-1
@@ -27,7 +27,7 @@ struct dirent* DirectoryEnumerator::Next()
27
if (result == nullptr)
28
{
29
// If errno is still 0, it means EOF is reached which is not an error.
30
- THROW_LAST_ERROR_IF(errno != 0)
30
+ THROW_LAST_ERROR_IF(errno != 0);
31
}
32
else
33
{
src/linux/plan9/p9util.cpp
+2
-2
@@ -162,7 +162,7 @@ gid_t GetUserGroupId(uid_t uid)
162
for (;;)
163
{
164
buffer.resize(size);
165
- if (getpwuid_r(uid, &pwd, buffer.data(), size, &result) < 0)
165
+ if (getpwuid_r(uid, &pwd, buffer.data(), size, &result) != 0)
166
{
167
if (errno != ERANGE)
168
{
@@ -198,7 +198,7 @@ gid_t GetGroupIdByName(const char* name)
198
for (;;)
199
{
200
buffer.resize(size);
201
- if (getgrnam_r(name, &grp, buffer.data(), size, &result) < 0)
201
+ if (getgrnam_r(name, &grp, buffer.data(), size, &result) != 0)
202
{
203
if (errno != ERANGE)
204
{
src/shared/configfile/configfile.cpp
+2
-2
@@ -768,11 +768,11 @@ ValueDone:
768
fprintf(stderr, "expected \"\n");
769
}
770
771
- EMIT_USER_WARNING(Localization::MessageConfigExpected("'", filePath, line));
771
+ EMIT_USER_WARNING(Localization::MessageConfigExpected("\"", filePath, line));
772
773
// This key value will be overwritten, so we can ignore any malformed values.
774
// However, we can still inform the user of the issue per warning above.
775
- if (!firstMatchedKey || !matchedKey)
775
+ if (!firstMatchedKey && !matchedKey)
776
{
777
goto InvalidLine;
778
}
src/shared/inc/message.h
+4
-4
@@ -167,12 +167,13 @@ private:
167
168
size_t GetRelativeIndex(unsigned int& Index)
169
{
170
- const size_t Offset = reinterpret_cast<char*>(&Index) - reinterpret_cast<char*>(m_buffer.data());
170
+ const auto* indexPtr = reinterpret_cast<char*>(&Index);
171
+ const auto* bufferStart = reinterpret_cast<char*>(m_buffer.data());
172
173
// Validate that 'Index' is actually within the bounds of our buffer
173
- assert(Offset >= 0 && Offset < m_buffer.size());
174
+ assert(indexPtr >= bufferStart && indexPtr + sizeof(index) <= bufferStart + m_buffer.size());
175
175
- return Offset;
176
+ return static_cast<size_t>(indexPtr - bufferStart);
177
}
178
179
void WriteRelativeIndex(size_t Offset, unsigned int Value)
@@ -181,6 +182,5 @@ private:
182
}
183
184
std::vector<std::byte> m_buffer;
184
- size_t m_offset = 0;
185
};
186
} // namespace wsl::shared
\ No newline at end of file
src/shared/inc/prettyprintshared.h
+1
-1
@@ -85,7 +85,7 @@ inline void PrettyPrint(std::stringstream& Out, const T (&Value)[Size])
85
Out << "[";
86
for (auto i = 0; i < Size; i++)
87
{
88
- if (i > 0 && i < Size - 1)
88
+ if (i > 0 && i < Size)
89
{
90
Out << ",";
91
}
src/shared/inc/socketshared.h
+3
-3
@@ -49,7 +49,7 @@ try
49
#if defined(_MSC_VER)
50
THROW_HR(E_UNEXPECTED);
51
#elif defined(__GNUC__)
52
- THROW_UNEXCEPTED();
52
+ THROW_UNEXPECTED();
53
#endif
54
}
55
@@ -60,7 +60,7 @@ try
60
#if defined(_MSC_VER)
61
THROW_HR_MSG(E_UNEXPECTED, "Unexpected message size: %llu", MessageSize);
62
#elif defined(__GNUC__)
63
- THROW_UNEXCEPTED();
63
+ THROW_UNEXPECTED();
64
#endif
65
}
66
@@ -69,7 +69,7 @@ try
69
#if defined(_MSC_VER)
70
THROW_HR_MSG(E_UNEXPECTED, "Message size too large: %llu", MessageSize);
71
#elif defined(__GNUC__)
72
- THROW_UNEXCEPTED();
72
+ THROW_UNEXPECTED();
73
#endif
74
}
75
src/shared/inc/stringshared.h
+5
-4
@@ -181,6 +181,11 @@ inline std::string CleanHostname(const std::string_view Hostname)
181
}
182
}
183
184
+ if (result.size() > 64)
185
+ {
186
+ result.resize(64);
187
+ }
188
+
189
while (!result.empty() && (result.back() == '.' || result.back() == '-'))
190
{
191
result.pop_back();
@@ -190,10 +195,6 @@ inline std::string CleanHostname(const std::string_view Hostname)
195
{
196
result = c_defaultHostName;
197
}
193
- else if (result.size() > 64)
194
- {
195
- result.resize(64);
196
- }
198
199
return result;
200
}
src/windows/common/HandleConsoleProgressBar.cpp
+1
-1
@@ -22,7 +22,7 @@ HandleConsoleProgressBar::HandleConsoleProgressBar(HANDLE handle, std::wstring&&
22
{
23
// If this file isn't a disk file, we can't show actual progress. Just show an indicator in that case
24
LARGE_INTEGER fileSize{};
25
- if (GetFileType(handle) != FILE_TYPE_DISK || FAILED(GetFileSizeEx(handle, &fileSize)))
25
+ if (GetFileType(handle) != FILE_TYPE_DISK || !GetFileSizeEx(handle, &fileSize))
26
{
27
m_progressBar.emplace<ConsoleProgressIndicator>(std::move(message));
28
}
src/windows/common/WslCoreNetworkingSupport.cpp
+2
-2
@@ -117,11 +117,11 @@ bool wsl::core::networking::IsFlowSteeringSupportedByHns() noexcept
117
allocatePortRange.load(c_computeNetworkModuleName, "HcnReserveGuestNetworkServicePortRange"));
118
119
static LxssDynamicFunction<decltype(HcnReserveGuestNetworkServicePort)> allocatePort{DynamicFunctionErrorLogs::None};
120
- RETURN_IF_FAILED_EXPECTED(allocatePortRange.load(c_computeNetworkModuleName, "HcnReserveGuestNetworkServicePort"));
120
+ RETURN_IF_FAILED_EXPECTED(allocatePort.load(c_computeNetworkModuleName, "HcnReserveGuestNetworkServicePort"));
121
122
static LxssDynamicFunction<decltype(HcnReleaseGuestNetworkServicePortReservationHandle)> releasePort{DynamicFunctionErrorLogs::None};
123
RETURN_IF_FAILED_EXPECTED(
124
- allocatePortRange.load(c_computeNetworkModuleName, "HcnReleaseGuestNetworkServicePortReservationHandle"));
124
+ releasePort.load(c_computeNetworkModuleName, "HcnReleaseGuestNetworkServicePortReservationHandle"));
125
126
supported = true;
127
}
src/windows/common/WslInstall.cpp
+1
-1
@@ -70,7 +70,7 @@ std::vector<BYTE> ParseHex(const std::wstring& input)
70
for (auto i = 0; i < input.size(); i += 2)
71
{
72
// Skip '0x', if any
73
- if (i == 0 && input[0] == '0' && tolower(input[1]) == 'x')
73
+ if (i == 0 && input.size() >= 2 && input[0] == '0' && tolower(input[1]) == 'x')
74
{
75
continue;
76
}
src/windows/common/filesystem.cpp
+2
-2
@@ -838,10 +838,10 @@ std::string wsl::windows::common::filesystem::GetLinuxHostName()
838
{
839
DWORD size = 0;
840
WI_VERIFY(GetComputerNameExA(ComputerNamePhysicalDnsHostname, nullptr, &size) == FALSE);
841
- std::string hostName(size, '\0');
841
+ std::string hostName(size - 1, '\0');
842
THROW_LAST_ERROR_IF(!GetComputerNameExA(ComputerNamePhysicalDnsHostname, hostName.data(), &size));
843
844
- WI_ASSERT((size <= LX_HOST_NAME_MAX) && (hostName.size() == size + 1));
844
+ WI_ASSERT((size <= LX_HOST_NAME_MAX) && (hostName.size() == size));
845
846
return wsl::shared::string::CleanHostname(hostName);
847
}
src/windows/common/helpers.cpp
+2
-2
@@ -215,7 +215,7 @@ void wsl::windows::common::helpers::ConnectPipe(_In_ HANDLE Pipe, _In_ DWORD Tim
215
}
216
217
const auto Result = WaitForMultipleObjects(gsl::narrow_cast<DWORD>(WaitHandles.size()), WaitHandles.data(), FALSE, Timeout);
218
- if (!ExitEvents.empty() && Result > WAIT_OBJECT_0 && Result <= WAIT_OBJECT_0 + WaitHandles.size())
218
+ if (!ExitEvents.empty() && Result > WAIT_OBJECT_0 && Result < WAIT_OBJECT_0 + WaitHandles.size())
219
{
220
THROW_HR(E_ABORT);
221
}
@@ -372,7 +372,7 @@ std::string wsl::windows::common::helpers::GetLinuxTimezone(_In_opt_ HANDLE User
372
373
THROW_HR_IF_MSG(E_FAIL, (U_FAILURE(status) != false), "%hs", u_errorName(status));
374
375
- timezone.resize(buffer.size());
375
+ timezone.resize(size);
376
u_UCharsToChars(buffer.data(), timezone.data(), static_cast<int32_t>(timezone.size()));
377
}
378
CATCH_LOG()
src/windows/common/relay.cpp
+1
-1
@@ -207,7 +207,7 @@ bool wsl::windows::common::relay::InterruptableWait(_In_ HANDLE WaitObject, _In_
207
const DWORD waitResult = WaitForMultipleObjects(gsl::narrow_cast<DWORD>(waitObjects.size()), waitObjects.data(), FALSE, INFINITE);
208
if (waitResult != WAIT_OBJECT_0)
209
{
210
- if (waitResult > WAIT_OBJECT_0 && waitResult <= WAIT_OBJECT_0 + waitObjects.size())
210
+ if (waitResult > WAIT_OBJECT_0 && waitResult < WAIT_OBJECT_0 + waitObjects.size())
211
{
212
return false;
213
}
src/windows/common/socket.cpp
+1
-1
@@ -177,7 +177,7 @@ int wsl::windows::common::socket::Send(
177
Offset += BytesWritten;
178
if (Offset < Buffer.size())
179
{
180
- WSL_LOG("PartialSocketWrite", TraceLoggingValue(Buffer.size(), "MessagSize"), TraceLoggingValue(Offset, "Offset"));
180
+ WSL_LOG("PartialSocketWrite", TraceLoggingValue(Buffer.size(), "MessageSize"), TraceLoggingValue(Offset, "Offset"));
181
}
182
}
183
src/windows/service/exe/BridgedNetworking.cpp
+1
-1
@@ -77,7 +77,7 @@ void BridgedNetworking::FillInitialConfiguration(LX_MINI_INIT_NETWORKING_CONFIGU
77
message.NetworkingMode = LxMiniInitNetworkingModeBridged;
78
message.DisableIpv6 = !m_config.EnableIpv6;
79
message.EnableDhcpClient = m_config.EnableDhcp;
80
- message.DhcpTimeout = static_cast<int>(std::round(m_config.DhcpTimeout / 1000));
80
+ message.DhcpTimeout = static_cast<int>(std::round(m_config.DhcpTimeout / 1000.0));
81
message.PortTrackerType = m_config.EnableLocalhostRelay ? LxMiniInitPortTrackerTypeRelay : LxMiniInitPortTrackerTypeNone;
82
}
83
src/windows/service/exe/DistributionRegistration.cpp
-1
@@ -96,7 +96,6 @@ DistributionRegistration DistributionRegistration::Create(
96
distribution.Write(Property::Version, Version);
97
distribution.Write(Property::BasePath, BasePath);
98
distribution.Write(Property::Flags, Flags);
99
- distribution.Write(Property::Flags, Flags);
99
distribution.Write(Property::DefaultUid, DefaultUID);
100
distribution.Write(Property::RunOOBE, EnableOobe);
101
src/windows/service/exe/LxssUserSession.cpp
+1
-1
@@ -891,7 +891,7 @@ HRESULT LxssUserSessionImpl::MountDisk(
891
_Out_ int* Step,
892
_Out_ LPWSTR* MountName)
893
{
894
- ExecutionContext context(Context::DetachDisk);
894
+ ExecutionContext context(Context::MountDisk);
895
896
std::lock_guard lock(m_instanceLock);
897
return wil::ResultFromException([&]() {
src/windows/service/exe/WslCoreVm.cpp
+1
@@ -1874,6 +1874,7 @@ void WslCoreVm::InitializeGuest()
1874
const auto errorString = wsl::windows::common::wslutil::GetSystemErrorString(result);
1875
EMIT_USER_WARNING(wsl::shared::Localization::MessageLocalhostRelayFailed(errorString));
1876
}
1877
+ break;
1878
}
1879
1880
default:
src/windows/wslrelay/localhost.cpp
+1
-1
@@ -33,7 +33,7 @@ struct in6_addr_linux
33
} u;
34
};
35
36
-const uint16_t ADDR6_MASK3 = ~in6_addr_linux(IN6ADDR_LOOPBACK_INIT).u.addr32[3];
36
+const uint32_t ADDR6_MASK3 = ~in6_addr_linux(IN6ADDR_LOOPBACK_INIT).u.addr32[3];
37
const uint32_t N_ADDR_LOOPBACK = ntohl(INADDR_LOOPBACK);
38
const uint32_t N_ADDR_ANY = ntohl(INADDR_ANY);
39