diff options
author | Thomas Haller <thaller@redhat.com> | 2016-12-18 13:54:26 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-01-09 14:50:33 +0100 |
commit | f0d40525dfb079820e5dce48360ef6a9a540064a (patch) | |
tree | 7ea178d8bc328cce8f0f347b9a5e11508ff5d6b8 /libnm-core/nm-setting-wireless.c | |
parent | 21ae09c1cc2d1f7fa61f352ae5d5c43b0b02e384 (diff) | |
download | NetworkManager-f0d40525dfb079820e5dce48360ef6a9a540064a.tar.gz |
device: support dynamic "connection.stable-id" in form of text-substitution
Usecase: when connecting to a public Wi-Fi with MAC address randomization
("wifi.cloned-mac-address=random") you get on every re-connect a new
IP address due to the changing MAC address.
"wifi.cloned-mac-address=stable" is the solution for that. But that
means, every time when reconnecting to this network, the same ID will
be reused. We want an ID that is stable for a while, but at a later
point a new ID should e generated when revisiting the Wi-Fi network.
Extend the stable-id to become dynamic and support templates/substitutions.
Currently supported is "${CONNECTION}", "${BOOT}" and "${RANDOM}".
Any unrecognized pattern is treated verbaim/untranslated.
"$$" is treated special to allow escaping the '$' character. This allows
the user to still embed verbatim '$' characters with the guarantee that
future versions of NetworkManager will still generate the same ID.
Of course, a user could just avoid '$' in the stable-id unless using
it for dynamic substitutions.
Later we might want to add more recognized substitutions. For example, it
could be useful to generate new IDs based on the current time. The ${} syntax
is extendable to support arguments like "${PERIODIC:weekly}".
Also allow "connection.stable-id" to be set as global default value.
Previously that made no sense because the stable-id was static
and is anyway strongly tied to the identity of the connection profile.
Now, with dynamic stable-ids it gets much more useful to specify
a global default.
Note that pre-existing stable-ids don't change and still generate
the same addresses -- unless they contain one of the new ${} patterns.
Diffstat (limited to 'libnm-core/nm-setting-wireless.c')
-rw-r--r-- | libnm-core/nm-setting-wireless.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libnm-core/nm-setting-wireless.c b/libnm-core/nm-setting-wireless.c index d7a347f504..1d129f6634 100644 --- a/libnm-core/nm-setting-wireless.c +++ b/libnm-core/nm-setting-wireless.c @@ -1348,8 +1348,8 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_wireless_class) * "preserve" means not to touch the MAC address on activation. * "permanent" means to use the permanent hardware address of the device. * "random" creates a random MAC address on each connect. - * "stable" creates a hashed MAC address based on connection.stable-id (or - * the connection's UUID) and a machine dependent key. + * "stable" creates a hashed MAC address based on connection.stable-id and a + * machine dependent key. * * If unspecified, the value can be overwritten via global defaults, see manual * of NetworkManager.conf. If still unspecified, it defaults to "preserve" |