Commit Graph

25333 Commits

Author SHA1 Message Date
Thomas Haller
0cbd9193cd ndisc/trivial: stype fixes in receive_ra() 2020-04-01 15:12:53 +02:00
Fernando Gont
a5290915d5 IPv6 SLAAC: Clamp received PIO and RIO Lifetime Values
This commit implements Section 4.1.2 of
<https://tools.ietf.org/html/draft-gont-6man-slaac-renum-05>, to improve
the reaction of IPv6 SLAAC to renumbering events.

Namely:

* It caps the Preferred Lifetime of PIOs to the "Router Lifetime" value
  of the corresponding Router Advertisement Message, and the Valid Lifetime
  of PIOs to 48 * Router Lifetime.

Additionally, it also caps the Valid Lifetime of RIOs to "Router Lifetime".

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/455
2020-04-01 15:11:11 +02:00
Thomas Haller
87b0d4cd7c shared: add assertions to _parse_legacy_addr4() and _nm_utils_ascii_str_to_int64()
Add more assertion for hunting down assertion failure at [1].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1797915
2020-03-31 13:48:52 +02:00
Thomas Haller
7ab561eb38 libnm: ignore "Peer" property on Device.Veth interface
With LIBNM_CLIENT_DEBUG=trace we get warnings:

  libnm-dbus: <warn > [31459.06461] nmclient[cc68a57bb44f1427]: get-managed-objects: [/org/freedesktop/NetworkManager/Devices/11]: ignore unknown property org.freedesktop.NetworkManager.Device.Veth.Peer
2020-03-30 18:08:59 +02:00
Thomas Haller
1edcf4a365 license: add Taegil to RELICENSE.md
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/397#note_449957
2020-03-28 13:05:59 +01:00
Thomas Haller
46dd4d0fbf meson: merge branch 'inigomartinez/meson-license'
Add SPDX license headers for meson files.

As far as I can tell, according to RELICENSE.md file, almost everybody
who contributed to the meson files agreed to the LGPL-2.1+ licensing.
This entails the vast majority of code in question.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/397
2020-03-28 12:45:19 +01:00
Thomas Haller
ff814923eb core: prevent multiple attempts to create default wired connection
Scenario:

  - have ethernet connection as unmanaged.
  - create (or have) a suitable profile for the connection.
  - make the device as managed. No default wired connection gets
    created.
  - delete the profile.

Note that NMManager does in manager_device_state_changed():

»···if (NM_IN_SET (new_state,
»···               NM_DEVICE_STATE_UNAVAILABLE,
»···               NM_DEVICE_STATE_DISCONNECTED))
»···»···nm_settings_device_added (priv->settings, device);

that means, when the device the next time goes through
UNAVAILABLE/DISCONNECTED states, we will suddenly create the
default "Wired connection 1" profile.

That doesn't seem right. When a device is suitable to have a
default-wired connection, we should only check once whether to
create it. We should not retry that later. The !no-auto-default
mechanism exists so we can start NetworkManager without a profile for
the device. It doesn't mean that we later one (after previously deciding
not to create a profile), we still create it.

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

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/450
2020-03-28 11:01:05 +01:00
Beniamino Galvani
c84a4579b2 initrd: fix build error with assertions disabled
$ meson -Dmore_asserts=0 meson-build
$ ninja -C meson-build
[712/859] Compiling C object 'src/initrd/b383957@@nmi-core@sta/nmi-cmdline-reader.c.o'.
../src/initrd/nmi-cmdline-reader.c: In function ‘nmi_cmdline_reader_parse’:
../src/initrd/nmi-cmdline-reader.c:871:4: warning: ‘s_ip’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  871 |    nm_setting_ip_config_add_dns (s_ip, ns);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/initrd/nmi-cmdline-reader.c:835:21: note: ‘s_ip’ was declared here
  835 |  NMSettingIPConfig *s_ip;
      |                     ^~~~

