Commit graph

11173 commits

Author SHA1 Message Date
Lubomir Rintel
bd6074095d devices/wpan: set channel on activation 2018-10-07 15:46:02 +02:00
Lubomir Rintel
0573656eeb platform/wpan: allow setting channel 2018-10-07 15:46:02 +02:00
Lubomir Rintel
ae38d43e66 core/setting-wpan: add page and channel properties 2018-10-07 15:46:02 +02:00
Beniamino Galvani
e3b9606b24 device: fix a wrong comparison
'i <= G_MAXINT' is always true.
2018-10-06 10:03:48 +02:00
Thomas Haller
4791782f46 systemd: merge branch systemd into master
https://github.com/NetworkManager/NetworkManager/pull/186
2018-10-05 01:24:08 +02:00
Thomas Haller
5f1ad6a482 systemd: comment out unused code in utf8.c
Unused code is nice, because on update we don't need to check
whether a patch affects behavior.

Mark code that is unused as such.
2018-10-05 01:00:32 +02:00
Evgeny Vereshchagin
7cb7cffc49 dhcp6: fix an off-by-one error in dhcp6_option_parse_domainname
==14==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200055fa9c at pc 0x0000005458f1 bp 0x7ffc78940d90 sp 0x7ffc78940d88
READ of size 1 at 0x60200055fa9c thread T0
    #0 0x5458f0 in dhcp6_option_parse_domainname /work/build/../../src/systemd/src/libsystemd-network/dhcp6-option.c:555:29
    #1 0x54706e in dhcp6_lease_set_domains /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-lease.c:242:13
    #2 0x53fce0 in client_parse_message /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:984:29
    #3 0x53f3bc in client_receive_advertise /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:1083:13
    #4 0x53d57f in client_receive_message /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:1182:21
    #5 0x7f0f7159deee in source_dispatch /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3042:21
    #6 0x7f0f7159d431 in sd_event_dispatch /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3455:21
    #7 0x7f0f7159ea8d in sd_event_run /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3512:21
    #8 0x531f2b in fuzz_client /work/build/../../src/systemd/src/fuzz/fuzz-dhcp6-client.c:44:9
    #9 0x531bc1 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-dhcp6-client.c:53:9
    #10 0x57bec8 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:570:15
    #11 0x579d67 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:479:3
    #12 0x57dc92 in fuzzer::Fuzzer::MutateAndTestOne() /src/libfuzzer/FuzzerLoop.cpp:707:19
    #13 0x580ca6 in fuzzer::Fuzzer::Loop(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:838:5
    #14 0x55e968 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:764:6
    #15 0x551a1c in main /src/libfuzzer/FuzzerMain.cpp:20:10
    #16 0x7f0f701a082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #17 0x41e928 in _start (/out/fuzz-dhcp6-client+0x41e928)

https://github.com/systemd/systemd/pull/10200
b387d3c132
2018-10-05 00:44:27 +02:00
Yu Watanabe
484e92e17f dhcp6: check option length before reading values
Fixes oss-fuzz#10746
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10746.

https://github.com/systemd/systemd/pull/10213
84452783b8
2018-10-05 00:38:09 +02:00
Thomas Haller
2e5d35f29d systemd: update code from upstream (2018-10-04)
This is a direct dump from systemd git.

======

SYSTEMD_DIR=../systemd
COMMIT=b62f9008668a5330c61b4de7e0d48147bcd1edf7

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

git ls-files :/src/systemd/src/ \
             :/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/env-util.c"
nm_copy_sd "src/basic/env-util.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 "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/stat-util.c"
nm_copy_sd "src/basic/stat-util.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-10-05 00:20:48 +02:00
Thomas Haller
837d44ffa4 keyfile: split automatically setting ID/UUID for keyfile
keyfile already supports omitting the "connection.id" and
"connection.uuid". In that case, the ID would be taken from the
keyfile's name, and the UUID was generated by md5 hashing the
full filename.

No longer do this during nm_keyfile_read(), instead let all
callers call nm_keyfile_read_ensure_*() to their liking. This is done
for two reasons:

 - a minor reason is, that one day we want to expose keyfile API
   as public API. That means, we also want to read keyfiles from
   stdin, where there is no filename available. The implementation
   which parses stdio needs to define their own way of auto-generating
   ID and UUID. Note how nm_keyfile_read()'s API no longer takes a
   filename as argument, which would be awkward for the stdin case.

 - Currently, we only support one keyfile directory, which (configurably)
   is "/etc/NetworkManager/system-connections".
   In the future, we want to support multiple keyfile dirctories, like
   "/var/run/NetworkManager/profiles" or "/usr/lib/NetworkManager/profiles".
   Here we want that a file "foo" (which does not specify a UUID) gets the
   same UUID regardless of the directory it is in. That seems better, because
   then the UUID won't change as you move the file between directories.
   Yes, that means, that the same UUID will be provided by multiple
   files, but NetworkManager must already cope with that situation anyway.
   Unfortunately, the UUID generation scheme hashes the full path. That
   means, we must hash the path name of the file "foo" inside the
   original "system-connections" directory.
   Refactor the code so that it accounds for a difference between the
   filename of the keyfile, and the profile_dir used for generating
   the UUID.
