Commit Graph

24409 Commits

Author SHA1 Message Date
Beniamino Galvani
a59a8aa033 build: meson: fix dependency to gdbus generated headers
libnm has a dependency on 'libnmdbus_dep', which contains 'link_with:
libnmdbus'. This however only enforces that libnm is linked after the
libnmdbus static library is built; it doesn't give any guarantees
about the compilation phase.

We need to make libnm compilation depend on the generated header
files. The output of 'gnome.gdbus_codegen' is an array with the header
file in the second position; use it to add a proper
dependency. Unfortunately this works only with meson >= 0.46.

In the future libnm will no longer use gdbus generated code and this
dependency will not be needed anymore.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/286
2019-11-20 10:21:22 +01:00
Thomas Haller
c016165e1b systemd: merge branch systemd into master 2019-11-20 09:22:53 +01:00
Beniamino Galvani
eeb1ce8566 bluetooth: build test program only when tests are enabled
The manual test should only be built when tests are enabled since it
links to the test library.

Fixes: 05c7a77022 ('meson: Add missing "nm-bt-test" helper program')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/287
2019-11-19 17:00:22 +01:00
Thomas Haller
5d020e1c92 systemd: update code from upstream (2019-11-19)
This is a direct dump from systemd git.

======

SYSTEMD_DIR=../systemd
COMMIT=25f9288e31a586460c13d49edea9edafdca2a972

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

git ls-files -z :/src/systemd/src/ \
                :/shared/systemd/src/ \
                :/shared/nm-utils/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_nmutils() {
    mkdir -p "./shared/nm-utils/"
    cp "$SYSTEMD_DIR/$1" "./shared/nm-utils/${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_nmutils "src/basic/unaligned.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/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_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.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/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"
2019-11-19 16:51:51 +01:00
Thomas Haller
c68c199eda libnm: fix annotation for out arguments of nm_bridge_vlan_get_vid_range()
Workaround:

def br_get_vid_range(bridge_vlan):
    try:
        (is_range, vid_start, vid_end) = bridge_vlan.get_vid_range()
    except TypeError as e:
        s = bridge_vlan.to_str()
        s = s.split(' ', 1)
        s = s[0]
        s = s.split('-', 2)
        vid_start = int(s[0])
        if len(s) == 2:
            vid_end = int(s[1])
        else:
            vid_end = vid_start
        is_range = (vid_start == vid_end)
    return (vid_start, vid_end)

Fixes: da204257b1 ('all: support bridge vlan ranges')
2019-11-19 16:12:59 +01:00
Lubomir Rintel
a65982c5ad merge: branch 'lr/initrd-fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/333
2019-11-18 13:41:14 +01:00
Lubomir Rintel
cdfa3d3428 initrd/tests: put the bootif=no next to the other bootif tests
A cosmetical improvement.
2019-11-18 13:40:48 +01:00
Lubomir Rintel
45548bc670 dracut/cmdline: don't combine BOOTIF with on with a name or a MAC address
This fixes the dracut test suite.
2019-11-18 13:40:48 +01:00
Lubomir Rintel
62919bab43 utils: make nm_utils_hwaddr_matches() accept NULL
This essentially aligns the implementation with the documentation.

It is also rather useful, since it allows us to use the value returned
by nm_setting_wired_get_mac_address() directly, and that one can indeed
be NULL.
2019-11-18 13:40:48 +01:00
Lubomir Rintel
e1a068e93c initrd/cmdline: split add_conn() from get_conn()
No change in behavior. Will be useful when we'll want to unconditionally
add new connection without the matching behavior.
2019-11-18 13:40:48 +01:00
Lubomir Rintel
30f8154319 initrd: don't overwrite just any connection's name with bootdev= argument
It is really not clear what the user could have meant by specifying a
bootdev= argument, and we deal with it just by ensuring a device with
that name whould come up.

We therefore pick a default connection if there's one (that is a
conneciton that we create if the device name is unspecified, as in
"ip=auto"), otherwise we create a new one.
2019-11-18 13:40:48 +01:00
Lubomir Rintel
f581756af6 initrd: default bridge name to br0 as opposed to bridge0
For compatibility. The dracut.cmdline(7) manual says:

  Bridge without parameters assumes bridge=br0:eth0
2019-11-18 13:40:48 +01:00
Lubomir Rintel
7a84388a9b manager: assume DHCP if we see a lease on taking over an initramfs connection
In general, we aren't really able to tell, but when we see a lease file
we're pretty sure that DHCP is what was going on.

