Commit graph

29313 commits

Author SHA1 Message Date
Thomas Haller
a3ca768fbc
std-aux: minor cleanup in nm_steal_int() to compare number explicitly against zero 2021-10-06 17:55:11 +02:00
Thomas Haller
6b3862e39a
NEWS: update 2021-10-06 11:26:32 +02:00
Thomas Haller
a44e5c3918
NEWS: add entries that were backported to 1.32 minor releases 2021-10-06 11:04:22 +02:00
Thomas Haller
7f25335767
NEWS: reorder entries from stable releases
Have the newest 1.32 stable release listed first. Then we can look at
the diff between the versions of the NEWS file and see whether they
agree.
2021-10-06 10:56:24 +02:00
Thomas Haller
fefaab7d50
CONTRIBUTING: update style 2021-10-06 09:23:46 +02:00
Fernando Fernandez Mancera
ec8df200f6 libnm: add NMIPAddress and NMIPRoute dups backported symbols from 1.30.8
The nm_ip_address_dup() and nm_ip_route_dup() symbols were exposed in
libnm 1.32 and then backported to 1.30.8.

Export it also with version @libnm_1_30_8; this allows a program build
against libnm 1.30.8 to keep working with later versions of the library.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2021-10-05 14:09:15 +02:00
Thomas Haller
0ee3100ba1
l3cfg: fix nm_l3_config_data_new_clone() for different ifindex 2021-10-04 15:40:15 +02:00
Thomas Haller
d8ac65cfa0
platform: add nmp_object_cmp_full() to ignore ifindex for comparison 2021-10-04 15:40:15 +02:00
Thomas Haller
82260cc5c2
contrib: add "contrib/scripts/test-ppp.sh" test script 2021-10-04 15:40:15 +02:00
Thomas Haller
1b488fe34c
contrib: make it easy to test PPPoE in container script
It doesn't actually work inside the root-less container...
Well, it works as far as starting to activate, before it
fails. That is still somewhat useful. So have it there...
2021-10-04 15:40:15 +02:00
Thomas Haller
7bb1d9b1f4
src/c-list: reimport
git subtree pull --prefix src/c-list git@github.com:c-util/c-list.git main --squash
2021-10-01 16:18:06 +02:00
Thomas Haller
7521ea44a3 Squashed 'src/c-list/' changes from 96455db9f04a..a0970f12f1f4
a0970f12f1f4 c-list: avoid comma-operator in conditionals
2ea502c5ee83 c-list: return self from c_list_init()
ca473417f7b3 build: use c99 instead of c11
99d8daf152fa ci: run on windows-2016
857a37cfc960 test/embed: split off GNU-extensions
c09e29697912 ci: run through MSVC
c3ba3dc82466 build: run test_embed only with gcc/clang
77c872dcc67d test/api: split of GNU tests
3ab849ea658e test/basic: test_extensions() -> test_gnu()
04fda9508c86 c-list: reorder iterators
58ab8fb29472 test: add c_list_entry_offset() to API tests
6d2fdc76de70 build: update AUTHORS
92b893fb3c4b c-list: remove trailing '\\' from macro definitions
c255c6a97a04 c-list: use size_t
b47da33dedf1 c-list: use uintptr_t for pointer arithmetic in c_list_entry()
9b798f50bbd0 c-list: require CList pointer for argument to c_list_entry() macro
42bbf43ab0af test: guard gcc'ism
942fcfd80862 c-list: make _c_list_entry_eval() part of the API
73a620259ca0 c-list: don't use elvis operator for c_list_entry() macro
da5e122bd698 test: drop unused argc/argv
f1eadf27377e test: verify c_list_entry() does not double-evaluate

git-subtree-dir: src/c-list
git-subtree-split: a0970f12f1f406a5578a5dedf3580cd682e55812
2021-10-01 16:17:09 +02:00
Thomas Haller
d1049035ab
c-list: re-import git-subtree for 'src/c-list'
The subtree was moved from "shared/c-list" to "src/c-list". That confuses
git-subtree. To fix it, reimport the code with

  rm -rf src/c-list
  git commit -a -m 'dummy commit'
  git subtree add --prefix src/c-list git@github.com:c-util/c-list.git 96455db9f04a6c9101a00957161551aea700b6aa --squash

Then rebase the result to drop the bogus dummy commit from the history.

To update the library use:

  git subtree pull --prefix src/c-list git@github.com:c-util/c-list.git main --squash
