Commit graph

29510 commits

Author SHA1 Message Date
Thomas Haller
bcce368e55
clang-format: mark FOR_EACH_DELAYED_ACTION() as a ForEachMacro 2022-01-13 15:25:17 +01:00
Thomas Haller
0cfaa63120
release: bump version to 1.35.4 (development) 2022-01-12 17:35:10 +01:00
Beniamino Galvani
ae28d2251a core: set force-commit flag for generated routes
The force-commit flag is used to force the commit of an address or a
route from DHCP/RA even when it was removed from platform externally
(for example because it expired). Routes generated from the l3cd
should also have the flag set.

Without this, NM properly re-adds the DHCP address after the lease is
lost and obtained again, but fails to add the prefix-route.

Fixes: 2838b1c5e8 ('core: track force-commit flag for l3cd and platform objects')

https://bugzilla.redhat.com/show_bug.cgi?id=2033991
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1049
2022-01-12 15:01:42 +01:00
Lubomir Rintel
3e12c6ff81 ipv4ll: fix assert on external LL address removal
Consider externally removed IPv4LL bad, proceed as if a collision was
detected. Otherwise we trip an assert:

  <trace> [1641816260.3963] l3cfg[b8bf8cd16ec4732e,ifindex=47]: emit signal (platform-change-on-idle, obj-type-flags=0x14)
  **
  nm:ERROR:src/core/nm-l3-ipv4ll.c:888:_ipv4ll_state_change: code should not be reached
  Aborted (core dumped)

  #3  0x00007f41621d020e in g_assertion_message_expr (domain=domain@entry=0x5559cd829140 "nm",
      file=file@entry=0x5559cd823e51 "src/core/nm-l3-ipv4ll.c",
      line=line@entry=888, func=func@entry=0x5559cd824d30 <__func__.38810> "_ipv4ll_state_change",
      expr=expr@entry=0x0) at gtestutils.c:2556
  #4  0x00005559cd719686 in _ipv4ll_state_change (self=0x5559cef886c0,
      is_on_idle_handler=0) at src/core/nm-l3-ipv4ll.c:888
  #8  0x00007f41626a5093 in <emit signal ??? on instance 0x5559ceffaa30 [NML3Cfg]>
      (instance=instance@entry=0x5559ceffaa30, signal_id=<optimized out>,
       detail=detail@entry=0) at gsignal.c:3448
  #9  0x00005559cd511a03 in _nm_l3cfg_emit_signal_notify
      (self=self@entry=0x5559ceffaa30 [NML3Cfg], notify_data=notify_data@entry=0x7ffd1caa8640)
      at src/core/nm-l3cfg.c:576
  #10 0x00005559cd5122dc in _nm_l3cfg_emit_signal_notify_acd_event (self=0x5559ceffaa30 [NML3Cfg],
      acd_data=<optimized out>) at src/core/nm-l3cfg.c:2008
  #11 0x00005559cd512463 in _nm_l3cfg_emit_signal_notify_acd_event_all
      (self=0x5559ceffaa30 [NML3Cfg]) at src/core/nm-l3cfg.c:2041
  #12 0x00005559cd5194ef in _l3_acd_nacd_event (fd=<optimized out>, condition=<optimized out>,
      user_data=<optimized out>) at src/core/nm-l3cfg.c:1536
  #13 0x00007f41621a895d in g_main_dispatch (context=0x5559ceec8bc0) at gmain.c:3193
  #14 0x00007f41621a895d in g_main_context_dispatch (context=context@entry=0x5559ceec8bc0)
      at gmain.c:3873
  #15 0x00007f41621a8d18 in g_main_context_iterate (context=0x5559ceec8bc0, block=block@entry=1,
      dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
  #16 0x00007f41621a9042 in g_main_loop_run (loop=0x5559ceea40f0) at gmain.c:4142
  #17 0x00005559cd47c7a4 in main (argc=<optimized out>, argv=<optimized out>)
      at src/core/main.c:511

