1. 09 Jan, 2018 7 commits
    • Thomas Haller's avatar
      libnm: rename MDns flag UNKNOWN to DEFAULT · 9d92848a
      Thomas Haller authored
      "UNKNOWN" is not a good name. If you don't set the property
      in the connection explicitly, it should be "DEFAULT".
      
      Also, make "DEFAULT" -1. For one, that ensures that the enum's
      underlying integer type is signed. Otherwise, it's cumbersome
      to test "if (mdns >= DEFAULT)" because in case of unsigned types,
      the compiler will warn about the check always being true.
      Also, it allows for "NO" to be zero. These are no strong reasons,
      but I tend to think this is better.
      
      Also, don't make the property of NMSettingConnection a CONSTRUCT property.
      Initialize the default manually in the init function.
      
      Also, order the numeric values so that DEFAULT < NO < RESOLVE < YES with
      YES being largest because it enables *the most*.
      9d92848a
    • Thomas Haller's avatar
      libnm: verify value for connection.mdns · eec907b3
      Thomas Haller authored
      Also, keep the internal variable of type int. The only way to set the
      field is via the GObject property setter. At that point, don't yet
      cast the integer type to enum.
      eec907b3
    • Ismo Puustinen's avatar
      dns: add mechanism for propagating mDNS setting. · 25906eda
      Ismo Puustinen authored
      Update nm-policy.c and nm-dns-manager.c so that the connection-specific
      settings get propagated to DNS manger. Currently the only such value is
      the mDNS status.
      
      Add update_mdns() function to DNS plugin interface. If a DNS plugin
      supports mDNS, it can set an interface with a given index to support
      mDNS resolving or also register the current hostname.
      
      The mDNS support is currently added only to systemd-resolved DNS plugin.
      25906eda
    • Ismo Puustinen's avatar
      mdns: add new connection property. · 2e2ff6f2
      Ismo Puustinen authored
      Add support for mDNS as a connection-level property. Update ifcfg-rh and
      keyfile plugins to support it.
      2e2ff6f2
    • Thomas Haller's avatar
      build: first build dns-manager and dns-plugin before the plugins · 6dd69990
      Thomas Haller authored
      When doing changes that affect multiple source files, it's more
      convenient to build the parts that have less dependencies first.
      So, to fix the build failures from the core outward.
      6dd69990
    • Thomas Haller's avatar
      core: reorder code in "src/dns/nm-dns-manager.c" · 3d86429c
      Thomas Haller authored
      Just moving code around, no other changes.
      
      Follow a certain prefered order of declarations
      in source files.
      3d86429c
    • Inigo Martínez's avatar
      ifcfg: test for sysconfig network path also on meson · 08a91094
      Inigo Martínez authored
      In a recent commit 1402fa74 a new
      way for testing Red Hat compatible distributions had been added.
      
      However, this new approach does not use a set of files, it uses a
      directory, so this test can be done by using the `test` command
      and makes the `check_distro.py` script unnecessary.
      
      https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00031.html
      08a91094
  2. 08 Jan, 2018 12 commits
    • Lubomir Rintel's avatar
      platform-linux: reload qdiscs and tfilters after removing them · f3b4053a
      Lubomir Rintel authored
      Kernel (as of 4.14) merely ACKs our RTM_DELQDISC and RTM_DELTFILTER, not
      bothering to signal the full RTM_DEL* message unless the removal is
      external to NetworkManager.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1527197
      f3b4053a
    • Thomas Haller's avatar
    • Francesco Giudici's avatar
      platform/tests: relax checking for signals in test-address-linux · f9b9c597
      Francesco Giudici authored
        # Start of ipv6 tests
        ../tools/run-nm-test.sh: line 193: 32194 Trace/breakpoint trap   (core dumped) "${NMTST_DBUS_RUN_SESSION[@]}" "$TEST" "$@"
        # NetworkManager-FATAL-ERROR: NMPlatformSignalAssert: ../src/platform/tests/test-address.c:153, test_ip6_address_general(): failure to accept signal [0,1] times: 'ip6-address-changed-changed' ifindex 11 (2 times received)
      f9b9c597
    • Thomas Haller's avatar
      libnm: drop libnm-util/nm-setting-template.[hc] · 29e566cc
      Thomas Haller authored
      These files are a template how to add a new nm-setting-* implementation.
      
      We are not going to add new files to the deprecated libnm-util library,
      hence a template for libnm-util is pointless.
      
      libnm-core doesn't have a corresponding template file. Personally, I
      don't think such a template are a great idea either, because
      
        - People are not aware that it exists. Hence, it's unused, badly
          maintained and quite possibly does not follow current best practice.
        - Just copy an actual settings implementation and start from there.
          That seems better to me than having a template.
      29e566cc
    • Inigo Martínez's avatar
      build/meson: don't include libnm when building src/systemd · 876de69e
      Inigo Martínez authored
      "src/" must not include "libnm/". This also causes a build failure,
      because it would include "libnm/nm-types.h", instead of "src/nm-types.h".
      
      https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00032.html
      
      [thaller@redhat.com: original patch modified and commit message changed]
      876de69e
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      clients: drop redundant #include "NetworkManager.h" · 52baa8c5
      Thomas Haller authored
      This header is already included by "nm-default.h".
      52baa8c5
    • Thomas Haller's avatar
      tests: use NMTST_EXPECT*() macros · 25ade397
      Thomas Haller authored
      Tests are commonly created via copy&paste. Hence, it's
      better to express a certain concept explicitly via a function
      or macro. This way, the implementation of the concept can be
      adjusted at one place, without requiring to change all the callers.
      
      Also, the macro is shorter, and brevity is better for tests
      so it's easier to understand what the test does. Without being
      bothered by noise from the redundant information.
      
      Also, the macro knows better which message to expect. For example,
      messages inside "src" are prepended by nm-logging.c with a level
      and a timestamp. The expect macro is aware of that and tests for it
      
        #define NMTST_EXPECT_NM_ERROR(msg)      NMTST_EXPECT_NM (G_LOG_LEVEL_MESSAGE, "*<error> [*] "msg)
      
      This again allows the caller to ignore this prefix, but still assert
      more strictly.
      25ade397
    • Thomas Haller's avatar
      tests: add NMTST_EXPECT*() macros · 66b80bd6
      Thomas Haller authored
      Will be used next...
      66b80bd6
    • Thomas Haller's avatar
      build: refine the NETWORKMANAGER_COMPILATION define · 22ef6a50
      Thomas Haller authored
      Note that:
      
       - we compile some source files multiple times. Most notably those
         under "shared/".
      
       - we include a default header "shared/nm-default.h" in every source
         file. This header is supposed to setup a common environment by defining
         and including parts that are commonly used. As we always include the
         same header, the header must behave differently depending
         one whether the compilation is for libnm-core, NetworkManager or
         libnm-glib. E.g. it must include <glib/gi18n.h> or <glib/gi18n-lib.h>
         depending on whether we compile a library or an application.
      
      For that, the source files need the NETWORKMANAGER_COMPILATION #define
      to behave accordingly.
      
      Extend the define to be composed of flags. These flags are all named
      NM_NETWORKMANAGER_COMPILATION_WITH_*, they indicate which part of the
      build are available. E.g. when building libnm-core.la itself, then
      WITH_LIBNM_CORE, WITH_LIBNM_CORE_INTERNAL, and WITH_LIBNM_CORE_PRIVATE
      are available. When building NetworkManager, WITH_LIBNM_CORE_PRIVATE
      is not available but the internal parts are still accessible. When
      building nmcli, only WITH_LIBNM_CORE (the public part) is available.
      This granularily controls the build.
      22ef6a50
    • Thomas Haller's avatar
      config: adjust logging message for duplicate config prefix · 31b6abd4
      Thomas Haller authored
      The logging macros already prepend a "config: " prefix. Don't
      repeat that in the message, otherwise we get
      
          config: config: signal SIGHUP (no changes from disk)
      
      Now:
      
          config: signal: SIGHUP (no changes from disk)
      31b6abd4
    • Lubomir Rintel's avatar
      core: load jansson on demand · cd476e4d
      Lubomir Rintel authored
      Avoid using it if the symbols clash is detected.
      cd476e4d
  3. 05 Jan, 2018 1 commit
    • Beniamino Galvani's avatar
      ip-tunnel: add support for tunnel flags · da4c9e51
      Beniamino Galvani authored
      Implement support for IP tunnel flags. Currently only some IPv6 tunnel
      flags are supported. Example:
      
       # nmcli connection add type ip-tunnel mode ip6ip6 \
         ip-tunnel.flags ip6-ign-encap-limit,ip6-use-orig-tclass \
         ifname abc ip-tunnel.parent ens8 ipv4.method disabled \
         ipv6.method manual ipv6.address ::8888 remote ::42
      
       # ip -d l
        61: abc@ens8: <NOARP,UP,LOWER_UP> mtu 1460 qdisc noqueue ...
          link/tunnel6 :: brd ::42 promiscuity 0
          ip6tnl ip6ip6 remote ::42 local :: dev ens8 encaplimit none
          hoplimit 0 tclass inherit ...
      
      https://bugzilla.gnome.org/show_bug.cgi?id=791846
      da4c9e51
  4. 04 Jan, 2018 2 commits
    • Thomas Haller's avatar
      dhcp: cleanup handling of ipv4.dhcp-client-id and avoid assertion failure · 686afe53
      Thomas Haller authored
      The internal client asserts that the length of the client ID is not more
      than MAX_CLIENT_ID_LEN. Avoid that assert by truncating the string.
      
      Also add new nm_dhcp_client_set_client_id_*() setters, that either
      set the ID based on a string (in our common dhclient specific
      format), or based on the binary data (as obtained from systemd client).
      
      Also, add checks and assertions that the client ID which is
      set via nm_dhcp_client_set_client_id() is always of length
      of at least 2 (as required by rfc2132, section-9.14).
      686afe53
    • Thomas Haller's avatar
      dhcp: track dhcp-client instances with CList instead of hash-table · c19f6359
      Thomas Haller authored
      NMDhcpManager used a hash table to keep track of the dhcp client
      instances. It never actually did a lookup of the client, the only
      place where we search for an existing NMDhcpClient instance is
      get_client_for_ifindex(), which just iterated over all clients.
      
      Use a CList instead.
      
      The only thing that one might consider a downside is that now
      NMDhcpClient is aware of whether it is part of a list. Previously,
      one could theoretically track a NMDhcpClient instance in multiple
      NMDhcpManager instances. But that doesn't make sense, because
      NMDhcpManager is a singleton. Even if we would have mulitple NMDhcpManager
      instances, one client would still only be tracked by one manager.
      This tighter coupling of NMDhcpClient and NMDhcpManager isn't
      a problem.
      c19f6359
  5. 03 Jan, 2018 6 commits
  6. 02 Jan, 2018 6 commits
    • Lubomir Rintel's avatar
      travis: update to Ubuntu 14.04 (trusty) · b936ccd2
      Lubomir Rintel authored
      It is slightly less obsolete. We don't really support precise (12.04)
      anyway, the build only works because we steal libndp and perhaps more
      from the trusty repository.
      b936ccd2
    • Lubomir Rintel's avatar
      travis: use apt addon to install packages · 95747d2c
      Lubomir Rintel authored
      Looks better. Also, this would be the only way to install deps if we ever
      switch to a non-privileged run (if we manage to rid of "sudo dbus-uuidgen").
      95747d2c
    • Inigo Martínez's avatar
      build: Workaround for gtkdoc dependencies · ad12837b
      Inigo Martínez authored
      gtkdoc uses some custom generated targets as content files. However,
      there are still two problem. The first is that gtkdoc does not
      support targets which are not strings. This is being fixed in the
      following issue:
      
      https://github.com/mesonbuild/meson/pull/2806
      
      The second issue is that the gtkdoc function produces a target which
      is triggered at install time. This makes the dependencies generation
      to not be triggered.
      
      This patch uses a workaround for that second issue.
      
      https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00079.html
      ad12837b
    • Inigo Martínez's avatar
      build: Remove default install directories · 03ba0f1b
      Inigo Martínez authored
      The install directories of those targets that match the default
      install directories have been removed because they are redundant.
      
      This also allows a simple meson build files and it is unnecessary
      to create some paths.
      
      https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00078.html
      03ba0f1b
    • Thomas Haller's avatar
      systemd: merge branch systemd into master · e965b767
      Thomas Haller authored
      Reimport systemd because it uses STRLEN() macro.
      We need to when building with -Wvla warning enabled.
      
      Related: https://github.com/systemd/systemd/pull/7625
      e965b767
    • Thomas Haller's avatar
      systemd: update code from upstream (2018-01-01) · c721d51d
      Thomas Haller authored
      This is a direct dump from systemd git on 2017-01-01, git commit
      ad552e587f21bf00013d41d48737009a20be6479.
      
      ======
      
      SYSTEMD_DIR=../systemd
      COMMIT=ad552e587f21bf00013d41d48737009a20be6479
      
      (
        cd "$SYSTEMD_DIR"
        git checkout "$COMMIT"
        git reset --hard
        git clean -fdx
      )
      
      git ls-files :/src/systemd/src/ \
                   :/shared/nm-utils/siphash24.c \
                   :/shared/nm-utils/siphash24.h \
                   :/shared/nm-utils/unaligned.h | \
        xargs -d '\n' rm -f
      
      nm_copy_sd() {
          mkdir -p "./src/systemd/$(dirname "$1")"
          cp "$SYSTEMD_DIR/$1" "./src/systemd/$1"
      }
      
      nm_copy_sd_shared() {
          mkdir -p "./shared/nm-utils/"
          cp "$SYSTEMD_DIR/$1" "./shared/nm-utils/${1##*/}"
      }
      
      nm_copy_sd "src/basic/alloc-util.c"
      nm_copy_sd "src/basic/alloc-util.h"
      nm_copy_sd "src/basic/async.h"
      nm_copy_sd "src/basic/escape.c"
      nm_copy_sd "src/basic/escape.h"
      nm_copy_sd "src/basic/ether-addr-util.c"
      nm_copy_sd "src/basic/ether-addr-util.h"
      nm_copy_sd "src/basic/extract-word.c"
      nm_copy_sd "src/basic/extract-word.h"
      nm_copy_sd "src/basic/fileio.c"
      nm_copy_sd "src/basic/fileio.h"
      nm_copy_sd "src/basic/fd-util.c"
      nm_copy_sd "src/basic/fd-util.h"
      nm_copy_sd "src/basic/fs-util.c"
      nm_copy_sd "src/basic/fs-util.h"
      nm_copy_sd "src/basic/hash-funcs.c"
      nm_copy_sd "src/basic/hash-funcs.h"
      nm_copy_sd "src/basic/hashmap.c"
      nm_copy_sd "src/basic/hashmap.h"
      nm_copy_sd "src/basic/hexdecoct.c"
      nm_copy_sd "src/basic/hexdecoct.h"
      nm_copy_sd "src/basic/hostname-util.c"
      nm_copy_sd "src/basic/hostname-util.h"
      nm_copy_sd "src/basic/in-addr-util.c"
      nm_copy_sd "src/basic/in-addr-util.h"
      nm_copy_sd "src/basic/io-util.c"
      nm_copy_sd "src/basic/io-util.h"
      nm_copy_sd "src/basic/list.h"
      nm_copy_sd "src/basic/log.h"
      nm_copy_sd "src/basic/macro.h"
      nm_copy_sd "src/basic/mempool.h"
      nm_copy_sd "src/basic/mempool.c"
      nm_copy_sd "src/basic/parse-util.c"
      nm_copy_sd "src/basic/parse-util.h"
      nm_copy_sd "src/basic/path-util.c"
      nm_copy_sd "src/basic/path-util.h"
      nm_copy_sd "src/basic/prioq.h"
      nm_copy_sd "src/basic/prioq.c"
      nm_copy_sd "src/basic/process-util.h"
      nm_copy_sd "src/basic/process-util.c"
      nm_copy_sd "src/basic/random-util.c"
      nm_copy_sd "src/basic/random-util.h"
      nm_copy_sd "src/basic/refcnt.h"
      nm_copy_sd "src/basic/set.h"
      nm_copy_sd "src/basic/signal-util.h"
      nm_copy_sd_shared "src/basic/siphash24.c"
      nm_copy_sd_shared "src/basic/siphash24.h"
      nm_copy_sd "src/basic/socket-util.c"
      nm_copy_sd "src/basic/socket-util.h"
      nm_copy_sd "src/basic/sparse-endian.h"
      nm_copy_sd "src/basic/stdio-util.h"
      nm_copy_sd "src/basic/string-table.c"
      nm_copy_sd "src/basic/string-table.h"
      nm_copy_sd "src/basic/string-util.c"
      nm_copy_sd "src/basic/string-util.h"
      nm_copy_sd "src/basic/strv.c"
      nm_copy_sd "src/basic/strv.h"
      nm_copy_sd "src/basic/time-util.c"
      nm_copy_sd "src/basic/time-util.h"
      nm_copy_sd "src/basic/umask-util.h"
      nm_copy_sd_shared "src/basic/unaligned.h"
      nm_copy_sd "src/basic/utf8.c"
      nm_copy_sd "src/basic/utf8.h"
      nm_copy_sd "src/basic/util.c"
      nm_copy_sd "src/basic/util.h"
      nm_copy_sd "src/libsystemd-network/arp-util.c"
      nm_copy_sd "src/libsystemd-network/arp-util.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-network.c"
      nm_copy_sd "src/libsystemd-network/dhcp6-option.c"
      nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h"
      nm_copy_sd "src/libsystemd-network/dhcp-identifier.c"
      nm_copy_sd "src/libsystemd-network/dhcp-identifier.h"
      nm_copy_sd "src/libsystemd-network/dhcp-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp-network.c"
      nm_copy_sd "src/libsystemd-network/dhcp-option.c"
      nm_copy_sd "src/libsystemd-network/dhcp-packet.c"
      nm_copy_sd "src/libsystemd-network/dhcp-protocol.h"
      nm_copy_sd "src/libsystemd-network/lldp-internal.h"
      nm_copy_sd "src/libsystemd-network/lldp-neighbor.c"
      nm_copy_sd "src/libsystemd-network/lldp-neighbor.h"
      nm_copy_sd "src/libsystemd-network/lldp-network.c"
      nm_copy_sd "src/libsystemd-network/lldp-network.h"
      nm_copy_sd "src/libsystemd-network/network-internal.c"
      nm_copy_sd "src/libsystemd-network/network-internal.h"
      nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c"
      nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c"
      nm_copy_sd "src/libsystemd-network/sd-ipv4acd.c"
      nm_copy_sd "src/libsystemd-network/sd-lldp.c"
      nm_copy_sd "src/libsystemd/sd-event/sd-event.c"
      nm_copy_sd "src/libsystemd/sd-id128/id128-util.c"
      nm_copy_sd "src/libsystemd/sd-id128/id128-util.h"
      nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c"
      nm_copy_sd "src/shared/dns-domain.c"
      nm_copy_sd "src/shared/dns-domain.h"
      nm_copy_sd "src/systemd/_sd-common.h"
      nm_copy_sd "src/systemd/sd-dhcp6-client.h"
      nm_copy_sd "src/systemd/sd-dhcp6-lease.h"
      nm_copy_sd "src/systemd/sd-dhcp-client.h"
      nm_copy_sd "src/systemd/sd-dhcp-lease.h"
      nm_copy_sd "src/systemd/sd-event.h"
      nm_copy_sd "src/systemd/sd-ndisc.h"
      nm_copy_sd "src/systemd/sd-id128.h"
      nm_copy_sd "src/systemd/sd-ipv4acd.h"
      nm_copy_sd "src/systemd/sd-ipv4ll.h"
      nm_copy_sd "src/systemd/sd-lldp.h"
      c721d51d
  7. 30 Dec, 2017 1 commit
  8. 27 Dec, 2017 5 commits