2021-10-01 16:16:38 +02:00
Thomas Haller
59d9106df3 Squashed 'src/c-list/' content from commit 96455db9f04a
git-subtree-dir: src/c-list
git-subtree-split: 96455db9f04a6c9101a00957161551aea700b6aa
2021-10-01 16:15:48 +02:00
Thomas Haller
b58d2bb2bc
c-rbtree: re-import git-subtree for 'src/c-rbtree'
The subtree was moved from "shared/c-rbtree" to "src/c-rbtree". That confuses
git-subtree. To fix it, reimport the code with

  rm -rf src/c-rbtree
  git commit -a -m 'dummy commit'
  git subtree add --prefix src/c-rbtree git@github.com:c-util/c-rbtree.git 8aa7bd1828eedb19960f9eef98d15543ec9f34eb --squash

Then rebase the result to drop the bogus dummy commit from the history.

To update the library use:

  git subtree pull --prefix src/c-rbtree git@github.com:c-util/c-rbtree.git main --squash
2021-10-01 16:12:15 +02:00
Thomas Haller
1b61323231 Squashed 'src/c-rbtree/' content from commit 8aa7bd1828ee
git-subtree-dir: src/c-rbtree
git-subtree-split: 8aa7bd1828eedb19960f9eef98d15543ec9f34eb
2021-10-01 16:10:39 +02:00
Thomas Haller
5afcf33b70
c-siphash: re-import git-subtree for 'src/c-siphash'
The subtree was moved from "shared/c-siphash" to "src/c-siphash". That confuses
git-subtree. To fix it, reimport the code with

  rm -rf src/c-siphash
  git commit -a -m 'dummy commit'
  git subtree add --prefix src/c-siphash git@github.com:c-util/c-siphash.git eb87a9c4a5b0441ede073597253e1d0b7785e6be --squash

Then rebase the result to drop the bogus dummy commit from the history.

To update the library use:

  git subtree pull --prefix src/c-siphash git@github.com:c-util/c-siphash.git main --squash
2021-10-01 16:07:26 +02:00
Thomas Haller
12bb8b9b71 Squashed 'src/c-siphash/' content from commit eb87a9c4a5b0
git-subtree-dir: src/c-siphash
git-subtree-split: eb87a9c4a5b0441ede073597253e1d0b7785e6be
2021-10-01 16:01:48 +02:00
Thomas Haller
d4ee5acffc
src/c-stdaux: reimport
git subtree pull --prefix src/c-stdaux git@github.com:c-util/c-stdaux.git main --squash
2021-10-01 15:57:23 +02:00
Thomas Haller
49a6a3da1d Squashed 'src/c-stdaux/' changes from 346623b40eb8..8652c488b8f1
8652c488b8f1 test: provide prototypes
c5f166d02ff6 test: remove unnecessary unused attribute from main argc
8572cd4d1225 test: remove unused args from main
5c4f161f9c11 test: add missing _c_unused_

git-subtree-dir: src/c-stdaux
git-subtree-split: 8652c488b8f1c29629a5179d4551d0a691ae5901
2021-10-01 15:56:42 +02:00
Thomas Haller
613a6c7db1
c-stdaux: re-import git-subtree for 'src/c-stdaux'
The subtree was moved from "shared/c-stdaux" to "src/c-stdaux". That confuses
git-subtree. To fix it, reimport the code with

  rm -rf src/c-stdaux
  git commit -a -m 'dummy commit'
  git subtree add --prefix src/c-stdaux git@github.com:c-util/c-stdaux.git 346623b40eb8137cae7568a69ee42253ff098ff7 --squash

Then rebase the result to drop the bogus dummy commit from the history.

To update the library use:

  git subtree pull --prefix src/c-stdaux git@github.com:c-util/c-stdaux.git main --squash
2021-10-01 15:56:32 +02:00
Thomas Haller
80ee976ec0 Squashed 'src/c-stdaux/' content from commit 346623b40eb8
git-subtree-dir: src/c-stdaux
git-subtree-split: 346623b40eb8137cae7568a69ee42253ff098ff7
2021-10-01 15:51:56 +02:00
Thomas Haller
e0c58598e1
n-dhcp4: re-import git-subtree for 'src/n-dhcp4'
The subtree was moved from "shared/n-dhcp4" to "src/n-dhcp4". That confuses
git-subtree. To fix it, reimport the code with

  rm -rf src/n-dhcp4
  git commit -a -m 'dummy commit'
  git subtree add --prefix src/n-dhcp4 git@github.com:nettools/n-dhcp4.git 281f431756e32b6a978a92e6c1a95478917a6720 --squash

Then rebase the result to drop the bogus dummy commit from the history.

To update the library use:

  git subtree pull --prefix src/n-dhcp4 git@github.com:nettools/n-dhcp4.git master --squash