2018-10-04 11:03:23 +02:00
Thomas Haller
2e5985f2e9 keyfile: refactor check whether filename starts with a dot
check_prefix() was only ever called with "." as prefix.
Simplify the implementation to explicitly check for a leading
dot.
2018-10-04 10:58:50 +02:00
Thomas Haller
345c91a0a4 keyfile: move file permission check of keyfile to helper function 2018-10-04 10:58:50 +02:00
Thomas Haller
2e0a95530f keyfile/tests: assert against auto generated UUID for keyfile
The algorithm for generating the UUID must be stable. Assert
against that.
2018-10-04 10:58:50 +02:00
Thomas Haller
e886e5364e keyfile/tests: refactor loading of keyfiles in tests 2018-10-04 10:58:50 +02:00
Thomas Haller
5345cac151 core: add code comment to nm_utils_read_link_absolute() and minor cleanup 2018-10-04 10:58:50 +02:00
Thomas Haller
343b99f891 acd/tests: skip NAcd tests under valgrind
Under valgrind, we cannot create an NAcd instance.

    --10916-- WARNING: unhandled amd64-linux syscall: 321
    --10916-- You may be able to write your own handler.
    --10916-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
    --10916-- Nevertheless we consider this a bug.  Please report
    --10916-- it at http://valgrind.org/support/bug_reports.html.

This limitation already poses a problem, because running NetworkManager
under valgrind might fail. However, for tests it doesn't matter and we
can just skip them.
2018-10-04 10:58:50 +02:00
Thomas Haller
37c6cafb84 device: always cancel WPS when secret-request fails
See the logfile at [1], for how NetworkManager first attempts to connect
using WPS (which takes about 30 seconds). However, early on, the user logs
into KDE and a secret agent would register, which possibly could provide
secrets to connect. I think it is problematic to wait for WPS (which is
unlikely to succeed) if a secret agent shows up in the meantime.

A possible fix would be that when
  - WPS is pending
  - the secret request already failed
  - another secret-agent registers
then the activation (and WPS) is aborted and autoconnect may be tried
again, possibly with secrets provided by the new secret-agent.

However, this patch goes a step further: it always cancels activation
when the secret request fails. That means, WPS only works while the
user is also prompted for a secret. That makes sense to me, because
an action from the user is required. However, without secret prompt,
the user wouldn't be aware of that and is unlikely to press the WPS
push botton.

[1] https://bugzilla.opensuse.org/show_bug.cgi?id=1079672#c33

https://github.com/NetworkManager/NetworkManager/pull/216
2018-10-03 17:25:28 +02:00
Frédéric Danis
995ff778ce core: fix typo in comment
Not refering to the right function

https://mail.gnome.org/archives/networkmanager-list/2018-October/msg00000.html
2018-10-01 11:59:01 +02:00
Lubomir Rintel
8f107f5c00 platform: bring back the interface name to log messages
Fixes: ecf607cce6
2018-10-01 11:45:57 +02:00
Lubomir Rintel
8aa3e6de5c wifi-utils: remove log domain argument
Makes Thomas happy.
2018-10-01 10:26:06 +02:00
Lubomir Rintel
74ce1e963e wifi-utils: rename nl80211 to self
Makes Thomas happy.
2018-10-01 10:26:05 +02:00
Lubomir Rintel
2346210c11 wifi-utils: downgrade a log message
This is pretty much of no use to the user and clobbers the log.
2018-10-01 10:26:05 +02:00
Lubomir Rintel
ecf607cce6 platform: log the interface names 2018-10-01 10:26:05 +02:00
Lubomir Rintel
03e3651794 wifi: include the interface name in logs 2018-10-01 10:26:05 +02:00
Lubomir Rintel
5628f136f9 wpan: include the device name in logs 2018-10-01 10:26:05 +02:00
Beniamino Galvani
2753f3d0e8 supplicant: fix setting macsec ckn
Fixes: 3a2504f3ad
2018-10-01 10:20:04 +02:00
Beniamino Galvani
871cd6128d connectivity: fix crash when the uri gets cleared from configuration
host_and_port_from_uri() crashes if the new uri is NULL.

Fixes: 2cec94bacc