Fixes: 25a2b6e14f ('initrd: rework command line parsing')
2020-03-27 16:27:06 +01:00
Antonio Cardace
54aaf240d2 wwan: merge branch 'a-wai/NetworkManager-fix-sim-unlock'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/452

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/397

Reviewed-by: Antonio Cardace <acardace@redhat.com>
2020-03-27 11:52:57 +01:00
Arnaud Ferraris
0cf7f1d2f5 nm-modem: don't fail if secrets request times out
When starting with a locked modem, it may take some time for the user to
enter the PIN code, leading to the secrets request timing out. In that
case, we want the connection activation to be retried automatically once
the modem is unlocked, which can't be achieved if we propagate the error,
as the device will change state to 'failed'.

This patch ignores the 'no-secrets' error, as it means either the
request has timed out, or the user cancelled the request without
notifying NetworkManager. By doing this, we allow the connection to be
re-activated once the modem is unlocked.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2020-03-27 11:01:41 +01:00
Arnaud Ferraris
df20a98aa4 nm-device-modem: deactivate device when modem unlocked
When the modem is unlocked externally to NetworkManager, it is kept in
the 'need-auth' state. The current connection activation continues as
if nothing had changed, and the secrets request for the PIN code (which
is no longer necessary) eventually times out. The device state is then
changed to 'failed', meaning there won't be a new try at activating the
default connection automatically.

In order to prevent this, and retry activating the default connection
when the modem gets unlocked, we change the device state to
'deactivating' when we identify the modem has been unlocked externally.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2020-03-27 11:01:41 +01:00
Beniamino Galvani
c8b752c973 initrd: branch 'bg/initrd-cmdline-fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/447
2020-03-26 22:12:33 +01:00
Beniamino Galvani
99e0188886 initrd: add 'reader_' prefix to functions acting on Reader 2020-03-26 22:03:56 +01:00
Beniamino Galvani
25a2b6e14f initrd: rework command line parsing
The 'default_connection' created by the command line parser has
multiple purposes. It's the connection created for 'ip=' arguments
without command line, but is also created when there is a 'bootdev='
or for 'nameserver=' and no other connection exists at the moment the
argument is parsed. This is confusing and leads to a result that
depends on the order of parameters. For example:

 $ /usr/libexec/nm-initrd-generator -c connections -- bootdev=eth1 ip=eth0:dhcp
 $ ls connections/
 default_connection.nmconnection  eth0.nmconnection

 $ /usr/libexec/nm-initrd-generator -c connections -- ip=eth0:dhcp  bootdev=eth1
 $ ls connections/
 eth0.nmconnection  eth1.nmconnection

Make this more explicit by tracking 'bootdev_connection' and
'default_connection' individually.

Also fix handling of 'nameserver', 'rd.peerdns' and 'rd.route'
arguments. First process all connections, and then set those
properties. In particular, now nameservers are applied to all
connections.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/391
2020-03-26 22:03:56 +01:00
Beniamino Galvani
f3c9ee921e initrd: sort ibft connections
Instead of adding ibft connections in a random order to the list, sort
them alphabetically.
2020-03-26 22:03:56 +01:00
Beniamino Galvani
9b5322b33c initrd: keep connections sorted
Connections are kept in a hash table indexed by name. This causes non
deterministic output in get_conn() when we have to decide a default
connection and no bootdev was specified on the command line.

Also add an array that stores the original order in which interfaces
appear in the command line, and use it when we have to loop through
connections. The return value of nmi_cmdline_reader_parse() is still a
hash table because once we have generated connections, their order
doesn't matter.
2020-03-26 22:03:56 +01:00
Beniamino Galvani
6a8c6ed674 initrd: fix indentation in iBFT reader 2020-03-26 22:03:56 +01:00
Beniamino Galvani
bba7663407 initrd: generate ipv6.method=ignore connection with ip=dhcp
The legacy network module used to leave kernel IPv6 autoconfiguration
enabled with ip=dhcp. Do the same for backwards compatibility.