https://bugzilla.redhat.com/show_bug.cgi?id=2028404
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1059
2022-01-12 14:58:29 +01:00
Thomas Haller
3b2c42b58f
platform: merge branch 'th/platform-poll-netlink'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1060
2022-01-12 13:35:42 +01:00
Thomas Haller
56a051de56
platform: log when blocking poll() returns for reading netlink socket
Try to debug a hang in platform code, presumably during poll().
This logging seems useful for debugging this particular issue,
but it might be useful in general.
2022-01-12 13:34:44 +01:00
Thomas Haller
ba9b199cfd
platform: clamp timestamp in event_handler_read_netlink() 2022-01-12 13:34:44 +01:00
Thomas Haller
a79efac2fe
platform/trivial: rename "now_ns" to "now_nsec"
I was already doing such renaming at various places. Let's be consistent
and clear. It was (slightly) confusing was "ns" means.
2022-01-12 13:34:44 +01:00
Thomas Haller
abf39ed046
platform: log wait time in event_handler_read_netlink() 2022-01-12 13:34:43 +01:00
Thomas Haller
65cdbd355f
platform: fix type for timestamp in delayed_action_wait_for_nl_response_complete_check()
Fixes: d074ffc836 ('platform: refactor completing netlink responses in event_handler_read_netlink()')
2022-01-12 13:34:39 +01:00
Thomas Haller
f21340ab5c
build/autotools: fix linking libnm-log-null into various executables
Interestingly, on RHEL9 I suddenly get a linker error:

  libtool: link: gcc -Wall -Werror -Wextra -Wdeclaration-after-statement -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wpointer-arith -Wshadow -Wshift-negative-value -Wstrict-prototypes -Wundef -Wvla -Wno-duplicate-decl-specifier -Wno-format-truncation -Wno-format-y2k -Wno-missing-field-initializers -Wno-pragmas -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-array-bounds -Wunused-value -Wcast-function-type -Wimplicit-fallthrough -fno-strict-aliasing -fdata-sections -ffunction-sections -Wl,--gc-sections -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,--version-script=./linker-script-binary.ver -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -o src/nm-online/.libs/nm-online src/nm-online/nm_online-nm-online.o -Wl,--export-dynamic -pthread  src/libnm-client-impl/.libs/libnm.so src/libnm-client-aux-extern/.libs/libnm-client-aux-extern.a /root/NetworkManager/contrib/fedora/rpm/NetworkManager.20220111-121006.2X0NXg/BUILD/NetworkManager-1.35.3/src/libnm-client-impl/.libs/libnm.so -lgnutls -ludev src/libnm-glib-aux/.libs/libnm-glib-aux.a src/libnm-std-aux/.libs/libnm-std-aux.a src/c-siphash/.libs/libc-siphash.a -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -pthread
  /usr/bin/ld: src/libnm-glib-aux/.libs/libnm-glib-aux.a(libnm_glib_aux_la-nm-time-utils.o): in function `_t_init_global_state':
  /root/NetworkManager/contrib/fedora/rpm/NetworkManager.20220111-121006.2X0NXg/BUILD/NetworkManager-1.35.3/src/libnm-glib-aux/nm-time-utils.c:73: undefined reference to `_nm_utils_monotonic_timestamp_initialized'
  collect2: error: ld returned 1 exit status
  make[2]: *** [Makefile:11437: src/nm-online/nm-online] Error 1

The linker is right. Fix it.
2022-01-11 22:11:18 +01:00
Beniamino Galvani
d68ab6b8f0 nm-sudo: rename to nm-priv-helper
The name "nm-sudo" reminds of the "sudo" tool, and this is a bit
confusing because it's not related. Rename the service to
"nm-priv-helper", which stands for "NM privileged helper".

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/938
2022-01-11 21:46:55 +01:00
Beniamino Galvani
9f3d2a09ea supplicant: enable SAE-H2E
H2E (hash to element) is a newer method for generating the PWE
(password element) for SAE, alternative to the existing
"hunting-and-pecking". It is considered more secure and it is
mandatory for the WPA3 certification; also, SAE in the 6GHz band can
only use H2E (hunting-and-pecking is disallowed).