https://bugzilla.redhat.com/show_bug.cgi?id=1771792
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/335

Fixes: f2fe6c03ee ('manager: don't treat the initramfs-configured DHCP connections as generated')
2019-11-18 13:35:23 +01:00
Lubomir Rintel
8a35b7ed86 merge; branch 'lr/nettools-siaddr'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/334
2019-11-18 13:34:38 +01:00
Lubomir Rintel
c1104a5cc2 dhcp/nettools: add siaddr to lease options
This is so that we end up with a next-server option analogous to what
dhclient helper sends us. Dracut uses this for networked boots.
2019-11-18 13:34:09 +01:00
Lubomir Rintel
edda3d3606 n-dhcp4/lease: expose the server IP address
This is useful for network booting.

https://github.com/nettools/n-dhcp4/pull/7
2019-11-18 13:34:09 +01:00
Lubomir Rintel
e475ac7567 systemd: add siaddr to lease options
This is so that we end up with a next-server option analogous to what
dhclient helper sends us. Dracut uses this for networked boots.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/329
2019-11-18 13:33:03 +01:00
Frank Deng
87c9583282 utils: alow matching ipv6 new method 'disable'
Make nm_utils_match_connection() match 'ignore' connections with
connections that are generated to have ipv6.method of 'disable'.
Perhaps the ipv6 was disabled globally.

[lkundrak@v3.sk: commit message fixup]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/336
2019-11-18 11:07:18 +01:00
Beniamino Galvani
3165fd8e8e merge: branch 'bg/dhcp-iaid-rh1749358'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/315
https://bugzilla.redhat.com/show_bug.cgi?id=1749358
2019-11-11 14:18:05 +01:00
Beniamino Galvani
37a10e9ba4 all: support 'stable' DHCP IAID
Support a new DHCP IAID special value 'stable' that generates the IAID
based on the stable-id, a per-host key and the interface name.
2019-11-11 10:33:31 +01:00
Beniamino Galvani
6f16e524be core: support ipvX.dhcp-iaid properties 2019-11-11 10:31:36 +01:00
Beniamino Galvani
56a1a5426a all: add ipvX.dhcp-iaid properties
Add new ipv4.dhcp-iaid and ipv6.dhcp-iaid properties to specify a DHCP
IAID.
2019-11-11 10:31:33 +01:00
Beniamino Galvani
6ff333e242 device: assert that _get_stable_id() never fails
It would be a bug if _get_stable_id() fails to return a value. Add an
assertion and remove checks from callers.
2019-11-11 10:30:08 +01:00
Yuri Chornoivan
b1a997d6c5 po: update Ukrainian (uk) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/332
2019-11-11 09:29:23 +01:00
Thomas Haller
649be3ae7d libnm/tests: explicilty check behavior of _nm_utils_ascii_str_to_int64() with leading zeros 2019-11-08 08:17:58 +01:00
Thomas Haller
b4e62ca73b libnm: merge branch 'th/libnm-no-dbus-codegen-3'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/324
2019-11-07 13:23:01 +01:00
Thomas Haller
e96bc190d6 clients/tests: read stdout/stderr buffers during test-clients.py
We need to actually read the stdout/stderr of the nmcli programs.
Otherwise, the pipe might fill uup and block to process (eventually
leading to timeout).
2019-11-07 11:34:36 +01:00
Thomas Haller
cdb95062e7 clients/tests: set NM_TEST_CALLING_NUM environement variable for client tests
Debugging tests that are called by test-client.py is cumbersome.
One way would be to set NM_TEST_CLIENT_NMCLI_PATH to a wrapper script.
However, then we want to know from the wrapper script which test
we are currently calling. Add that to the environment.
2019-11-07 11:34:36 +01:00
Thomas Haller
6a9ed0adfb cli: unsubscribe permission signal from NMClient on exit
During the libnm rework, we might still emit permissions changed
signal while destructing the instance. That triggers an assertion.

Backtrace, with a different libnm:

  #0  _g_log_abort (breakpoint=1) at ../glib/gmessages.c:554
  #1  0x00007ffff77d09b6 in g_logv (log_domain=0x7ffff7f511cd "libnm", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcb80) at ../glib/gmessages.c:1373
  #2  0x00007ffff77d0b83 in g_log
      (log_domain=log_domain@entry=0x7ffff7f511cd "libnm", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff78215df "%s: assertion '%s' failed")
      at ../glib/gmessages.c:1415
  #3  0x00007ffff77d137d in g_return_if_fail_warning
      (log_domain=log_domain@entry=0x7ffff7f511cd "libnm", pretty_function=pretty_function@entry=0x7ffff7f58aa0 <__func__.40223> "nm_client_get_permission_result", expression=expression@entry=0x7ffff7f54830 "NM_IS_CLIENT (client)") at ../glib/gmessages.c:2771
  #4  0x00007ffff7e9de9a in nm_client_get_permission_result (client=0x0, permission=permission@entry=NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK) at libnm/nm-client.c:3816
  #5  0x0000555555593ba3 in got_permissions (nmc=nmc@entry=0x55555562ec20 <nm_cli>) at clients/cli/general.c:587
  #6  0x0000555555593bcb in permission_changed (client=<optimized out>, permission=<optimized out>, result=<optimized out>, nmc=0x55555562ec20 <nm_cli>) at clients/cli/general.c:600
  #7  0x00007ffff73b1aa8 in ffi_call_unix64 () at ../src/x86/unix64.S:76
  #8  0x00007ffff73b12a4 in ffi_call (cif=cif@entry=0x7fffffffced0, fn=fn@entry=0x555555593bbf <permission_changed>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffffffcde0)
      at ../src/x86/ffi64.c:525
  #9  0x00007ffff78b4746 in g_cclosure_marshal_generic_va
      (closure=<optimized out>, return_value=<optimized out>, instance=<optimized out>, args_list=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=<optimized out>) at ../gobject/gclosure.c:1614
  #10 0x00007ffff78b3996 in _g_closure_invoke_va (closure=0x5555556f4330, return_value=0x0, instance=0x55555565a020, args=0x7fffffffd180, n_params=2, param_types=0x555555656f00)
      at ../gobject/gclosure.c:873
  #11 0x00007ffff78d0228 in g_signal_emit_valist (instance=0x55555565a020, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd180) at ../gobject/gsignal.c:3306
  #12 0x00007ffff78d09d3 in g_signal_emit (instance=instance@entry=0x55555565a020, signal_id=<optimized out>, detail=detail@entry=0) at ../gobject/gsignal.c:3453
  #13 0x00007ffff7e8989a in _emit_permissions_changed (self=self@entry=0x55555565a020, permissions=permissions@entry=0x555555690e40 = {...}, force_unknown=force_unknown@entry=1)
      at libnm/nm-client.c:2874
  #14 0x00007ffff7e9a0c9 in _init_release_all (self=self@entry=0x55555565a020) at libnm/nm-client.c:6092
  #15 0x00007ffff7e9bcde in dispose (object=0x55555565a020 [NMClient]) at libnm/nm-client.c:6838
  #16 0x00007ffff78b8c28 in g_object_unref (_object=<optimized out>) at ../gobject/gobject.c:3344
  #17 g_object_unref (_object=0x55555565a020) at ../gobject/gobject.c:3274
  #18 0x00005555555badcf in nmc_cleanup (nmc=0x55555562ec20 <nm_cli>) at clients/cli/nmcli.c:924
  #19 0x00005555555bbea7 in main (argc=<optimized out>, argv=0x7fffffffd498) at clients/cli/nmcli.c:987
2019-11-07 11:34:36 +01:00
Thomas Haller
44a56fca60 libnm/tests: fix stub implementation for remote-next-connection
We cannot first remove the connection (and emit property changed signals),
before replying with the newly added path (that already no longer exists).
Fix the stub implementation.
2019-11-07 11:34:36 +01:00
Thomas Haller
6bf206eb81 libnm/tests: drop test_activate_failed() test
With this test the stub service simulates a failure to add-and-activate
the connection.

However the implementation of the stub service was not simulating the
real behavior of NetworkManager service. libnm will add the possibility
to assert against invalid server behavior by setting LIBNM_CLIENT_DEBUG=error.
With that change, libnm will complain that the stub service behaves
invalid, and rightly so.

Instead of fixing the test, just drop it.
2019-11-07 11:34:36 +01:00
Thomas Haller
feea4222ef libnm/tests: unsubscribe signal handler during test_activate_virtual()
libnm is gonna change, where it would still emit signals when the
instance gets destructed. In particular, when the device gets removed
from the NMClient cache, the references to other objects would be
cleared (and consequently property changed signals emitted).

This will cause a test failure, because the signal was not unsubscribed:

    test:ERROR:libnm/tests/test-nm-client.c:694:device_ac_changed_cb: assertion failed: (nm_device_get_active_connection (NM_DEVICE (device)) != NULL)
2019-11-07 11:34:36 +01:00
Thomas Haller
f21b8781ed tests: use nmtstc_client_new() to create NMClient instance and cleanup tests
The advantage of nmtstc_client_new() is that it randomly either uses the
synchronous or asynchronous constructor. Of course, both should behave
pretty much the same. Hence, this increases our test coverage.
2019-11-07 11:34:36 +01:00
Thomas Haller
8def37dd65 tests: add nmtstc_client_new() helper 2019-11-07 11:34:36 +01:00
Thomas Haller
ec39498fc6 tests: support D-Bus property Device.StateReason in mock service
The device interface (org.freedesktop.NetworkManager.Device) has
two properties: "State" and "StateReason". Both of them are supported by
NetworkManager for a very long time.

Note that "StateReason" is a tuple and also exposes the state along the
reason.

When reworking libnm, we will ignore the "State" property and only
consider "StateReason". The advantage is less code and not using
redundant state. This will also work well, because NetworkManager's
D-Bus API supports this property for a very long time.

However, that would then break the CI tests, because currently
"tools/test-networkmanager-service.py" does not expose that property.

Add it.
2019-11-07 11:34:36 +01:00
Thomas Haller
abb68d90fc libnm: retire nm_client_wimax_*() functions
The server doesn's support WiMAX anymore. Hence there is no point in keeping
this functionality. While we cannot drop the functions, let them not do anything.

The code in NMManager is still there. But since we will soon drop
NMManager entirely, it doesn't matter.
2019-11-07 11:34:36 +01:00
Thomas Haller
2e91add7e4 libnm: move nm_permission_to_client()/nm_permission_result_to_client() to nm-libnm-utils.c
It's nicely trivial and independent. Move it to a separate place,
to avoid cluttering the more complicated code and to make it testable.

Also, use binary search to find the value by string.
2019-11-07 11:34:36 +01:00
Thomas Haller
83d7599acc libnm: deprecate nm_device_set_managed() and nm_device_set_autoconnect() API
These setters not only invoke a synchronous D-Bus call (ignoring the
return value). They also modify the content of the cache client-side,
bypassing the information that we receive via notifications from the
server.

Also, they don't emit property changed signals, but in any case they
are broken beyond repair.

Fully mark them as deprecated. Note that they were already marked as
_NM_DEPRECATED_SYNC_METHOD. However, that does not actually mark
the API as deprecated, because fully deprecating all synchronous
methods is premature at this point.
2019-11-07 11:34:36 +01:00
Thomas Haller
9c01d6ca67 libnm: print timestamp in LIBNM_CLIENT_DEBUG debug logging
It's useful, because it's easy to get overwhelemed by the logging output.
The timestamp makes it easier to keep track. Also, it allows to see how long
things take.
2019-11-07 11:34:36 +01:00
Thomas Haller
1463450393 all: use nm_dbus_path_not_empty() 2019-11-07 11:34:36 +01:00
Thomas Haller
88ef02ec33 shared/tests: add nmtst_main_context_iterate_until() helper 2019-11-07 11:34:36 +01:00
Thomas Haller
afa54fdfd5 shared: add nm_g_main_context_push_thread_default*() and nm_auto helper 2019-11-07 11:34:36 +01:00
Thomas Haller
3b95905ae3 shared: add nm_auto_destroy_and_unref_gsource macro 2019-11-07 11:34:36 +01:00
Thomas Haller
01335ecec6 shared: assert in nm_ref_string_unref() for valid NMRefString instance 2019-11-07 11:34:36 +01:00
Thomas Haller
15fe8ad851 shared: add nm_dbus_path_not_empty() helper 2019-11-07 11:34:36 +01:00
Thomas Haller
9b2d5742c1 shared: add nm_g_set_error_take*() util 2019-11-07 11:34:36 +01:00
Thomas Haller
d21439eaa0 shared: add nm_ppdirect_hash()/nm_ppdirect_equal() helpers
Useful for hashing pointers to a pointer to a pointer, and
compare the resulting pointer directly. This will be actually
used.
2019-11-07 11:34:36 +01:00
Thomas Haller
86352ceaf8 shared: add NM_STRUCT_OFFSET_ENSURE_TYPE() helper 2019-11-07 11:34:36 +01:00
Thomas Haller
4a870c57f5 nmcli/tests: fix broken test after "nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>'"
Fixes: 303fc17450 ('nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>'')
2019-11-07 09:36:11 +01:00
Antonio Cardace
303fc17450 nmcli: show IP interface name when doing 'nmcli connection show <PROFILE>'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/218

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/322
2019-11-06 21:08:23 +01:00