1. 09 Oct, 2020 16 commits
  2. 08 Oct, 2020 10 commits
    • Thomas Haller's avatar
      b7da3da7
    • Thomas Haller's avatar
      cli: move string to NMMetaColor conversion to separate function · 7d4f4642
      Thomas Haller authored
      And use NM_UTILS_STRING_TABLE_LOOKUP_DEFINE(), which does a binary search.
      7d4f4642
    • Thomas Haller's avatar
      cli: honor and prefer color schemes with ".scheme" extension · f1830ab0
      Thomas Haller authored
      According to `man terminal-colors.d`, the extension should be ".scheme"
      and not ".schem". Prefer that, but keep honoring ".schem" file, if it
      exists.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1886336
      f1830ab0
    • Thomas Haller's avatar
    • Thomas Haller's avatar
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      shared: add NM_HASH_OBFUSCATE_PTR_STR() helper macro · 5b941666
      Thomas Haller authored
      Contrary to NM_HASH_OBFUSCATE_PTR(), this allows to special case a %NULL
      pointer. Also, it quotes the obfuscated value in square brackets.
      5b941666
    • Thomas Haller's avatar
      systemd: merge branch systemd into master · 621ca03b
      Thomas Haller authored
      621ca03b
    • Thomas Haller's avatar
      systemd: update code from upstream (2020-10-08) · 8258ff91
      Thomas Haller authored
      This is a direct dump from systemd git.
      
      ======
      
      SYSTEMD_DIR=../systemd
      COMMIT=cd2065989163a5b6f71c8f1e4a8d73f1be63a52b
      
      (
        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-dhcp6-option.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_shared "src/shared/web-util.c"
      nm_copy_sd_shared "src/shared/web-util.h"
      nm_copy_sd_stdaux "src/basic/unaligned.h"
      8258ff91
    • Michael Biebl's avatar
  3. 07 Oct, 2020 6 commits
  4. 06 Oct, 2020 8 commits
    • Alfonso Sánchez-Beato's avatar
      platform: use also statvfs() to check for udevd · 9c8275be
      Alfonso Sánchez-Beato authored
      Check whether or not there is a running udevd by using statvfs() on
      "/sys" and use access() as a fallback. This is in line with what is
      done by systemd [1] and helps in case NM is not really running in a
      container but has been confined by a MAC so it does not have full
      access to sysfs (access() returns EACCES).
      
      [1] https://github.com/systemd/systemd/blob/v246/src/basic/stat-util.c#L132
      
      !639
      9c8275be
    • Thomas Haller's avatar
      tests: adjust timeouts for test nm_utils_kill_child() · 441f9b3c
      Thomas Haller authored
      The test spawns processes and tries to kill them, with timeouts and retry.
      That is inherently racy, and it's hard to deterministically test the
      interesting cases, without having unstable tests.
      
      Try to adjust the timeout, to make it more stable:
      
          14:02:27 /builds/NetworkManager/NetworkManager/tools/run-nm-test.sh --called-from-make /builds/NetworkManager/NetworkManager/build    --launch-dbus=auto /builds/NetworkManager/NetworkManager/build/src/tests/test-core-with-expect
          --- stdout ---
          # random seed: R02S7748fae8fc946b7a755b72efb5815250
          1..5
          # Start of general tests
          ok 1 /general/nm_utils_monotonic_timestamp_as_boottime
          # NetworkManager-DEBUG: <debug> [1601992953.4091] kill child process 'test-s-1-3' (18615): sending SIGKILL...
          # NetworkManager-DEBUG: <debug> [1601992953.4242] kill child process 'test-s-1-3' (18615): waiting for process to terminate after sending no signal (0) and SIGKILL...
          # NetworkManager-DEBUG: <debug> [1601992953.4257] kill child process 'test-s-1-3' (18615): after sending no signal (0) and SIGKILL, process 18615 exited by signal 9 (20807 usec elapsed)
          Bail out! GLib:ERROR:../src/tests/test-core-with-expect.c:154:test_nm_utils_kill_child_sync_do: Did not see expected message NetworkManager-DEBUG: *<debug> [*] kill child process 'test-s-1-3' (*): waiting up to 1 milliseconds for process to terminate normally after sending no signal (0)...
          Bail out! test:ERROR:../src/tests/test-core-with-expect.c:457:test_nm_utils_kill_child: assertion failed (exit_status == 0): (6 == 0)
          --- stderr ---
          **
          GLib:ERROR:../src/tests/test-core-with-expect.c:154:test_nm_utils_kill_child_sync_do: Did not see expected message NetworkManager-DEBUG: *<debug> [*] kill child process 'test-s-1-3' (*): waiting up to 1 milliseconds for process to terminate normally after sending no signal (0)...
          **
          test:ERROR:../src/tests/test-core-with-expect.c:457:test_nm_utils_kill_child: assertion failed (exit_status == 0): (6 == 0)
          /builds/NetworkManager/NetworkManager/tools/run-nm-test.sh: line 279: 18325 Aborted                 "${NMTST_DBUS_RUN_SESSION[@]}" "${NMTST_LIBTOOL[@]}" "$NMTST_VALGRIND" --quiet --error-exitcode=$VALGRIND_ERROR --leak-check=full --gen-suppressions=all "${NMTST_SUPPRESSIONS[@]}" --num-callers=100 --log-file="$LOGFILE" "$TEST" "$@"
      441f9b3c
    • Thomas Haller's avatar
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      838c3d67
    • Andrew Zaborowski's avatar
      iwd: Subscribe to object-added/removed ObjectManager signals · 1c1f4a3b
      Andrew Zaborowski authored
      GDBusObjectManagerClient's interface-added and interface-removed signals
      are not emitted when the new interfaces are added to a completely new
      object or the removal results in the object disappearing.  In other
      words one interface is never reported both through interface-added and
      object-added (or -removed) signals.  This kind of makes sense but isn't
      documented explicitly so interface-added seemed to correspond to DBus
      InterfacesAdded signals which it doesn't.
      
      We need to watch for both kinds of signals and although most things
      work without us receiving the signals at all, it causes some race
      conditions.  For example on hotplug, devices wouldn't transition to
      "disconnected" if a device was discovered by NMManager before it
      appeared on IWD's dbus interface because that scenario relied on the
      dbus signal.
      1c1f4a3b
    • Andrew Zaborowski's avatar
      iwd: Disable periodic scanning when connected · c2c68ce1
      Andrew Zaborowski authored
      The automatic scanning every 20 seconds while connected has been
      annoying users because of the extra connection latency, drop it.  The
      UIs are supposed to be requesting scans whenever an AP list update is
      needed (?).
      c2c68ce1
    • Andrew Zaborowski's avatar
      iwd: Disconnect signals in NMDeviceIwd's dispose · d2b0c5af
      Andrew Zaborowski authored
      Fix a crash on device unplugging caused by keeping our signal handlers
      for GDBusProxies connected after a call to dispose().  Do this by
      replacing most cleanup steps by a nm_device_iwd_set_dbus_object(self, NULL)
      call which is more meticulous.
      d2b0c5af