mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 01:10:08 +01:00
fix: choose very low route metric for loopback devices
It's local. It seems if the user adds a route to that destination, they would want it preferred over most other routes. Choose a small metric.
This commit is contained in:
parent
e48eef030f
commit
a10ac7fa5a
1 changed files with 4 additions and 2 deletions
|
|
@ -4934,6 +4934,10 @@ nm_device_get_route_metric_default(NMDeviceType device_type)
|
|||
*/
|
||||
|
||||
switch (device_type) {
|
||||
|
||||
case NM_DEVICE_TYPE_LOOPBACK:
|
||||
return 30;
|
||||
|
||||
/* 50 is also used for VPN plugins (NM_VPN_ROUTE_METRIC_DEFAULT).
|
||||
*
|
||||
* Note that returning 50 from this function means that this device-type is
|
||||
|
|
@ -4990,8 +4994,6 @@ nm_device_get_route_metric_default(NMDeviceType device_type)
|
|||
return 800;
|
||||
case NM_DEVICE_TYPE_WPAN:
|
||||
return 850;
|
||||
case NM_DEVICE_TYPE_LOOPBACK:
|
||||
return 875;
|
||||
case NM_DEVICE_TYPE_WIFI_P2P:
|
||||
case NM_DEVICE_TYPE_GENERIC:
|
||||
return 950;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue