Commit Graph

21088 Commits

Author SHA1 Message Date
Thomas Haller
b0f1a54c9b dns: rework pending request-queue in NMDnsSystemdResolved
We had two separate queues, one for "SetLinkDNS" and one for
"SetLinkDomains". Merge them into one, and track the operation
as part of the new RequestItem structure.

A visible change to before is that we now would make all requests
per-interface first. Prevously, we would first make all SetLinkDNS
requests (for all interfaces) and then all SetLinkDomains requests.
It feels more correct to order the requests this way, not by
type.

The reason to merge is, that we will next get another operation
and in the current scheme we would need 3 GQueue instances.

While at it, refactor the code to use CList. We now anyway would
need a new struct to track the operation, requiring to allocate
and free it. Previously, we would only track the GVariant argument
as data of the GQueue.
2018-01-09 14:24:54 +01:00
Thomas Haller
4be4a3c21f dns: refactor update() in NMDnsSystemdResolved to use a hash table
Use a GHashTable instead of a GArray to construct the list of
@interfaces. Also, use NMCListElem instead of GList. With this,
the runtime is O(n*log(n)) instead of O(n^2).

I belive, we should take care that all our code has a reasonable
runtime complexity, even in common use-cases the number of elements
is small. This is not about performace, because likely we expect few
entries anyway, and the direct GArray implementation is likely faster
in those cases. It's about using the data structure that best suits the
access pattern.

The log(n) part comes from sorting the keys. I also believe we should
always aim for a stable behavior. When sending the D-Bus request to
resolved, the order of elements should be in ~some~ defined order.
2018-01-09 14:24:54 +01:00
Thomas Haller
901aa0315b shared: add nm_cmp_int2ptr_p_with_data() helper
A cmp() implementation, for sorting an array with pointers, where each
pointer is an inteter according to GPOINTER_TO_INT().

That cames for example handy, if you have a GHashTable with keys
GINT_TO_POINTER(). Then you get the list of keys via
g_hash_table_get_keys_as_array() and want to sort them.
2018-01-09 14:24:54 +01:00
Thomas Haller
2aad517b0b shared: add NMCListElem
Sometimes, we want to use CList to track a simple data item. But contrary
to GList/GSList, we need to define a structure to hold the data pointer
and the CList member.

Add a generic NMCListElem type that can be used for such simple uses.

Before you ask: why not use GList/GSList? Because even simple operations
like g_list_append() is O(n), which kinda defeats the purpose of having
a doubly linked list.

This code is added to a new header file nm-c-list.h, the reason is that
there is no other good place:
  - "nm-utils/c-list.h" is a clone of upstream, it should not deviate.
  - "nm-utils/c-list-util.h" contains our utils functions for c-list.h
    but should be plain C, independent of glib.
  - "nm-utils/nm-shared-utils.h" contains our glib related utilities,
    but it should not drag in "c-list.h".
So, "nm-c-list.h" is a utility libray that extends "c-list.h" and
requires glib.
2018-01-09 14:24:53 +01:00
Thomas Haller
4ccfa7a79a core: add nm_ip_config_get_ifindex() helper 2018-01-09 14:24:53 +01:00
Thomas Haller
7d4def2764 dns: merge IPv4 and IPv6 versions of add_ip_config() (part 2) 2018-01-09 14:24:53 +01:00
Thomas Haller
49fd1e4126 dns: merge IPv4 and IPv6 versions of add_ip_config() (part 1) 2018-01-09 14:24:53 +01:00
Thomas Haller
03cba93873 dns/trivial: move code 2018-01-09 14:24:53 +01:00
Thomas Haller
9d92848ada libnm: rename MDns flag UNKNOWN to DEFAULT
"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*.
2018-01-09 14:24:53 +01:00
Thomas Haller
eec907b35a libnm: verify value for connection.mdns
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.
2018-01-09 14:24:53 +01:00
Ismo Puustinen
25906eda9e dns: add mechanism for propagating mDNS setting.
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.
2018-01-09 14:24:53 +01:00
Ismo Puustinen
2e2ff6f27a mdns: add new connection property.
Add support for mDNS as a connection-level property. Update ifcfg-rh and
keyfile plugins to support it.
2018-01-09 14:24:53 +01:00
Thomas Haller
6dd69990c0 build: first build dns-manager and dns-plugin before the plugins
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.
2018-01-09 14:24:53 +01:00
Thomas Haller
3d86429c9d core: reorder code in "src/dns/nm-dns-manager.c"
Just moving code around, no other changes.

Follow a certain prefered order of declarations
in source files.
2018-01-09 14:24:53 +01:00
Iñigo Martínez
08a9109459 ifcfg: test for sysconfig network path also on meson
In a recent commit 1402fa7487 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
2018-01-09 05:58:06 +01:00
Lubomir Rintel
f3b4053a91 platform-linux: reload qdiscs and tfilters after removing them
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
2018-01-08 17:49:41 +01:00
Thomas Haller
fc8d1d6f9f libnm: fix building libnm without WITH_FAKE_TYPELIBS and without gir
Fixes: 4d1f090aed
2018-01-08 16:56:59 +01:00
Francesco Giudici
f9b9c5979e platform/tests: relax checking for signals in test-address-linux
# 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)
2018-01-08 16:48:56 +01:00
Thomas Haller
29e566cc71 libnm: drop libnm-util/nm-setting-template.[hc]
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.
2018-01-08 16:02:07 +01:00
Iñigo Martínez
876de69e08 build/meson: don't include libnm when building src/systemd
"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]
2018-01-08 13:03:53 +01:00
Thomas Haller
95c1579e25 all: merge branch 'th/nm-compilation-type'
https://github.com/NetworkManager/NetworkManager/pull/51
2018-01-08 12:41:45 +01:00
Thomas Haller
52baa8c52b clients: drop redundant #include "NetworkManager.h"
This header is already included by "nm-default.h".
2018-01-08 12:38:54 +01:00
Thomas Haller
25ade39752 tests: use NMTST_EXPECT*() macros
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.
2018-01-08 12:38:54 +01:00
Thomas Haller
66b80bd652 tests: add NMTST_EXPECT*() macros
Will be used next...
2018-01-08 12:38:53 +01:00
Thomas Haller
22ef6a507a build: refine the NETWORKMANAGER_COMPILATION define
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.
2018-01-08 12:38:53 +01:00
Thomas Haller
31b6abd4b5 config: adjust logging message for duplicate config prefix
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)
2018-01-08 12:18:52 +01:00
Lubomir Rintel
cd476e4dc9 core: load jansson on demand
Avoid using it if the symbols clash is detected.
2018-01-08 10:15:29 +01:00
Beniamino Galvani
da4c9e51a0 ip-tunnel: add support for tunnel flags
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
2018-01-05 18:25:08 +01:00
Thomas Haller
686afe531a dhcp: cleanup handling of ipv4.dhcp-client-id and avoid assertion failure
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).
2018-01-04 18:53:05 +01:00
Thomas Haller
c19f635909 dhcp: track dhcp-client instances with CList instead of hash-table
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.
2018-01-04 15:16:38 +01:00
Thomas Haller
81416a8d48 c-list: merge branch 'th/c-list-sort-nonrec'
https://github.com/NetworkManager/NetworkManager/pull/50
2018-01-03 17:04:49 +01:00
Thomas Haller
916f53ac24 shared: implement c_list_sort() as non-recursive merge-sort
This is still the very same approach (in the way the array is split
and how elements are compared). The only difference is that the
recursive implementation is replaced by a non-recursive one.

It's (still) stable, top-down merge-sort.

The non-recursive implementation better, because it avoids the overhead
of the function call to recurse.
2018-01-03 16:41:47 +01:00
Thomas Haller
feeb70ef89 shared: split helper functions out of c_list_sort()
Just to make it clearer what happens.