Enable H2E in addition to hunting-and-pecking.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/753
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1045
2022-01-11 21:39:04 +01:00
Thomas Haller
e0cdbd733b
CONTRIBUTING: update "Coding Style" section 2022-01-11 15:18:08 +01:00
Lubomir Rintel
5f0ddaa610 Revert "nm-device: avoid starting ac6 if l3cfg is not there"
This reverts commit bb0a31e6eb.

This was pushed by accident.
2022-01-11 14:57:48 +01:00
Lubomir Rintel
fccb5608f3 nm-device: clean up IP methods if we lose ifindex
If the ovs interface goes away, the ifindex gets zeroed out and l3cfg is
cleaned. We can't follow up with IP configuration. Bad things happen if
we try to:

  #0  0x00007f769734c895 in _g_log_abort (breakpoint=1) at gmessages.c:580
  #1  0x00007f769734db98 in g_logv (log_domain=0x55b2472d8840 "nm",
        log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>,
        args=args@entry=0x7fff4041b9d0) at gmessages.c:1391
  #2  0x00007f769734dd63 in g_log (log_domain=log_domain@entry=0x55b2472d8840 "nm",
        log_level=log_level@entry=G_LOG_LEVEL_CRITICAL,
        format=format@entry=0x7f769739a620 "%s: assertion '%s' failed") at gmessages.c:1432
  #3  0x00007f769734e59d in g_return_if_fail_warning
      (log_domain=log_domain@entry=0x55b2472d8840 "nm",
        pretty_function=pretty_function@entry=0x55b2472d5fe0 <__func__.39677> "nm_lndp_ndisc_new",
        expression=expression@entry=0x55b2472d5fa3 "NM_IS_L3CFG(config->l3cfg)")
        at gmessages.c:2809
  #4  0x000055b2471ce3fa in nm_lndp_ndisc_new (config=config@entry=0x7fff4041bb30)
        at src/core/ndisc/nm-lndp-ndisc.c:680
  #5  0x000055b247123b32 in _dev_ipac6_start (self=self@entry=0x55b248078360 [NMDeviceOvsInterface])
        at src/core/devices/nm-device.c:11287
  #6  0x000055b2471232f8 in _dev_ipac6_start_continue (self=0x55b248078360 [NMDeviceOvsInterface])
        at src/core/devices/nm-device.c:11338
  #7  0x000055b2471232f8 in _dev_ipll6_set_llstate (self=0x55b248078360 [NMDeviceOvsInterface],
        llstate=<optimized out>, lladdr=<optimized out>) at src/core/devices/nm-device.c:10541
  #8  0x000055b2471c9e8b in _emit_changed_on_idle_cb (user_data=user_data@entry=0x55b24807bdd0)
        at src/core/nm-l3-ipv6ll.c:221
  #9  0x00007f769734327b in g_idle_dispatch (source=0x55b248119200,
        callback=0x55b2471c9ce0 <_emit_changed_on_idle_cb>,
        user_data=0x55b24807bdd0) at gmain.c:5579
  #10 0x00007f769734695d in g_main_dispatch (context=0x55b247f56bc0) at gmain.c:3193
  #11 0x00007f769734695d in g_main_context_dispatch (context=context@entry=0x55b247f56bc0)
        at gmain.c:3873
  #12 0x00007f7697346d18 in g_main_context_iterate (context=0x55b247f56bc0,
        block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
  #13 0x00007f7697347042 in g_main_loop_run (loop=0x55b247f320f0) at gmain.c:4142
  #14 0x000055b246f26b64 in main (argc=<optimized out>,
        argv=<optimized out>) at src/core/main.c:511

https://bugzilla.redhat.com/show_bug.cgi?id=2012934
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1044

Fixes-test: @ovs_cloned_mac_set_on_iface
2022-01-11 14:55:38 +01:00
Lubomir Rintel
bb0a31e6eb nm-device: avoid starting ac6 if l3cfg is not there
If the ovs interface goes away, the ifindex gets zeroed out and l3cfg is
cleaned. Avoid starting ac6 in that case -- add checks similar to what
we do for ll6.