https://github.com/dracutdevs/dracut/issues/700
2020-03-26 22:03:56 +01:00
Beniamino Galvani
d0e0213a08 initrd: don't add empty connection if iBFT parsing fails
Don't add an empty connection to the list if
nmi_ibft_update_connection_from_nic() fails when reading iBFT
information.

If the function fails in parse_ip(), continue with the existing
connection built from other command line options.

Also, fix a memory leak.
2020-03-26 22:03:56 +01:00
Beniamino Galvani
2da77547ba ovs: merge branch 'bg/ovs-interface-mtu-rh1808124'
https://bugzilla.redhat.com/show_bug.cgi?id=1807726
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/433
2020-03-26 21:43:28 +01:00
Beniamino Galvani
c2a9712945 ovs: set the MTU in ovsdb when changing platform MTU of ovs-interface
If we change the the MTU of an ovs interface only through netlink, the
change could be overridden by ovs-vswitchd at any time when other
interfaces change. Set the MTU also in the ovsdb to prevent such
changes.

Note that if the MTU comes from the connection, we already set the
ovsdb MTU at creation time and so this other update becomes
useless. But it is needed when changing the MTU at runtime (reapply)
or when the MTU comes from a different source (e.g. DHCP).
2020-03-26 21:39:49 +01:00
Beniamino Galvani
ad12f26312 ovs: set MTU from connection when creating an internal interface
The ovs-vswitchd.conf.db(5) man page says about the the mtu_request
column in the Interface table:

  "Requested MTU (Maximum Transmission Unit) for the interface. A
   client can fill this column to change the MTU of an
   interface [...] If this is not set and if the interface has
   internal type, Open vSwitch will change the MTU to match the
   minimum of the other interfaces in the bridge."

Therefore, if the connection specifies a MTU, set it early when adding
the interface to the ovsdb so that it will not be changed to the
minimum of other interfaces.
2020-03-26 21:39:49 +01:00
Beniamino Galvani
a4c2c1a843 ovs/ovsdb: support changing the MTU of an ovs interface
Introduce a nm_ovsdb_set_interface_mtu() function to update the MTU of
an ovs interface in the ovsdb.
2020-03-26 21:39:49 +01:00
Beniamino Galvani
6b2f018377 merge: branch 'bg/ipv6-addresses-order-rh1814557'
https://bugzilla.redhat.com/show_bug.cgi?id=1814557
2020-03-26 21:32:42 +01:00
Beniamino Galvani
0118ad5125 platform: improve IPv6 address synchronization
When we must synchronize IPv6 addresses, we compare the order of
addresses to set with what is currently set on platform. Starting from
addresses with lower priority, when a mismatch is found we remove it
from platform and also remove all following addresses, so that we can
re-add them in the right order.

Since kernel keeps addresses internally sorted by scope, we should
consider each scope separately in order to avoid unnecessary address
deletions. For example, if we want to configure addresses
fe80::1/64,2000::1/64 and we currently have on platform 2000::1/64,
it's not necessary to remove the existing address; we can just add the
link-local one.

Co-authored-by: Thomas Haller <thaller@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=1814557
2020-03-26 21:28:56 +01:00
Beniamino Galvani
c878c48efb platform: sort IPv6 addresses from platform during sync
There is no guarantee that addresses returned from the cache are in
scope-priority order. Sort them.
2020-03-26 21:28:56 +01:00
Thomas Haller
6f9a478b7d tests: replace NMTST_SWAP() by new NM_SWAP() macro
NMTST_SWAP() used memcpy() for copying the value, while NM_SWAP() uses
a temporary variable with typeof(). I think the latter is preferable.

Also, the macro is essentially doing the same thing.
2020-03-26 21:28:56 +01:00
Thomas Haller
cec06138f1 shared: add NM_SWAP() macro 2020-03-26 21:28:56 +01:00
Thomas Haller
4fe46d9e20 build/meson: fix build by link nm-dispatcher with libnm-glib-aux.la
Fixes: a34b1f793e ('build: link nm-dispatcher with libnm-glib-aux.la')
2020-03-25 16:41:17 +01:00
Thomas Haller
380ecbc234 dispatcher: use nm_str_hash() for hash table in dispatcher
nm_str_hash() uses siphash24. We want to use that everywhere.
The only concern would be that it is slower. But if that's the concern,
then we would have many more performance critical places to care
about first.
2020-03-25 16:19:53 +01:00
Thomas Haller
a34b1f793e build: link nm-dispatcher with libnm-glib-aux.la
Our glib based code should also include our static utility library
libnm-glib-aux. This is our basic utility library that we want to
have around everywhere. Since we link statically, the linker will weed
out the unused stuff at compile time. So, there is no overhead, except
for the things that we actually use.
2020-03-25 16:14:52 +01:00
Thomas Haller
fbb65de32e rdisc: avoid static variable in receive_ra()
It's unnecessary and makes the function unnecessarily not thread safe.
Of course, also ndp_msg_opt_route_prefix() uses static variables, so
it's still not thread safe.

Fixes: c3a4656a68 ('rdisc: libndp implementation')
2020-03-25 11:16:50 +01:00
Thomas Haller
d1181533b8 rdisc: fix parsing ndp_msg_opt_dnssl_lifetime() from IPv6 RA
Fixes: c3a4656a68 ('rdisc: libndp implementation')
2020-03-25 11:16:16 +01:00
Thomas Haller
1704507c49 core: merge branch 'af/settings-add-matches' (part 1)
https://gitlab.freedesktop.org/afreof/NetworkManager/-/tree/af/settings-add-matches
2020-03-24 20:59:51 +01:00
Thomas Haller
f2fd1614f5 utils: use nm_utils_strsplit_set_full() in nm_utils_proc_cmdline_split()
We should handle kernel command line like systemd does, with its
ConditionKernelCommandLine= setting.

For example, it tokenizes words between various white space characters,
not only space. Use nm_utils_strsplit_set_full() for that.

Note that we currently don't yet have a tokenizer that supports
quotation, like systemd does. We should extend
nm_utils_strsplit_set_full() for that.
2020-03-24 20:59:36 +01:00
Thomas Haller
999c569585 shared: add NM_ASCII_WHITESPACES macro
NM_ASCII_SPACES contains the ASCII characters according to
g_ascii_isspace().

Add NM_ASCII_WHITESPACES which differs from NM_ASCII_SPACES by not
including "\f". In some cases, that character shall be excluded.
For example, this is what systemd uses as "WHITESPACE" define at
various places.

Also, reorder the spaces string so that plain space comes first. It is
expected that ' ' is much more frequently than newlines or tabs. While
the order here shouldn't matter, it seems preferably to order frequent
characters in front.
2020-03-24 20:43:55 +01:00
Adrian Freihofer
8069e5fd20 nm-core-utils: add nm_utils_proc_cmdline
Add a new function to read /proc/cmdline. The function caches the content.
2020-03-24 16:56:06 +01:00
Yuri Chornoivan
a30736fbd7 po: update Ukrainian (uk) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/448
2020-03-24 16:32:34 +01:00
Niklas Goerke
bddba4ca8b Add domain_match mode for wifi certificate domain comparison
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/308
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/437
2020-03-23 20:31:09 +01:00
Thomas Haller
e75d62ce76 systemd: merge branch systemd into master 2020-03-23 17:50:12 +01:00
Thomas Haller
46a1816034 systemd: update code from upstream (2020-03-23)
This is a direct dump from systemd git.

======

SYSTEMD_DIR=../systemd
COMMIT=cdc6c95737d26b1746b446dfe662872d593d23c6

(
  cd "$SYSTEMD_DIR"
  git checkout "$COMMIT"
  git reset --hard
  git clean -fdx
)

git ls-files -z :/src/systemd/src/ \
                :/shared/systemd/src/ \
                :/shared/nm-std-aux/unaligned.h | \
  xargs -0 rm -f