2021-10-01 15:47:12 +02:00
Thomas Haller
b6bd5bb7c5 Squashed 'src/n-dhcp4/' content from commit 281f431756e3
git-subtree-dir: src/n-dhcp4
git-subtree-split: 281f431756e32b6a978a92e6c1a95478917a6720
2021-10-01 15:43:42 +02:00
Thomas Haller
2259824316
n-acd: re-import git-subtree for 'src/n-acd'
The subtree was moved from "shared/n-acd" to "src/n-acd". That confuses
git-subtree. To fix it, reimport the code with

  rm -rf src/n-acd
  git commit -a -m 'dummy commit'
  git subtree add --prefix src/n-acd git@github.com:nettools/n-acd.git a600afc870872bbdfc8081ca68d5665334cb9e6e --squash

Then rebase the result to drop the bogus dummy commit from the history.

To update the library use:

  git subtree pull --prefix src/n-acd git@github.com:nettools/n-acd.git master --squash
2021-10-01 15:39:56 +02:00
Thomas Haller
9412d8fa46 Squashed 'src/n-acd/' content from commit a600afc87087
git-subtree-dir: src/n-acd
git-subtree-split: a600afc870872bbdfc8081ca68d5665334cb9e6e
2021-10-01 15:27:52 +02:00
Thomas Haller
25ec8f4451
l3cfg: fix assertion failure in _obj_state_zombie_lst_get_prune_lists()
"nm_assert(_self->priv.p->combined_l3cd_commited)" might fail during deactivate.
At that point the combined/commited config is NULL, but we still have zombies.
2021-09-30 15:10:19 +02:00
Beniamino Galvani
fcfaf78c91
l3cfg: fix dns options in _init_from_connection_ip() 2021-09-30 15:10:18 +02:00
Thomas Haller
5efd3134e4
l3cfg: accept NULL NML3ConfigData for several getters
We often want to be pedantic about not accepting %NULL for getters (or ref,
unref, etc). Often that is also inconvenient, so we would need to write:

  if (l3cd)
      strv = nm_l3_config_data_get_nameservers(l3cd, addr_family, &len);
  else
      len = 0;

(and, make sure that strv does not trigger a maybe-uninitialized warning).

Being pedanic here is more cumbersome than helpful. Accept NULL to return
the sensible default.

Also add nm_l3_config_data_get_dns_priority_or_default() helper which maps
NULL or a missing value to zero. This is also only for convenience for certain
callers.
2021-09-30 15:10:18 +02:00
Thomas Haller
e60843e245
glib-aux: add nm_memcmp_n()/nm_memeq_n() helpers 2021-09-30 15:10:18 +02:00
Thomas Haller
8ad4f7b70f
glib-aux: add nm_strv_equal_n_null() helper (and related)
The plain nm_strv_equal(), nm_strv_equal_n(), nm_strv_cmp_n() functions
treat NULL strv arrays (without specified length) different than strv
arrays of length zero. They do so, because that is useful sometimes.

Sometimes it is not useful and we want to treat empty arrays the same
as a NULL array. Add helpers for that.
2021-09-30 15:10:18 +02:00
Thomas Haller
c32ddc30c0
glib-aux: add nm_g_variant_singleton_{i_0,as,aay,au}() helpers 2021-09-30 15:10:17 +02:00
Thomas Haller
6837095aab
n-acd: fix handling of N_ACD_E_DROPPED
N_ACD_E_DROPPED is an error code of n-acd, albeit internal. But such codes are returned
as postive values, unlike error codes from errno.h (which are negative).

Fix comparing for N_ACD_E_DROPPED, otherwise the error gets propagate to the caller
when we should handle it internally.
2021-09-30 15:10:17 +02:00
Vojtech Bubela
e989cbbd99
nmcli: show default instead of null adress
invoking nmcli command without arguments will now show "default"
instead of null adress in route4 or route6 section.
2021-09-29 10:29:31 +02:00
Thomas Haller
17fd1e4708
l3cfg/trivial: explain commit-type in code comments 2021-09-29 09:26:43 +02:00
Beniamino Galvani
8a06d66d0e
l3cfg: fix nm_l3cfg_commit_type_register() to set commit_type and add debug logging
Co-authored-by: Thomas Haller <thaller@redhat.com>
2021-09-28 22:18:13 +02:00
Thomas Haller
f3def63fed
std-aux: add nm_clear_fd() helper 2021-09-28 15:58:29 +02:00
Thomas Haller
81ed762d46
glib-aux/trivial: update code comment for nm_g_idle_add() 2021-09-28 15:58:28 +02:00
Thomas Haller
78c716cfaf
l3cfg: track "never-default" in NML3Cfg 2021-09-28 13:20:28 +02:00
Thomas Haller
01a09d1194
libnm: minor cleanup of NM_TERNARY_FROM_OPTION_BOOL()/NM_TERNARY_TO_OPTION_BOOL() 2021-09-28 13:19:37 +02:00
Thomas Haller
37047aba36
std-aux: add nm_assert_addr_family_or_unspec() and nm_utils_addr_family_other() helpers 2021-09-28 12:56:39 +02:00
Thomas Haller
c9a833c910
l3cfg: drop nm_l3cfg_property_emit_register() API
The idea was that NMIPConfig would register itself with the property (like "address-data")
and then NML3Cfg would emit the property changed notification.

