diff options
| author | David Lönnhager <david.l@mullvad.net> | 2020-02-06 13:20:00 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2020-02-07 13:01:26 +0100 |
| commit | 533b498658bad6ecb38b9a0e16e8fb3dd25975e5 (patch) | |
| tree | 93b7cb16bacbe72712bb3b99c0077aa73892e359 /windows | |
| parent | 73a23be260be6904959713ce4d73c81d8c8923c6 (diff) | |
| download | mullvadvpn-533b498658bad6ecb38b9a0e16e8fb3dd25975e5.tar.xz mullvadvpn-533b498658bad6ecb38b9a0e16e8fb3dd25975e5.zip | |
Remove unused metric function
Diffstat (limited to 'windows')
| -rw-r--r-- | windows/winnet/src/winnet/NetworkInterfaces.cpp | 33 | ||||
| -rw-r--r-- | windows/winnet/src/winnet/NetworkInterfaces.h | 1 |
2 files changed, 0 insertions, 34 deletions
diff --git a/windows/winnet/src/winnet/NetworkInterfaces.cpp b/windows/winnet/src/winnet/NetworkInterfaces.cpp index ae5240f17f..e7f75fdda1 100644 --- a/windows/winnet/src/winnet/NetworkInterfaces.cpp +++ b/windows/winnet/src/winnet/NetworkInterfaces.cpp @@ -20,39 +20,6 @@ bool NetworkInterfaces::HasHighestMetric(PMIB_IPINTERFACE_ROW targetIface) return true; } -void NetworkInterfaces::EnsureIfaceMetricIsHighest(NET_LUID interfaceLuid) -{ - for (ULONG i = 0; i < mInterfaces->NumEntries; ++i) - { - PMIB_IPINTERFACE_ROW iface = &mInterfaces->Table[i]; - - // Ignoring the target interface. - if (iface->InterfaceLuid.Value == interfaceLuid.Value || iface->UseAutomaticMetric || iface->Metric > MAX_METRIC) - { - continue; - } - - iface->Metric++; - - if (AF_INET == iface->Family) - { - iface->SitePrefixLength = 0; - } - - const auto status = SetIpInterfaceEntry(iface); - - if (NO_ERROR != status) - { - std::stringstream ss; - - ss << "Failed to increment metric for interface with LUID 0x" - << std::hex << iface->InterfaceLuid.Value; - - THROW_WINDOWS_ERROR(status, ss.str().c_str()); - } - } -} - NetworkInterfaces::NetworkInterfaces() { mInterfaces = nullptr; diff --git a/windows/winnet/src/winnet/NetworkInterfaces.h b/windows/winnet/src/winnet/NetworkInterfaces.h index 1317e47b4e..515bbe09e6 100644 --- a/windows/winnet/src/winnet/NetworkInterfaces.h +++ b/windows/winnet/src/winnet/NetworkInterfaces.h @@ -19,7 +19,6 @@ public: NetworkInterfaces(const NetworkInterfaces &) = delete; NetworkInterfaces &operator=(const NetworkInterfaces &) = delete; - void EnsureIfaceMetricIsHighest(NET_LUID interfaceLuid); NetworkInterfaces(); bool SetTopMetricForInterfacesByAlias(const wchar_t *deviceAlias); bool SetTopMetricForInterfacesWithLuid(NET_LUID targetIface); |