nm_copy_sd_shared() {
    mkdir -p "./shared/systemd/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./shared/systemd/$1"
}

nm_copy_sd_core() {
    mkdir -p "./src/systemd/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/systemd/$1"
}

nm_copy_sd_stdaux() {
    mkdir -p "./shared/nm-std-aux/"
    cp "$SYSTEMD_DIR/$1" "./shared/nm-std-aux/${1##*/}"
}

nm_copy_sd_core "src/libsystemd-network/arp-util.c"
nm_copy_sd_core "src/libsystemd-network/arp-util.h"
nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.c"
nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.h"
nm_copy_sd_core "src/libsystemd-network/dhcp-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp-lease-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp-network.c"
nm_copy_sd_core "src/libsystemd-network/dhcp-option.c"
nm_copy_sd_core "src/libsystemd-network/dhcp-packet.c"
nm_copy_sd_core "src/libsystemd-network/dhcp-protocol.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-lease-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-network.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-option.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.h"
nm_copy_sd_core "src/libsystemd-network/lldp-internal.h"
nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.c"
nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.h"
nm_copy_sd_core "src/libsystemd-network/lldp-network.c"
nm_copy_sd_core "src/libsystemd-network/lldp-network.h"
nm_copy_sd_core "src/libsystemd-network/network-internal.c"
nm_copy_sd_core "src/libsystemd-network/network-internal.h"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp-client.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp-lease.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-client.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c"
nm_copy_sd_core "src/libsystemd-network/sd-ipv4acd.c"
nm_copy_sd_core "src/libsystemd-network/sd-ipv4ll.c"
nm_copy_sd_core "src/libsystemd-network/sd-lldp.c"
nm_copy_sd_core "src/libsystemd/sd-event/event-source.h"
nm_copy_sd_core "src/libsystemd/sd-event/event-util.c"
nm_copy_sd_core "src/libsystemd/sd-event/event-util.h"
nm_copy_sd_core "src/libsystemd/sd-event/sd-event.c"
nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.c"
nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.h"
nm_copy_sd_core "src/libsystemd/sd-id128/sd-id128.c"
nm_copy_sd_core "src/systemd/_sd-common.h"
nm_copy_sd_core "src/systemd/sd-dhcp-client.h"
nm_copy_sd_core "src/systemd/sd-dhcp-lease.h"
nm_copy_sd_core "src/systemd/sd-dhcp-option.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-client.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h"
nm_copy_sd_core "src/systemd/sd-event.h"
nm_copy_sd_core "src/systemd/sd-id128.h"
nm_copy_sd_core "src/systemd/sd-ipv4acd.h"
nm_copy_sd_core "src/systemd/sd-ipv4ll.h"
nm_copy_sd_core "src/systemd/sd-lldp.h"
nm_copy_sd_core "src/systemd/sd-ndisc.h"
nm_copy_sd_shared "src/basic/alloc-util.c"
nm_copy_sd_shared "src/basic/alloc-util.h"
nm_copy_sd_shared "src/basic/async.h"
nm_copy_sd_shared "src/basic/cgroup-util.h"
nm_copy_sd_shared "src/basic/env-file.c"
nm_copy_sd_shared "src/basic/env-file.h"
nm_copy_sd_shared "src/basic/env-util.c"
nm_copy_sd_shared "src/basic/env-util.h"
nm_copy_sd_shared "src/basic/errno-util.h"
nm_copy_sd_shared "src/basic/escape.c"
nm_copy_sd_shared "src/basic/escape.h"
nm_copy_sd_shared "src/basic/ether-addr-util.c"
nm_copy_sd_shared "src/basic/ether-addr-util.h"
nm_copy_sd_shared "src/basic/extract-word.c"
nm_copy_sd_shared "src/basic/extract-word.h"
nm_copy_sd_shared "src/basic/fd-util.c"
nm_copy_sd_shared "src/basic/fd-util.h"
nm_copy_sd_shared "src/basic/fileio.c"
nm_copy_sd_shared "src/basic/fileio.h"
nm_copy_sd_shared "src/basic/format-util.c"
nm_copy_sd_shared "src/basic/format-util.h"
nm_copy_sd_shared "src/basic/fs-util.c"
nm_copy_sd_shared "src/basic/fs-util.h"
nm_copy_sd_shared "src/basic/hash-funcs.c"
nm_copy_sd_shared "src/basic/hash-funcs.h"
nm_copy_sd_shared "src/basic/hashmap.c"
nm_copy_sd_shared "src/basic/hashmap.h"
nm_copy_sd_shared "src/basic/hexdecoct.c"
nm_copy_sd_shared "src/basic/hexdecoct.h"
nm_copy_sd_shared "src/basic/hostname-util.c"
nm_copy_sd_shared "src/basic/hostname-util.h"
nm_copy_sd_shared "src/basic/in-addr-util.c"
nm_copy_sd_shared "src/basic/in-addr-util.h"
nm_copy_sd_shared "src/basic/io-util.c"
nm_copy_sd_shared "src/basic/io-util.h"
nm_copy_sd_shared "src/basic/list.h"
nm_copy_sd_shared "src/basic/log.h"
nm_copy_sd_shared "src/basic/macro.h"
nm_copy_sd_shared "src/basic/memory-util.c"
nm_copy_sd_shared "src/basic/memory-util.h"
nm_copy_sd_shared "src/basic/mempool.c"
nm_copy_sd_shared "src/basic/mempool.h"
nm_copy_sd_shared "src/basic/missing_fcntl.h"
nm_copy_sd_shared "src/basic/missing_random.h"
nm_copy_sd_shared "src/basic/missing_socket.h"
nm_copy_sd_shared "src/basic/missing_stat.h"
nm_copy_sd_shared "src/basic/missing_syscall.h"
nm_copy_sd_shared "src/basic/missing_type.h"
nm_copy_sd_shared "src/basic/parse-util.c"
nm_copy_sd_shared "src/basic/parse-util.h"
nm_copy_sd_shared "src/basic/path-util.c"
nm_copy_sd_shared "src/basic/path-util.h"
nm_copy_sd_shared "src/basic/prioq.c"
nm_copy_sd_shared "src/basic/prioq.h"
nm_copy_sd_shared "src/basic/process-util.c"
nm_copy_sd_shared "src/basic/process-util.h"
nm_copy_sd_shared "src/basic/random-util.c"
nm_copy_sd_shared "src/basic/random-util.h"
nm_copy_sd_shared "src/basic/set.h"
nm_copy_sd_shared "src/basic/signal-util.c"
nm_copy_sd_shared "src/basic/signal-util.h"
nm_copy_sd_shared "src/basic/siphash24.h"
nm_copy_sd_shared "src/basic/socket-util.c"
nm_copy_sd_shared "src/basic/socket-util.h"
nm_copy_sd_shared "src/basic/sort-util.h"
nm_copy_sd_shared "src/basic/sparse-endian.h"
nm_copy_sd_shared "src/basic/stat-util.c"
nm_copy_sd_shared "src/basic/stat-util.h"
nm_copy_sd_shared "src/basic/stdio-util.h"
nm_copy_sd_shared "src/basic/string-table.c"
nm_copy_sd_shared "src/basic/string-table.h"
nm_copy_sd_shared "src/basic/string-util.c"
nm_copy_sd_shared "src/basic/string-util.h"
nm_copy_sd_shared "src/basic/strv.c"
nm_copy_sd_shared "src/basic/strv.h"
nm_copy_sd_shared "src/basic/strxcpyx.c"
nm_copy_sd_shared "src/basic/strxcpyx.h"
nm_copy_sd_shared "src/basic/time-util.c"
nm_copy_sd_shared "src/basic/time-util.h"
nm_copy_sd_shared "src/basic/tmpfile-util.c"
nm_copy_sd_shared "src/basic/tmpfile-util.h"
nm_copy_sd_shared "src/basic/umask-util.h"
nm_copy_sd_shared "src/basic/user-util.h"
nm_copy_sd_shared "src/basic/utf8.c"
nm_copy_sd_shared "src/basic/utf8.h"
nm_copy_sd_shared "src/basic/util.c"
nm_copy_sd_shared "src/basic/util.h"
nm_copy_sd_shared "src/shared/dns-domain.c"
nm_copy_sd_shared "src/shared/dns-domain.h"
nm_copy_sd_stdaux "src/basic/unaligned.h"
2020-03-23 16:39:32 +01:00
Thomas Haller
44fed3c340 core: avoid assertion failure in _settings_connection_flags_changed() without device
It seems not unexpected, that we get a flags-changed notification while
having no device. Handle it gracefully and avoid the assertion failure.

   #0  _g_log_abort (breakpoint=breakpoint@entry=1) at gmessages.c:583
   #1  g_logv (log_domain=0x55f3c86f0262 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7ffcbf88f1c0) at gmessages.c:1391
   #2  g_log (log_domain=log_domain@entry=0x55f3c86f0262 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f21e99adb27 "%s: assertion '%s' failed") at gmessages.c:1432
   #3  g_return_if_fail_warning (log_domain=log_domain@entry=0x55f3c86f0262 "NetworkManager", pretty_function=pretty_function@entry=0x55f3c875f290 <__func__.53083> "nm_device_reapply", expression=expression@entry=0x55f3c8752507 "NM_IS_DEVICE (self)") at gmessages.c:2809
   #4  nm_device_reapply (self=0x0, connection=connection@entry=0x55f3caab4e60, error=error@entry=0x7ffcbf88f308) at src/devices/nm-device.c:12107
   #5  _settings_connection_flags_changed (settings_connection=<optimized out>, self=0x55f3caabca70 [NMActRequest]) at src/nm-active-connection.c:960
   #9  <emit signal ??? on instance 0x55f3caaaf530 [NMSettingsConnection]> (instance=instance@entry=0x55f3caaaf530, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
   #6  g_closure_invoke (closure=0x55f3caa4c160, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7ffcbf88f520, invocation_hint=invocation_hint@entry=0x7ffcbf88f4c0) at gclosure.c:804
   #7  signal_emit_unlocked_R (node=node@entry=0x55f3ca9dcf90, detail=detail@entry=0, instance=instance@entry=0x55f3caaaf530, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffcbf88f520) at gsignal.c:3635
   #8  g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffcbf88f6a0) at gsignal.c:3391
   #10 nm_settings_connection_set_flags_full (self=self@entry=0x55f3caaaf530 [NMSettingsConnection], mask=<optimized out>, value=<optimized out>) at src/settings/nm-settings-connection.c:2025
   #11 _connection_changed_process_all_dirty (update_reason=(NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_SYSTEM_SECRETS | NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_AGENT_SECRETS), sett_mask=<optimized out>, sett_flags=<optimized out>, connection=0x55f3caab4f80, sett_conn_entry=<optimized out>, self=0x55f3ca99c000 [NMSettings]) at src/settings/nm-settings.c:1099
   #12 _connection_changed_process_all_dirty (update_reason=(NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_SYSTEM_SECRETS | NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_AGENT_SECRETS), override_sett_flags=1, sett_mask=_NM_SETTINGS_CONNECTION_INT_FLAGS_PERSISTENT_MASK, sett_flags=<optimized out>, allow_add_to_no_auto_default=0, sett_conn_entry=<optimized out>, self=0x55f3ca99c000 [NMSettings]) at src/settings/nm-settings.c:1284
   #13 _connection_changed_process_all_dirty (self=self@entry=0x55f3ca99c000 [NMSettings], allow_add_to_no_auto_default=allow_add_to_no_auto_default@entry=0, sett_flags=sett_flags@entry=NM_SETTINGS_CONNECTION_INT_FLAGS_NONE, sett_mask=sett_mask@entry=NM_SETTINGS_CONNECTION_INT_FLAGS_NONE, override_sett_flags=override_sett_flags@entry=1, update_reason=update_reason@entry=(NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_SYSTEM_SECRETS | NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_AGENT_SECRETS)) at src/settings/nm-settings.c:1304
   #14 _plugin_connections_reload (self=self@entry=0x55f3ca99c000 [NMSettings]) at src/settings/nm-settings.c:1417
   #15 impl_settings_reload_connections (obj=0x55f3ca99c000 [NMSettings], interface_info=<optimized out>, method_info=<optimized out>, connection=<optimized out>, sender=<optimized out>, invocation=0x7f21d000c100 [GDBusMethodInvocation], parameters=0x55f3ca9e1f20) at src/settings/nm-settings.c:2822
   ...

