mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-02 19:00:29 +01:00
policy: prefer IPv4 to determine the hostname
When determining the hostname, it is preferable to evaluate devices in a predictable order to avoid that the hostname changes between different boots. The current order is based first on hostname priority, then on the presence of a best default route, and then on activation order. The activation order is not a very strong condition, as it is basically useless for devices that are autoactivated at boot. As we already prefer IPv4 over IPv6 within the same connection, also prefer it when 2 connections have the same priority and the same default route status, to achieve better predictability. https://bugzilla.redhat.com/show_bug.cgi?id=1970335 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/895 (cherry picked from commit637a45e25b) (cherry picked from commit21051dc6d8)
This commit is contained in:
parent
85b8b07e27
commit
b793925889
1 changed files with 1 additions and 0 deletions
|
|
@ -652,6 +652,7 @@ device_hostname_info_compare(gconstpointer a, gconstpointer b)
|
|||
|
||||
NM_CMP_FIELD(info1, info2, priority);
|
||||
NM_CMP_FIELD_UNSAFE(info2, info1, is_default);
|
||||
NM_CMP_FIELD_UNSAFE(info2, info1, IS_IPv4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue