<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/src/nm-initrd-generator, branch bg/proxy</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>clang-format: reformat code with clang-format 15.0.4-1.fc37</title>
<updated>2022-11-23T08:17:21+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-11-19T10:14:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=3fb8c0f614ab0cb3da649e6ca275abfa7ffc9a34'/>
<id>3fb8c0f614ab0cb3da649e6ca275abfa7ffc9a34</id>
<content type='text'>
This is the version shipped in Fedora 37. As Fedora 37 is now out, the
core developers switch to it. Our gitlab-ci will also use that as base
image for the check-{patch.tree} tests and to generate the pages. There
is a need that everybody agrees on which clang-format version to use,
and that version should be the one of the currently used Fedora release.

Also update the used Fedora image in "contrib/scripts/nm-code-format-container.sh"
script.

The gitlab-ci still needs update in the following commit. The change
in isolation will break the "check-tree" test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the version shipped in Fedora 37. As Fedora 37 is now out, the
core developers switch to it. Our gitlab-ci will also use that as base
image for the check-{patch.tree} tests and to generate the pages. There
is a need that everybody agrees on which clang-format version to use,
and that version should be the one of the currently used Fedora release.

Also update the used Fedora image in "contrib/scripts/nm-code-format-container.sh"
script.

The gitlab-ci still needs update in the following commit. The change
in isolation will break the "check-tree" test.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: add tests for generating stable UUIDs for keyfile/initrd</title>
<updated>2022-11-03T08:23:57+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-11-02T21:02:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=dc26e65928740bd20ab01aee422ee9401e0fe11c'/>
<id>dc26e65928740bd20ab01aee422ee9401e0fe11c</id>
<content type='text'>
Fixes: 7ee0da3eaffd ('build: don't "update-po" during make dist')
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes: 7ee0da3eaffd ('build: don't "update-po" during make dist')
</pre>
</div>
</content>
</entry>
<entry>
<title>initrd/tests: add unit test for autoconnect-priority setting</title>
<updated>2022-11-02T12:43:06+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-11-02T12:40:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=28ab5356177a8413561619ad48952795befc642c'/>
<id>28ab5356177a8413561619ad48952795befc642c</id>
<content type='text'>
Fixes: 98575bd5138a ('initrd: generate initrd generator profiles with autoconnect-priority -100')
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes: 98575bd5138a ('initrd: generate initrd generator profiles with autoconnect-priority -100')
</pre>
</div>
</content>
</entry>
<entry>
<title>glib-aux: add and use nm_uuid_generate_from_strings_old()</title>
<updated>2022-10-11T07:03:17+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-10-07T13:16:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=b5e7e48bc185cb4e544efa8be9144e2bda63081c'/>
<id>b5e7e48bc185cb4e544efa8be9144e2bda63081c</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>all: drop nm_uuid_generate_from_strings_v3()</title>
<updated>2022-10-03T15:57:53+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-09-28T10:37:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=e9a33bbbf87d4f01b883949bf5e2434117b0ca73'/>
<id>e9a33bbbf87d4f01b883949bf5e2434117b0ca73</id>
<content type='text'>
For new uses of nm_uuid_generate_from_strings() we should generate version5
UUIDs and we should use unique namespace UUID arguments.

The namespace UUID was so far replaced by always passing a special prefix
as first string. It seems nicer to use a namespace instead.

Version3 UUIDs should not be used for new applications.

Hence, nm_uuid_generate_from_strings_v3() is no longer a desirable way to
generate UUIDs, so drop the wrapper.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For new uses of nm_uuid_generate_from_strings() we should generate version5
UUIDs and we should use unique namespace UUID arguments.

The namespace UUID was so far replaced by always passing a special prefix
as first string. It seems nicer to use a namespace instead.

Version3 UUIDs should not be used for new applications.

Hence, nm_uuid_generate_from_strings_v3() is no longer a desirable way to
generate UUIDs, so drop the wrapper.
</pre>
</div>
</content>
</entry>
<entry>
<title>glib-aux: rename nm_uuid_generate_from_strings() to nm_uuid_generate_from_strings_v3()</title>
<updated>2022-10-03T15:57:43+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-09-28T08:40:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=2fcea1cf05af28dc76c015f2fef01d58dee9d2ba'/>
<id>2fcea1cf05af28dc76c015f2fef01d58dee9d2ba</id>
<content type='text'>
nm_uuid_generate_from_strings() uses variant3 UUIDs based on MD5.
We shouldn't use that in the future.

We will add a replacement, so rename this function so that the "good"
name is free again. Of course, code that uses this function currently
relies on that the behavior doesn't change. We cannot just drop it
entirely, but will replace it by something that gives the same result.

Rename.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
nm_uuid_generate_from_strings() uses variant3 UUIDs based on MD5.
We shouldn't use that in the future.

We will add a replacement, so rename this function so that the "good"
name is free again. Of course, code that uses this function currently
relies on that the behavior doesn't change. We cannot just drop it
entirely, but will replace it by something that gives the same result.

Rename.
</pre>
</div>
</content>
</entry>
<entry>
<title>initrd: generate initrd generator profiles with autoconnect-priority -100</title>
<updated>2022-09-15T16:23:57+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-09-12T09:33:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=98575bd5138afdb61a3837a2a73436eb05490f4a'/>
<id>98575bd5138afdb61a3837a2a73436eb05490f4a</id>
<content type='text'>
... and profiles from firmware with autoconnect-priority -200.

In general, after switch root we remember the still activated profile in
/run, and NetworkManager would take over the device with the same
profile as before. In that case, autoconnect and autoconnect-priority
doesn't matter.

Autoconnect only matters when having a device in disconnected state and
not being blocked from autoconnect. For example, if you unplug and
replug the cable. In that case, it does make sense to me that
user-provided profiles from real-root are preferred.

To me the reasons for this change is not very strong (but neither are
the reasons against it). Read the discussion on rhbz #2089707.

https://bugzilla.redhat.com/show_bug.cgi?id=2089707

Co-authored-by: Lubomir Rintel &lt;lkundrak@v3.sk&gt;

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1376
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... and profiles from firmware with autoconnect-priority -200.

In general, after switch root we remember the still activated profile in
/run, and NetworkManager would take over the device with the same
profile as before. In that case, autoconnect and autoconnect-priority
doesn't matter.

Autoconnect only matters when having a device in disconnected state and
not being blocked from autoconnect. For example, if you unplug and
replug the cable. In that case, it does make sense to me that
user-provided profiles from real-root are preferred.

To me the reasons for this change is not very strong (but neither are
the reasons against it). Read the discussion on rhbz #2089707.

https://bugzilla.redhat.com/show_bug.cgi?id=2089707

Co-authored-by: Lubomir Rintel &lt;lkundrak@v3.sk&gt;

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1376
</pre>
</div>
</content>
</entry>
<entry>
<title>all: use nm_g_array_{index,first,last,index_p}() instead of g_array_index()</title>
<updated>2022-09-15T10:39:07+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-09-08T10:05:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=ffd8baa49fd5310501cacabb939445b0aef900cf'/>
<id>ffd8baa49fd5310501cacabb939445b0aef900cf</id>
<content type='text'>
These variants provide additional nm_assert() checks, and are thus
preferable.

Note that we cannot just blindly replace &amp;g_array_index() with
&amp;nm_g_array_index(), because the latter would not allow getting a
pointer at index [arr-&gt;len]. That might be a valid (though uncommon)
usecase. The correct replacement of &amp;g_array_index() is thus
nm_g_array_index_p().

I checked the code manually and replaced uses of nm_g_array_index_p()
with &amp;nm_g_array_index(), if that was a safe thing to do. The latter
seems preferable, because it is familar to &amp;g_array_index().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These variants provide additional nm_assert() checks, and are thus
preferable.

Note that we cannot just blindly replace &amp;g_array_index() with
&amp;nm_g_array_index(), because the latter would not allow getting a
pointer at index [arr-&gt;len]. That might be a valid (though uncommon)
usecase. The correct replacement of &amp;g_array_index() is thus
nm_g_array_index_p().

I checked the code manually and replaced uses of nm_g_array_index_p()
with &amp;nm_g_array_index(), if that was a safe thing to do. The latter
seems preferable, because it is familar to &amp;g_array_index().
</pre>
</div>
</content>
</entry>
<entry>
<title>initrd: avoid duplicate file check and NULL pointer dereference in nmi_ibft_read()</title>
<updated>2022-08-31T07:42:23+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-08-31T07:33:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=4c48864972378c0b97b15914ee7039bbce8e7274'/>
<id>4c48864972378c0b97b15914ee7039bbce8e7274</id>
<content type='text'>
- move the second g_file_test() inside the if-block. No need to check
  twice, if the file exists.

- load_one_nic() can return NULL. Use nm_g_hash_table_lookup() to avoid
  NULL pointer assertion.

- use cleanup attribute for "nic" variable, and explicitly pass
  ownership on with g_steal_pointer().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- move the second g_file_test() inside the if-block. No need to check
  twice, if the file exists.

- load_one_nic() can return NULL. Use nm_g_hash_table_lookup() to avoid
  NULL pointer assertion.

- use cleanup attribute for "nic" variable, and explicitly pass
  ownership on with g_steal_pointer().
</pre>
</div>
</content>
</entry>
<entry>
<title>glib-aux: rename IP address related helpers from "nm-inet-utils.h"</title>
<updated>2022-08-25T17:05:51+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-08-19T11:15:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=08eff4c46ee618fcf00ddde28a425d10ba0df041'/>
<id>08eff4c46ee618fcf00ddde28a425d10ba0df041</id>
<content type='text'>
- name things related to `in_addr_t`, `struct in6_addr`, `NMIPAddr` as
  `nm_ip4_addr_*()`, `nm_ip6_addr_*()`, `nm_ip_addr_*()`, respectively.

- we have a wrapper `nm_inet_ntop()` for `inet_ntop()`. This name
  of our wrapper is chosen to be familiar with the libc underlying
  function. With this, also name functions that are about string
  representations of addresses `nm_inet_*()`, `nm_inet4_*()`,
  `nm_inet6_*()`. For example, `nm_inet_parse_str()`,
  `nm_inet_is_normalized()`.

&lt;&lt;&lt;&lt;

  R() {
     git grep -l "$1" | xargs sed -i "s/\&lt;$1\&gt;/$2/g"
  }

  R NM_CMP_DIRECT_IN4ADDR_SAME_PREFIX          NM_CMP_DIRECT_IP4_ADDR_SAME_PREFIX
  R NM_CMP_DIRECT_IN6ADDR_SAME_PREFIX          NM_CMP_DIRECT_IP6_ADDR_SAME_PREFIX
  R NM_UTILS_INET_ADDRSTRLEN                   NM_INET_ADDRSTRLEN
  R _nm_utils_inet4_ntop                       nm_inet4_ntop
  R _nm_utils_inet6_ntop                       nm_inet6_ntop
  R _nm_utils_ip4_get_default_prefix           nm_ip4_addr_get_default_prefix
  R _nm_utils_ip4_get_default_prefix0          nm_ip4_addr_get_default_prefix0
  R _nm_utils_ip4_netmask_to_prefix            nm_ip4_addr_netmask_to_prefix
  R _nm_utils_ip4_prefix_to_netmask            nm_ip4_addr_netmask_from_prefix
  R nm_utils_inet4_ntop_dup                    nm_inet4_ntop_dup
  R nm_utils_inet6_ntop_dup                    nm_inet6_ntop_dup
  R nm_utils_inet_ntop                         nm_inet_ntop
  R nm_utils_inet_ntop_dup                     nm_inet_ntop_dup
  R nm_utils_ip4_address_clear_host_address    nm_ip4_addr_clear_host_address
  R nm_utils_ip4_address_is_link_local         nm_ip4_addr_is_link_local
  R nm_utils_ip4_address_is_loopback           nm_ip4_addr_is_loopback
  R nm_utils_ip4_address_is_zeronet            nm_ip4_addr_is_zeronet
  R nm_utils_ip4_address_same_prefix           nm_ip4_addr_same_prefix
  R nm_utils_ip4_address_same_prefix_cmp       nm_ip4_addr_same_prefix_cmp
  R nm_utils_ip6_address_clear_host_address    nm_ip6_addr_clear_host_address
  R nm_utils_ip6_address_same_prefix           nm_ip6_addr_same_prefix
  R nm_utils_ip6_address_same_prefix_cmp       nm_ip6_addr_same_prefix_cmp
  R nm_utils_ip6_is_ula                        nm_ip6_addr_is_ula
  R nm_utils_ip_address_same_prefix            nm_ip_addr_same_prefix
  R nm_utils_ip_address_same_prefix_cmp        nm_ip_addr_same_prefix_cmp
  R nm_utils_ip_is_site_local                  nm_ip_addr_is_site_local
  R nm_utils_ipaddr_is_normalized              nm_inet_is_normalized
  R nm_utils_ipaddr_is_valid                   nm_inet_is_valid
  R nm_utils_ipx_address_clear_host_address    nm_ip_addr_clear_host_address
  R nm_utils_parse_inaddr                      nm_inet_parse_str
  R nm_utils_parse_inaddr_bin                  nm_inet_parse_bin
  R nm_utils_parse_inaddr_bin_full             nm_inet_parse_bin_full
  R nm_utils_parse_inaddr_prefix               nm_inet_parse_with_prefix_str
  R nm_utils_parse_inaddr_prefix_bin           nm_inet_parse_with_prefix_bin
  R test_nm_utils_ip6_address_same_prefix      test_nm_ip_addr_same_prefix

  ./contrib/scripts/nm-code-format.sh -F
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- name things related to `in_addr_t`, `struct in6_addr`, `NMIPAddr` as
  `nm_ip4_addr_*()`, `nm_ip6_addr_*()`, `nm_ip_addr_*()`, respectively.

- we have a wrapper `nm_inet_ntop()` for `inet_ntop()`. This name
  of our wrapper is chosen to be familiar with the libc underlying
  function. With this, also name functions that are about string
  representations of addresses `nm_inet_*()`, `nm_inet4_*()`,
  `nm_inet6_*()`. For example, `nm_inet_parse_str()`,
  `nm_inet_is_normalized()`.

&lt;&lt;&lt;&lt;

  R() {
     git grep -l "$1" | xargs sed -i "s/\&lt;$1\&gt;/$2/g"
  }

  R NM_CMP_DIRECT_IN4ADDR_SAME_PREFIX          NM_CMP_DIRECT_IP4_ADDR_SAME_PREFIX
  R NM_CMP_DIRECT_IN6ADDR_SAME_PREFIX          NM_CMP_DIRECT_IP6_ADDR_SAME_PREFIX
  R NM_UTILS_INET_ADDRSTRLEN                   NM_INET_ADDRSTRLEN
  R _nm_utils_inet4_ntop                       nm_inet4_ntop
  R _nm_utils_inet6_ntop                       nm_inet6_ntop
  R _nm_utils_ip4_get_default_prefix           nm_ip4_addr_get_default_prefix
  R _nm_utils_ip4_get_default_prefix0          nm_ip4_addr_get_default_prefix0
  R _nm_utils_ip4_netmask_to_prefix            nm_ip4_addr_netmask_to_prefix
  R _nm_utils_ip4_prefix_to_netmask            nm_ip4_addr_netmask_from_prefix
  R nm_utils_inet4_ntop_dup                    nm_inet4_ntop_dup
  R nm_utils_inet6_ntop_dup                    nm_inet6_ntop_dup
  R nm_utils_inet_ntop                         nm_inet_ntop
  R nm_utils_inet_ntop_dup                     nm_inet_ntop_dup
  R nm_utils_ip4_address_clear_host_address    nm_ip4_addr_clear_host_address
  R nm_utils_ip4_address_is_link_local         nm_ip4_addr_is_link_local
  R nm_utils_ip4_address_is_loopback           nm_ip4_addr_is_loopback
  R nm_utils_ip4_address_is_zeronet            nm_ip4_addr_is_zeronet
  R nm_utils_ip4_address_same_prefix           nm_ip4_addr_same_prefix
  R nm_utils_ip4_address_same_prefix_cmp       nm_ip4_addr_same_prefix_cmp
  R nm_utils_ip6_address_clear_host_address    nm_ip6_addr_clear_host_address
  R nm_utils_ip6_address_same_prefix           nm_ip6_addr_same_prefix
  R nm_utils_ip6_address_same_prefix_cmp       nm_ip6_addr_same_prefix_cmp
  R nm_utils_ip6_is_ula                        nm_ip6_addr_is_ula
  R nm_utils_ip_address_same_prefix            nm_ip_addr_same_prefix
  R nm_utils_ip_address_same_prefix_cmp        nm_ip_addr_same_prefix_cmp
  R nm_utils_ip_is_site_local                  nm_ip_addr_is_site_local
  R nm_utils_ipaddr_is_normalized              nm_inet_is_normalized
  R nm_utils_ipaddr_is_valid                   nm_inet_is_valid
  R nm_utils_ipx_address_clear_host_address    nm_ip_addr_clear_host_address
  R nm_utils_parse_inaddr                      nm_inet_parse_str
  R nm_utils_parse_inaddr_bin                  nm_inet_parse_bin
  R nm_utils_parse_inaddr_bin_full             nm_inet_parse_bin_full
  R nm_utils_parse_inaddr_prefix               nm_inet_parse_with_prefix_str
  R nm_utils_parse_inaddr_prefix_bin           nm_inet_parse_with_prefix_bin
  R test_nm_utils_ip6_address_same_prefix      test_nm_ip_addr_same_prefix

  ./contrib/scripts/nm-code-format.sh -F
</pre>
</div>
</content>
</entry>
</feed>