https://bugzilla.redhat.com/show_bug.cgi?id=1816067
2020-03-23 13:31:09 +01:00
Thomas Haller
27c0d9d8b7 clients/tests: comment return code by signal in test output
Otherwise, we just see "returncode: -11", which isn't very clear.
By default, our test nmcli invocations should never exit by a signal.
Usually, when we encounter a signal, it indicates to a bug and a crash
during the test.

Print more information about the exit code.

    returncode: -11 (SIGNAL SIGSEGV)
2020-03-23 13:30:13 +01:00
Beniamino Galvani
c5365ca482 cli: merge branch 'bg/cli-remove-setting'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/440
2020-03-23 11:43:03 +01:00
Beniamino Galvani
2334a27692 cli: support setting removal 2020-03-23 11:42:57 +01:00
Beniamino Galvani
0d0c79d5ab libnm-core: slightly improve sriov setting documentation 2020-03-23 11:42:57 +01:00
Beniamino Galvani
78f1977ecd libnm-core: remove trailing dot from setting description
The trailing dot is already added when generating the man page.
2020-03-23 11:42:57 +01:00
Thomas Haller
52dbab7d07 all: use nm_clear_pointer() instead of g_clear_pointer()
g_clear_pointer() would always cast the destroy notify function
pointer to GDestroyNotify. That means, it lost some type safety, like

   GPtrArray *ptr_arr = ...

   g_clear_pointer (&ptr_arr, g_array_unref);