Bad things happen otherwise:

  #0  0x00007f769734c895 in _g_log_abort (breakpoint=1) at gmessages.c:580
  #1  0x00007f769734db98 in g_logv (log_domain=0x55b2472d8840 "nm",
        log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>,
        args=args@entry=0x7fff4041b9d0) at gmessages.c:1391
  #2  0x00007f769734dd63 in g_log (log_domain=log_domain@entry=0x55b2472d8840 "nm",
        log_level=log_level@entry=G_LOG_LEVEL_CRITICAL,
        format=format@entry=0x7f769739a620 "%s: assertion '%s' failed") at gmessages.c:1432
  #3  0x00007f769734e59d in g_return_if_fail_warning
      (log_domain=log_domain@entry=0x55b2472d8840 "nm",
        pretty_function=pretty_function@entry=0x55b2472d5fe0 <__func__.39677> "nm_lndp_ndisc_new",
        expression=expression@entry=0x55b2472d5fa3 "NM_IS_L3CFG(config->l3cfg)")
        at gmessages.c:2809
  #4  0x000055b2471ce3fa in nm_lndp_ndisc_new (config=config@entry=0x7fff4041bb30)
        at src/core/ndisc/nm-lndp-ndisc.c:680
  #5  0x000055b247123b32 in _dev_ipac6_start (self=self@entry=0x55b248078360 [NMDeviceOvsInterface])
        at src/core/devices/nm-device.c:11287
  #6  0x000055b2471232f8 in _dev_ipac6_start_continue (self=0x55b248078360 [NMDeviceOvsInterface])
        at src/core/devices/nm-device.c:11338
  #7  0x000055b2471232f8 in _dev_ipll6_set_llstate (self=0x55b248078360 [NMDeviceOvsInterface],
        llstate=<optimized out>, lladdr=<optimized out>) at src/core/devices/nm-device.c:10541
  #8  0x000055b2471c9e8b in _emit_changed_on_idle_cb (user_data=user_data@entry=0x55b24807bdd0)
        at src/core/nm-l3-ipv6ll.c:221
  #9  0x00007f769734327b in g_idle_dispatch (source=0x55b248119200,
        callback=0x55b2471c9ce0 <_emit_changed_on_idle_cb>,
        user_data=0x55b24807bdd0) at gmain.c:5579
  #10 0x00007f769734695d in g_main_dispatch (context=0x55b247f56bc0) at gmain.c:3193
  #11 0x00007f769734695d in g_main_context_dispatch (context=context@entry=0x55b247f56bc0)
        at gmain.c:3873
  #12 0x00007f7697346d18 in g_main_context_iterate (context=0x55b247f56bc0,
        block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3946
  #13 0x00007f7697347042 in g_main_loop_run (loop=0x55b247f320f0) at gmain.c:4142
  #14 0x000055b246f26b64 in main (argc=<optimized out>,
        argv=<optimized out>) at src/core/main.c:511
2022-01-11 14:53:26 +01:00
Thomas Haller
9ab22dbc80
CONTRIBUTING: clarify on the use/lack of curly braces around blocks
This is the style we have ever since. Spell it out. With the difference
that now single line statements may have braces.

Recently we were already sloppy about allowing curly braces for single line
statements. Maybe there was a point in that. Imagine you start with:

    if (condition)
        call(some, parameter);

Afterwards you change the code so that the line becomes too long and
clang-format wraps the line (requiring you to add braces):

    if (condition) {
        call(some,
             call_another_function(hey));
    }

The problem now is that this diff is larger than it would have been, if
you added curly braces from the start. Also, it means you have to go
back and forth to add/remove these braces, as clang-format reformats the
code.

Also, if you have if-else-if blocks, then mixing multi line statements
with single line statements is also cumbersome, because when something
needs to change, the diff is may be larger (and the change more
cumbersome).

So it might be convenient to just always add the braces, and the
documented style now allows for that.
2022-01-11 14:30:33 +01:00
Thomas Haller
d5f917e702
bluetooth: fix invalid assertion in NMBluezManager:dispose()
We need to first free "priv->bzobjs", which then will unlink all bzobjs
from the lists. The assert needs to go after.

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