https://bugzilla.redhat.com/show_bug.cgi?id=1634500
2018-10-01 09:46:14 +02:00
Rafael Fontenelle
34fd628990 Fix typos
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/21

[thaller@redhat.com: fix generated clients/common/settings-docs.h.in file
   and fix wrong change in src/systemd/src/libsystemd/sd-event/sd-event.c]
2018-09-30 21:14:55 +02:00
Thomas Haller
3a2504f3ad supplicant: use _nm_utils_hexstr2bin() for parsing hexstr 2018-09-30 16:13:42 +02:00
Thomas Haller
be6c7fa5f6 libnm: cleanup _nm_utils_hexstr2bin*() helper
Add 3 variants of _nm_utils_hexstr2bin*():

  - _nm_utils_hexstr2bin_full(), which takes a preallocated
    buffer and fills it.
  - _nm_utils_hexstr2bin_alloc() which returns a malloc'ed
    buffer
  - _nm_utils_hexstr2bin_buf(), which fills a preallocated
    buffer of a specific size.
2018-09-30 16:13:42 +02:00
Thomas Haller
b537c0388a all: drop _nm_utils_bin2hexstr()
We already have nm_utils_bin2hexstr() and _nm_utils_bin2hexstr_full().
This is confusing.

  - nm_utils_bin2hexstr() is public API of libnm. Also, it has
    a last argument @final_len to truncate the string at that
    length.
    It uses no delimiter and lower-case characters.

  - _nm_utils_bin2hexstr_full() does not do any truncation, but
    it has options to specify a delimiter, the character case,
    and to update a given buffer in-place. Also, like
    nm_utils_bin2hexstr() and _nm_utils_bin2hexstr() it can
    allocate a new buffer on demand.

  - _nm_utils_bin2hexstr() would use ':' as delimiter and make
    the case configurable. Also, it would always allocate the returned
    buffer.

It's too much and confusing. Drop _nm_utils_bin2hexstr() which is internal
API and just a wrapper around _nm_utils_bin2hexstr_full().
2018-09-30 13:36:57 +02:00
Thomas Haller
6714440669 all/trivial: rename hexstr<>bin conversion functions
"bin2str" and "str2bin" are not very clear. These strings are
hex-strings. Rename.
2018-09-30 13:33:46 +02:00
Beniamino Galvani
34ffd9fcab build: meson: install ifcfg-rh files and directory 2018-09-28 17:25:46 +02:00
Beniamino Galvani
f744e29dd3 device: fix crash in nm_device_generate_connection()
Fixes: 89d1c9fb30

https://bugzilla.redhat.com/show_bug.cgi?id=1631741
2018-09-27 18:08:46 +02:00
Thomas Haller
7729555a59 acd: make NMAcdManager no GObject
NMAcdManager is a rather simple instance.

It does not need (thread-safe) ref-counting, in fact, having
it ref-counted makes it slighly ugly that we connect a signal,
but never bother to disconnect it (while the ref-counted instance
could outlife the signal subscriber).

We also don't need GObject signals. They have more overhead
and are less type-safe than a regular function pointers. Signals
would make sense, if there could be multiple independent listeners,
but that just doesn't make sense.

Implementing it as a plain struct is less lines of code, and less
runtime over head.

Also drop the possiblitiy to reset the NMAcdManager instance.
It wasn't needed and I think it was buggy because it wouldn't
reset the n-acd instance.

https://github.com/NetworkManager/NetworkManager/pull/213
2018-09-27 17:36:42 +02:00
Beniamino Galvani
6b5790a05e device: set token only after router discovery was started
Kernel complains with:

  platform-linux: link: change 10: token: set IPv6 address generation token to ::bbbb
  platform-linux: do-change-link[10]: failure changing link: failure 22 (Invalid argument)

if we try to set an IPv6 token in ip_config_merge_and_apply() and we
haven't set accept_ra=1 yet. Since the flag is set when starting
router discovery, ensure that we don't try to set a token before that.

https://github.com/NetworkManager/NetworkManager/pull/214
https://bugzilla.redhat.com/show_bug.cgi?id=1560652
2018-09-27 17:21:29 +02:00
Beniamino Galvani
1e43ae9e77 supplicant: fix memory leak
Fixes: 17da42704a
2018-09-27 15:24:28 +02:00
Beniamino Galvani
5d97e76c7d wifi: support hidden ssid in AP mode
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/48
2018-09-27 13:35:53 +02:00
Beniamino Galvani
0ba0f52cb7 dhcp: dhclient: fix memory leak
Fixes: c263f5355c
2018-09-27 09:23:54 +02:00
Thomas Haller
a4de56a3d1 dns: fix sort order of DNS configurations by type
Fixes: d7017005e1
2018-09-27 08:01:35 +02:00
Andrew Zaborowski
bfacd24f83 wifi/iwd: handle IWD Station interface disappearing
The net.connman.iwd.Station interface, unlike the Device interface, can
go away and come back when the device changes modes or goes DOWN and UP.
The GDbusProxy for the interface becomes invalid after the interface
disappeared and reappeared.  This would make the IWD backend stop
working after rfkill was used or after suspend/resume (provided the
suspend/resume events are detected, without them everything works and is
really fast too).