Since glib 2.58 ([1]), g_clear_pointer() is also more type safe. But
this is not used by NetworkManager, because we don't set
GLIB_VERSION_MIN_REQUIRED to 2.58.

[1] f9a9902aac

We have nm_clear_pointer() to avoid this issue for a long time (pre
1.12.0). Possibly we should redefine in our source tree g_clear_pointer()
as nm_clear_pointer(). However, I don't like to patch glib functions
with our own variant. Arguably, we do patch g_clear_error() in
such a manner. But there the point is to make the function inlinable.

Also, nm_clear_pointer() returns a boolean that indicates whether
anything was cleared. That is sometimes useful. I think we should
just consistently use nm_clear_pointer() instead, which does always
the preferable thing.

Replace:

   sed 's/\<g_clear_pointer *(\([^;]*\), *\([a-z_A-Z0-9]\+\) *)/nm_clear_pointer (\1, \2)/g' $(git grep -l g_clear_pointer) -i
2020-03-23 11:22:38 +01:00
Thomas Haller
073994ca42 all: use nm_clear_g_free() instead of g_clear_pointer()
I think it's preferable to use nm_clear_g_free() instead of
g_clear_pointer(, g_free). The reasons are not very strong,
but I think it is overall preferable to have a shorthand for this
frequently used functionality.

   sed 's/\<g_clear_pointer *(\([^;]*\), *\(g_free\) *)/nm_clear_g_free (\1)/g' $(git grep -l g_clear_pointer) -i
2020-03-23 11:05:34 +01:00
Thomas Haller
c50b4621d4 libnm: merge branch 'th/libnm-dbus-async-calls'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/439
2020-03-23 09:47:17 +01:00