However, we can already achive that via the regular notification, in particular
by listening to NM_L3_CONFIG_NOTIFY_TYPE_PLATFORM_CHANGE_ON_IDLE notification.

Also, NML3Cfg does not really understand the details when the property should
be emitted. For example, many routes not not exposed via "route-data" property,
and changes to those should not trigger a notification.

Drop the unused API.
2021-09-27 10:09:50 +02:00
Thomas Haller
b8ab6837df
glib-aux: add nm_g_variant_equal() helper 2021-09-27 10:07:43 +02:00
Thomas Haller
e47dd2ee22
l3cfg: configure dependent routes when creating combined config 2021-09-27 07:55:32 +02:00
Thomas Haller
ed1536c890
l3cfg: fix assertion failure in _l3_hook_add_obj_cb()
With nm_l3cfg_get_combined_l3cd(), we can get the commited or
the combined (next) l3cd. The commits is easy, it's cached already.

However, the combined needs to be computed first, if there were any
changes. For that we call _l3cfg_update_combined_config(), which then
also calls nm_l3_config_data_merge().

But in non-commit mode, _l3cfg_update_combined_config() doesn't call
_l3_acd_data_add_all(), so in _l3_hook_add_obj_cb() the ACD data may
not be as expected. This can previously hit an assertion.
2021-09-25 10:10:17 +02:00
Thomas Haller
d68fa91199
platform/tests: fix assertion failure in NMTstpAcdDefender
Seems we can get a DOWN event during unit tests. I don't really
understand why, but let's ignore it.

  [...]
  #4  0x000055e365777786 in _l3_acd_nacd_event (fd=<optimized out>, condition=<optimized out>, user_data=0x55e367566270) at src/core/platform/tests/test-common.c:2703
  #5  0x00007f4399c224cf in g_main_dispatch (context=0x55e36755fce0) at ../glib/gmain.c:3337
  #6  g_main_context_dispatch (context=0x55e36755fce0) at ../glib/gmain.c:4055
  #7  0x00007f4399c764f8 in g_main_context_iterate.constprop.0 (context=context@entry=0x55e36755fce0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
      at ../glib/gmain.c:4131
  #8  0x00007f4399c1fc03 in g_main_context_iteration (context=0x55e36755fce0, context@entry=0x0, may_block=may_block@entry=1) at ../glib/gmain.c:4196
  #9  0x000055e365770719 in test_l3_ipv6ll (test_data=<optimized out>) at src/core/tests/test-l3cfg.c:1024
2021-09-25 10:10:17 +02:00
Thomas Haller
a446e490f9
l3cfg: mediate commit_type with nm_l3cfg_commit_on_idle_schedule()
We have nm_l3cfg_commit(), however that is synchronous and triggers an
avalanche of side effects. So it should be avoided if a component is
not aware of the current circumstances in which it gets called (most of them).

The alternative is nm_l3cfg_commit_on_idle_schedule(), but previously
that only supported the auto type.

Two changes:

- add a commit_type parameter to nm_l3cfg_commit_on_idle_schedule().
  This allows to explicitly select a type for the next commit.
  Previously, if the caller wanted for example to trigger a reapply
  once, they had to register a handle, trigger the commit and unregister
  the handle again. This basically allows to specify an ad-hoc commit
  type that is only used once.

- if an explicit commit type is requested, then still always combine
  it with auto. That means, we always use the "maximum" of what is
  requested and what is registered.
2021-09-24 21:48:39 +02:00
Thomas Haller
ddfd1e8ddf
device: minor cleanup in reapply_cb() 2021-09-24 18:03:05 +02:00
Yu Watanabe
7fba0f7cb2
libsystemd-network: disable event sources before unref them
This also (is supposed to) fix a assertion failure when in ipv4acd
when receiving an ARP packet in an unexpected state.

See-also: https://github.com/systemd/systemd/issues/20825
See-also: https://github.com/systemd/systemd/pull/20826
eb2f750242

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/807
2021-09-24 16:52:54 +02:00
Thomas Haller
4521e2aa89
docs: update URL for latest online documentation 2021-09-24 14:41:35 +02:00