Fixes: 4154d9618c ('bluetooth: refactor BlueZ handling and let NMBluezManager cache ObjectManager data')
2022-01-11 10:10:35 +01:00
Ana Cabral
a7466c1b58 libnm,core: merge branch 'ac/ovs2'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1052
2022-01-10 22:50:43 +00:00
Ana Cabral
74c08c7084 openvswitch: Add ovs-dpdk n_rxq property
https://bugzilla.redhat.com/show_bug.cgi?id=2001563
2022-01-10 22:48:30 +00:00
Ana Cabral
29cf10ec24 version: add 1.36 macros 2022-01-10 22:48:30 +00:00
Ana Cabral
f0cb75f669 trivial: fix typos 2022-01-10 22:48:30 +00:00
Ana Cabral
d6395f7ee7 core/ovs: fix setting dpdk-devargs JSON to NULL
NMSettingOvsDpdk does not have a verify() implementation that would prevent
the devargs property from being NULL. We must thus anticipate and handle
a NULL value.

Fixes: ae4152120a ('ovs/ovsdb: add support for setting dpdk devargs option')
2022-01-10 22:48:30 +00:00
Thomas Haller
daba069eab
core: merge branch 'th/hostname-cleanup'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1057
2022-01-10 20:45:03 +01:00
Thomas Haller
20eb6df215
core: simplify code in nm_dns_manager_set_hostname() 2022-01-10 20:43:18 +01:00
Thomas Haller
bbff0c9853
core: ensure static-hostname is valid UTF-8
We get the hostname via D-Bus (from hostnamed) or read it from file.
In the latter case, it is not ensured that it's valid UTF-8.
Non-UTF-8 "strings" are bad, because we might try to expose them
on D-Bus, log them or other bad things.

Sanitize the string by using backslash escaping. Maybe we should
outright reject such binary nonsense, but it's not done here,
for no strong reasons.
2022-01-10 20:43:17 +01:00
Thomas Haller
a352647434
core: rename related things explicitly to "static-hostname"
We have at least static and transient hostnames. Let's be clear which
one we are talking about.

Note that also NM_SETTINGS_HOSTNAME gets renamed to
NM_SETTINGS_STATIC_HOSTNAME, because it seems clearer.
The only purpose of NM_SETTINGS_STATIC_HOSTNAME is to be the backing
property for the "Hostname" D-Bus property for the NMDBusObject glue.
So, while the new name makes more sense to me, it's now also
inconsistent with it's primary use (the D-Bus property). Still...
2022-01-10 20:43:17 +01:00
Thomas Haller
2b449694e5
checkpatch: complain about tabs in source file
There are very few places left where we would accept tabs in a source
file. Warn about that, even if it might cause some false positives.

I think this line was commented out due to a mistake.
2022-01-07 07:32:04 +01:00
Thomas Haller
866e3a2b51
contrib/scripts: update "nm-copr-build.sh" script to use new nm-git-bundle 2022-01-06 10:03:57 +01:00
Thomas Haller
34c59c96c5
contrib/scripts: better explain the purpose of nm-git-bundle 2022-01-06 10:01:51 +01:00
Thomas Haller
0acb4b685d
glib-aux: honor NM_OBFUSCATE_PTR=0 setting for printing raw pointer values
We avoid printing pointer values directly, instead we usually call
NM_HASH_OBFUSCATE_PTR(). This hashes the pointers with a random seed
so they are not directly visible.

That obviously makes it harder to debug. Add an environment variable
to disable that.

  $ NM_OBFUSCATE_PTR=0 LIBNM_CLIENT_DEBUG=trace,stdout nmcli

Note that this flag is only honored in debug builds (WITH_MORE_ASSERTS>0).
2022-01-05 22:57:51 +01:00
Thomas Haller
99f82b4b84
contrib: fix "find-backports" script to properly handle "Ignore-Backport" tag
The "Ignore-Backport" tag can be used to mark a commit that should not
be backported. Similar to the "cherry picked from" line, which indicates
that the patch was backported.

Anyway, this didn't work correctly, because we first pre-filter the
commits we search (as a performance optimization) by using `git-log` to
get a subset of the commits we want to investigate.