Redo the handling of the Powered property changes, corresponding to
device UP state, to get a new GDBusProxy when the Station interface
reappears.  Simplify some checks knowing that priv->can_scan implies for
example that the Station interface is present, and that priv->enabled
implies the NM device state is >= DISCONNECTED.

https://github.com/NetworkManager/NetworkManager/pull/211
2018-09-26 13:47:03 +02:00
Thomas Haller
365079c09e wifi: log warning when active scanning for hidden networks
When there are profiles with wifi.hidden=yes, NetworkManager
will actively scan for these SSIDs. This makes the scan request
(and thus the user) recognizable and trackable.

It seems generally a bad idea to use hidden networks, as they
compromise either the privacy or usablity for the clients.

Log a (rate-limited) warning about this.
2018-09-26 12:50:35 +02:00
Beniamino Galvani
f069c98cc9 device: don't remove routes when the interface is down
In update update_ext_ip_config() we remove from various internal
configurations those addresses and routes that were removed externally
by users.

When the interface is brought down, the kernel automatically removes
routes associated with it and so we should not consider them as
"removed by users".

Instead, keep them so that they can be restored when the interface
comes up again.
2018-09-26 11:49:37 +02:00
Beniamino Galvani
8f07b3ac4f ip-config: add @intersect_routes argument to intersect functions
In some cases we want to intersect two IP configurations without
considering routes.
2018-09-26 11:49:37 +02:00
Beniamino Galvani
46ed756112 device: fix updating device information after link change
device_link_changed() can't use nm_device_update_from_platform_link()
to update the device private fields because the latter overwrites
priv->iface and priv->up, and so the checks below as:

  if (info.name[0] && strcmp (priv->iface, info.name) != 0) {

and:

  was_up = priv->up;
  priv->up = NM_FLAGS_HAS (info.n_ifi_flags, IFF_UP);
  ...
  if (priv->up && !was_up) {

never succeed.

Fixes: d7f7725ae8
2018-09-26 11:49:37 +02:00
Beniamino Galvani
3b49d1075d core: improve nm_ip_config_dump()
Previously we had nm_ip{4,6}_config_dump() for debugging purposes, but
they were inconveniently printing to stdout and so the output was not
ordered in the journal.

Implement a unified nm_ip_config_dump() that logs through the usual
logging mechanism.
2018-09-26 11:49:37 +02:00
Thomas Haller
d7017005e1 dns: use NM_CMP_*() macros sorting IP config in DNS manager 2018-09-26 11:24:09 +02:00
Thomas Haller
ad10e79ae4 dns: drop redundant call to clear_domain_lists() in update_dns()
It does nothing.
2018-09-26 09:55:50 +02:00
Lubomir Rintel
60007d7cbd connectivity: fix a wrong comparision
Thanks clang 7.

Fixes: cbfe6aa973
2018-09-24 15:57:43 +02:00
Lubomir Rintel
cbfe6aa973 connectivity: create a multi-handle for all requests
This is dead ugly and works around what probably is a libcurl (7.59) bug:
It shares the resolver cache among easy handles in a multi handle when
it shouldn't:

When we create two easy handles, one for IPv4 and one for IPv6 in a
single mhandle:

  curl_easy_setopt (ehandle6, CURLOPT_RESOLVE,
    "fedoraproject.org:2605:bc80:3010:600:dead:beef:cafe:feda"
    "fedoraproject.org:2604:1580:fe00:0:dead:beef:cafe:fed1")
  curl_easy_setopt (ehandle4, CURLOPT_RESOLVE,
    "fedoraproject.org:8.43.85.67"
    "fedoraproject.org:152.19.134.198")
  curl_multi_add_handle (mhandle, ehandle6);
  curl_multi_add_handle (mhandle, ehandle4);

Both end up connecting to the same (either v4 or v6) address. None of
CURLOPT_FORBID_REUSE(3), CURLOPT_FRESH_CONNECT(3),
CURLOPT_DNS_USE_GLOBAL_CACHE(3) and CURLOPT_DNS_CACHE_TIMEOUT(3) make
any difference. Nor does CURLOPT_DNS_LOCAL_IP[46].
2018-09-24 15:38:16 +02:00