mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-18 20:00:36 +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 commit 637a45e25b)
This commit is contained in:
parent
229b9a979c
commit
21051dc6d8
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