So if you had a commit with an "Ignore-Backport" tag, but without "cherry
picked from" line, then it wasn't found.

Fix that.
2022-01-05 09:30:16 +01:00
Thomas Haller
a6ff5ee448
contrib/scripts: add Fedora version to podmain container name for "nm-code-format-container.sh"
Older branches, like "nm-1-32" will always be formatted with a
different, older clang-format version. Luckily we also have on "nm-1-32"
branch the "nm-code-format-container.sh" script, so we can still
reformat the sources using the container.

However, as the name of the container was always "nm-code-format",
we would have to re-generate the container when we switch between
branches. As the container really only depends on the Fedora version
(as the clang-format version is tied to the corresponding Fedora
version), let's include the Fedora version in the name of the container.
2022-01-04 21:17:19 +01:00
James Hilliard
edc37b3adf
build: allow configuring default for wifi.backend setting
Distributions may want to change the default wifi.backend, if for
example they are building without wpa_supplicant support.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/869

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1040
2022-01-04 06:41:37 +01:00
Tomohiro Mayama
7377df2f2d
libnm: allow WPA-EAP-SUITE-B-192 network to match existing connections
Signed-off-by: Tomohiro Mayama <parly-gh@iris.mystia.org>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1050
2022-01-03 13:30:56 +01:00
Sam Morris
afb25afa8f
cli: correct active connection details header in nmcli output
[thaller@redhat.com: update translation strings and regenerate
  expected output for nmcli tests]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1046
2022-01-03 12:24:46 +01:00
Beniamino Galvani
298d0b961f
core: log variant properties in connection diff
Properly print properties containing a GVariant (as those backed by
a gendata hashtable).

For example, before:

 ++ ethtool.ring-rx-mini      = ???

After:

 ++ ethtool.ring-rx-mini      = 0

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

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1051
2022-01-03 09:51:49 +01:00
Thomas Haller
4010d75922
libnm: refactor some NMSetting to use direct properties for enum/flags
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1033
2021-12-24 11:14:22 +01:00
Beniamino Galvani
25e705c361 libnm: fix warning when setting wrong ethtool ternary value
$ nmcli connection modify dummy1 ethtool.feature-rx a
  (process:3077356): GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory.
  This indicates a bug in someone's code. You must ensure an error is NULL before it's set.
  The overwriting error message was: 'a' is not valid; use 'on', 'off', or 'ignore'
  Error: failed to modify ethtool.feature-rx: 'a' is not valid; use [true, yes, on], [false, no, off] or [unknown].

Fixes: e5b46aa38a ('cli: use nmc_string_to_ternary() to parse ternary in _set_fcn_ethtool()')
2021-12-23 09:15:39 +01:00
Beniamino Galvani
e6bd98cc07 core: merge branch 'dracut_rhel9_test'
core: don't reset assume state if the device is unmanaged by parent

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1048
2021-12-21 08:48:40 +00:00
Wen Liang
87674740d8 core: don't reset assume state if the device is unmanaged by parent
When the device gets realized, similar to the situation that the device
 is unmanaged by platform-init, if the device is still unmanaged by
parent and we clear the assume state. Then, when the device becomes
managed, NM is not able to properly assume the device using the UUID.

Therefore, we should not clear the assume state if the device has only
the NM_UNMANAGED_PLATFORM_INIT or the NM_UNMANAGED_PARENT flag set
in the unmanaged flags.

