NetworkManager/src/core/settings
Thomas Haller b5e7e48bc1
glib-aux: add and use nm_uuid_generate_from_strings_old()
For a long time we have a function like nm_uuid_generate_from_strings().
This was recently reworked and renamed, but it preserved behavior. Preserving
behavior is important for this function, because for the existing users,
we need to keep generating the same UUIDs.

Originally, this function was a variadic function with NULL sentinel.
That means, when you write

  nm_uuid_generate_from_strings(uuid_type, type_arg, v1, v2, v3, NULL);

and v2 happens to be NULL, then v3 is ignored. That is most likely not
what the user intended. Maybe they had a bug and v2 should not be NULL.
But nm_uuid_generate_from_strings() should not require that all
arguments are non-NULL and it should not ignore arguments after the
first NULL.

For example, one user works around this via

    uuid = nm_uuid_generate_from_strings_old("ibft",
                                             s_hwaddr,
                                             s_vlanid ? "V" : "v",
                                             s_vlanid ? s_vlanid : "",
                                             s_ipaddr ? "A" : "DHCP",
                                             s_ipaddr ? s_ipaddr : "");

which is cumbersome and ugly.

That will be fixed next, by adding a function that doesn't suffer
from this problem. But "this problem" is part of the API of the
function, we cannot just change it. Instead, rename it and all
users, so they can keep doing the same.

New users of course should no longer use the "old" function.
2022-10-11 09:03:17 +02:00
..
plugins glib-aux: add and use nm_uuid_generate_from_strings_old() 2022-10-11 09:03:17 +02:00
nm-agent-manager.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-agent-manager.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-secret-agent.c core: use NM_SHUTDOWN_TIMEOUT_1500_MSEC 2022-02-24 09:38:53 +01:00
nm-secret-agent.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-connection.c settings-connection: add a "plugin" argument to Update2() 2022-03-28 13:29:28 +02:00
nm-settings-connection.h settings-connection: add a "plugin" argument to Update2() 2022-03-28 13:29:28 +02:00
nm-settings-plugin.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-plugin.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-storage.c all: use nm_uuid_is_normalized() for checking valid UUID for "connection.uuid" 2021-06-04 09:29:23 +02:00
nm-settings-storage.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-utils.c format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
nm-settings-utils.h all: move "src/" directory to "src/core/" 2021-02-08 09:56:41 +01:00
nm-settings.c core/hostname: avoid blocking calls in NMHostnameManager setting static hostname 2022-05-30 16:56:38 +02:00
nm-settings.h settings-connection: add a "plugin" argument to Update2() 2022-03-28 13:29:28 +02:00