The compiler can (and possibly will) inline these
static functions just fine.
2018-01-03 16:02:13 +01:00
Thomas Haller
3a73a15863 shared/tests: improve tests for c_list_sort()
Refactor the tests. Especially, test sorting lists with a
length of up to 10000 elements (the actual length is determined
randomly on each run).
2018-01-03 16:02:13 +01:00
Pavel Šimerda
1402fa7487 ifcfg: test for sysconfig network path instead of distribution paths
We don't have a complete list of distributions that use ifcfg for network
configuration but we can easily check for `/etc/sysconfig/network-scripts`
and then distributions can explicitly disable the plugin of that is what
they want.

[thaller@redhat.com: cherry-picked and adjusted for rebase from
  https://github.com/NetworkManager/NetworkManager/pull/49]
2018-01-03 15:24:04 +01:00
Pavel Šimerda
6341b6a5da ifcfg: add a test for Mageia as well
In future we should probably either switch to `/etc/os-release` or just
check for `/etc/sysconfig` or something like that.

[thaller@redhat.com: cherry-picked and adjusted for rebase from
  https://github.com/NetworkManager/NetworkManager/pull/49]
2018-01-03 15:22:33 +01:00
Lubomir Rintel
b936ccd283 travis: update to Ubuntu 14.04 (trusty)
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.
2018-01-02 15:37:45 +01:00
Lubomir Rintel
95747d2c73 travis: use apt addon to install packages
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").
2018-01-02 15:37:45 +01:00
Iñigo Martínez
ad12837baf build: Workaround for gtkdoc dependencies
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
2018-01-02 10:44:15 +01:00
Iñigo Martínez
03ba0f1b3a build: Remove default install directories
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
2018-01-02 10:44:05 +01:00
Thomas Haller
e965b7679d systemd: merge branch systemd into master
Reimport systemd because it uses STRLEN() macro.
We need to when building with -Wvla warning enabled.

Related: https://github.com/systemd/systemd/pull/7625
2018-01-02 10:14:41 +01:00
Thomas Haller
c721d51dc3 systemd: update code from upstream (2018-01-01)
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"
2018-01-02 09:57:22 +01:00
Pavel Šimerda
4650a4e1a1 tests: fix warnings about unused functions
https://github.com/NetworkManager/NetworkManager/pull/48
2017-12-30 12:02:31 +01:00
Thomas Haller
24695a6d1c wifi/iwd: fix type-description for NMDeviceIwd
The NMDeviceIwd is an alternative implementation of
NMDeviceWifi, hence, it must also look like a Wi-Fi
device.

Fix the type-description to be "wifi".
2017-12-27 10:55:09 +01:00
Thomas Haller
67a20a6ba5 wifi/iwd: merge branch 'th/wifi-iwd-config'
https://github.com/NetworkManager/NetworkManager/pull/41
2017-12-27 10:18:31 +01:00
Thomas Haller
0775602574 device: don't keep a clone of the type-description for each device instance
Instead, intern the string and cache it in the NMDeviceClass instance.
It anyway depends entirely on the GObject type (name), hence it should
also be cached at the type.
2017-12-27 09:52:40 +01:00
Thomas Haller
969eb98d52 core: extend nm_match_spec_device_by_pllink() with the device-type
nm_match_spec_device_by_pllink() does not support matching on all parameters,
unlike nm_match_spec_device(). The reason is that certain parameters are
only available when having a NMDevice instance.

Add an argument "match_device_type", so that the caller can inject the
device type to be used. Note that for NMDevice, the device-type is
nm_device_get_type_description(), which usually depends on the device
class only. The only caller of nm_match_spec_device_by_pllink() is the
wifi factory, and it already knows that it wants to create a device of
type NMDeviceWifi. Hence, it knows and can specify "wifi" as
match_device_type.
2017-12-27 09:42:05 +01:00
Thomas Haller
bbea0656a5 wifi: use nm_str_hash() instead of g_str_hash() 2017-12-27 09:18:54 +01:00
Thomas Haller
fc2e4bb48f wifi: don't log NULL string in create_device()
While glibc's printf is forgiving against printing NULL values,
don't do it.
2017-12-27 09:18:54 +01:00
Thomas Haller
bde3f1bd62 core: use define for configuration name "wifi.scan-rand-mac-address" 2017-12-27 09:18:54 +01:00