The previous commit 3c4450aa4d ('core: don't reset assume state too
early') did something similar for NM_UNMANAGED_PLATFORM_INIT flag only.
2021-12-20 10:28:40 -05:00
Beniamino Galvani
440e5a9941 release: bump version to 1.35.3 (development) 2021-12-15 18:48:54 +01:00
xiangnian
31a12ee344 example: Match more AP security
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1043
2021-12-10 16:49:51 +01:00
Beniamino Galvani
02de04287f device: fix update of the ip-iface property
Before the l3cfg rework, the ip-iface property was exported only for
interfaces with an ifindex, and only in some device states.

Restore the old behavior since it is part of the API. For example,
firewalld uses the property to tell which interfaces have a ifindex.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')

https://bugzilla.redhat.com/show_bug.cgi?id=2026024
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1042
2021-12-09 15:37:44 +01:00
Beniamino Galvani
e9ca5583e5 platform: add bpf filter to ignore routes from routing daemons
Routing daemons can add a large amount of routes to the
system. Currently NM receives netlink notifications for all those
routes and exposes them on D-Bus. With many routes, the daemon becomes
increasingly slow and uses a lot of memory.

The rtm_protocol field of the route indicates the source of the
route. From /usr/include/linux/rtnetlink.h, the allowed values are:

  #define RTPROT_UNSPEC          0
  #define RTPROT_REDIRECT        1        /* Route installed by ICMP redirects;
                                             not used by current IPv4 */
  #define RTPROT_KERNEL          2        /* Route installed by kernel */
  #define RTPROT_BOOT            3        /* Route installed during boot */
  #define RTPROT_STATIC          4        /* Route installed by administrator */

  /* Values of protocol >= RTPROT_STATIC are not interpreted by kernel;
     they are just passed from user and back as is.
     It will be used by hypothetical multiple routing daemons.
     Note that protocol values should be standardized in order to
     avoid conflicts.
   */

  #define RTPROT_GATED           8        /* Apparently, GateD */
  #define RTPROT_RA              9        /* RDISC/ND router advertisements */
  #define RTPROT_MRT            10        /* Merit MRT */
  #define RTPROT_ZEBRA          11        /* Zebra */
  #define RTPROT_BIRD           12        /* BIRD */
  #define RTPROT_DNROUTED       13        /* DECnet routing daemon */
  #define RTPROT_XORP           14        /* XORP */
  #define RTPROT_NTK            15        /* Netsukuku */
  #define RTPROT_DHCP           16        /* DHCP client */
  #define RTPROT_MROUTED        17        /* Multicast daemon */
  #define RTPROT_KEEPALIVED     18        /* Keepalived daemon */
  #define RTPROT_BABEL          42        /* Babel daemon */
  #define RTPROT_OPENR          99        /* Open Routing (Open/R) Routes */
  #define RTPROT_BGP           186        /* BGP Routes */
  #define RTPROT_ISIS          187        /* ISIS Routes */
  #define RTPROT_OSPF          188        /* OSPF Routes */
  #define RTPROT_RIP           189        /* RIP Routes */
  #define RTPROT_EIGRP         192        /* EIGRP Routes */

Since NM uses only values <= RTPROT_STATIC, plus RTPROT_RA and
RTPROT_DHCP, add a BPF filter to the netlink socket to discard
notifications for other route types.

https://bugzilla.redhat.com/show_bug.cgi?id=1861527
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1038
2021-12-09 13:19:45 +01:00
Lubomir Rintel
42307a6a67 release: bump version to 1.35.2 (development) 2021-12-01 16:46:47 +01:00
Lubomir Rintel
79885656d3 initrd: don't add a connection if there's a connection dir with rd.neednet
Only create a default connection with rd.neednet if we're starting with
a totally blank slate. Otherwise it could be that the user already
included configuration in the initrd and merely wants us to activate it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/999
2021-12-01 15:13:16 +01:00
Lubomir Rintel
af1903fe3f nm-device: prefer manually configured addresses to automatic
This bumps L3_CONFIG_DATA_TYPE_MANUALIP to be the most important address
source; which is what had been the case before NetworkManager/next and
is presumably what the user expects.

It also comes into play for iBFT-booted machines, where iBFT contains a
permanent address (no lifetime data), while DHCP might lease out the
same one. In that case, expiry of the latter could potentially disrupt
connectivity to a vital storage volume.

Fixes: 14962cb414 ('merge: branch 'next''):

https://bugzilla.redhat.com/show_bug.cgi?id=2013921
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1011
2021-12-01 15:04:16 +01:00
Fernando Fernández Mancera
249ab3a5cd merge: branch 'ff/nmcli_editor_wol'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1036
2021-12-01 11:51:18 +00:00