Commit graph

19608 commits

Author SHA1 Message Date
Thomas Haller
8ff962d9e4 dhcp: cache info-only parameter in NMDhcpClient
Optimally, NMDhcpClient would be stateless and all paramters would
be passed on as argument. Clearly that is not feasable, because there
are so many paramters, and in many cases they need to be cached for the
lifetime of the client instance.

Instead of passing info_only paramter to ip6_start() and cache it
both in NMDhcpClient and NMDhcpSystemd, keep it in NMDhcpClient at
one place.

In the next commit, we will initialize info-only only once during the
constructor, so it is immutable and somewhat stateless.
2018-02-15 16:08:00 +01:00
Thomas Haller
badace72dd dhcp: chain up parent stop() for NMDhcpSystem client
The parent's stop() implementation does nothing interesting
for NMDhcpSystem. Still, call it, it's just unexpected to
not chain up the parent implementation, if all other subclasses
do it.

In general, if the parent's implementation is not suitable to be called
by the derived class, that should be handled differently then just not
chaining up. Otherwise it's inconsistent and confusing.
2018-02-15 16:08:00 +01:00
Thomas Haller
056f2679b8 dhcp: fix memleak parsing dhclient file with multiple dhcp-client-identifier lines 2018-02-15 16:08:00 +01:00
Beniamino Galvani
dc3eaaaac6 build: merge branch 'bg/asan-exec-bgo793332'
https://bugzilla.gnome.org/show_bug.cgi?id=793332
2018-02-15 15:40:08 +01:00
Beniamino Galvani
43960d4b15 connectivity: fix wrong memory access
Don't use message data after calling curl_multi_remove_handle(). Fixes
the following asan error:

=================================================================
==13238==ERROR: AddressSanitizer: heap-use-after-free on address 0x608000091ad0 at pc 0x55750f8d9a10 bp 0x7ffeb7f5f210 sp 0x7ffeb7f5f200
READ of size 8 at 0x608000091ad0 thread T0
    #0 0x55750f8d9a0f in curl_check_connectivity (/usr/sbin/NetworkManager+0x190a0f)
    #1 0x55750f8da7dd in curl_socketevent_cb (/usr/sbin/NetworkManager+0x1917dd)
    #2 0x7f73cb64e8f8 in g_main_context_dispatch (/lib64/libglib-2.0.so.0+0x4a8f8)
    #3 0x7f73cb64ec57  (/lib64/libglib-2.0.so.0+0x4ac57)
    #4 0x7f73cb64ef29 in g_main_loop_run (/lib64/libglib-2.0.so.0+0x4af29)
    #5 0x55750f85c3f4  (/usr/sbin/NetworkManager+0x1133f4)
    #6 0x7f73c9f19384 in __libc_start_main (/lib64/libc.so.6+0x22384)
    #7 0x55750f85d7f7  (/usr/sbin/NetworkManager+0x1147f7)

0x608000091ad0 is located 48 bytes inside of 88-byte region [0x608000091aa0,0x608000091af8)
freed by thread T0 here:
    #0 0x7f73cd61f508 in __interceptor_free (/lib64/libasan.so.4+0xde508)
    #1 0x7f73ca710eaa in curl_multi_remove_handle (/lib64/libcurl.so.4+0x32eaa)

previously allocated by thread T0 here:
    #0 0x7f73cd61fa88 in __interceptor_calloc (/lib64/libasan.so.4+0xdea88)
    #1 0x7f73ca710b3d in curl_multi_add_handle (/lib64/libcurl.so.4+0x32b3d)

SUMMARY: AddressSanitizer: heap-use-after-free (/usr/sbin/NetworkManager+0x190a0f)
2018-02-15 15:34:03 +01:00
Beniamino Galvani
f548806213 rpm: update sanitizer build flags
Disable undefined sanitizer on RHEL since it's not supported. Also,
enable address sanitizer only for executables, as having it enabled in
libraries causes problems when applications built without asan load
them.
2018-02-15 15:34:03 +01:00
Beniamino Galvani
0fb7989092 rpm: add requirements for sanitizer builds 2018-02-15 15:34:03 +01:00
Beniamino Galvani
936e0a51fe libnm-core: don't use RTLD_DEEPBIND when building with asan
The address sanitizer is not compatible [1] with libraries dynamically
opened using RTLD_DEEPBIND: disable the flag when building with asan.

[1] https://github.com/google/sanitizers/issues/611
2018-02-15 15:34:03 +01:00
Beniamino Galvani
0af2762cbf build: allow building with address sanitizer only for executables
Shared libraries built with sanitizers are a bit inconvenient to use
because they require that any application linking to them is run with
libasan preloaded using LD_PRELOAD. This limitation makes the
sanitizer support less useful because applications will refuse to
start unless there is a special environment variable set.

Let's turn the --enable-address-sanitizer configure flag into
--with-address-sanitizer=yes|no|exec so that is possible to enable
asan only for executables.
2018-02-15 15:34:03 +01:00
Thomas Haller
23e4ef5092 systemd: merge branch systemd into master 2018-02-15 10:26:10 +01:00
Thomas Haller
4d923233f2 systemd: update code from upstream (2018-02-14)
This is a direct dump from systemd git on 2018-02-14, git commit
cac26f0bc8c8b73796fd6da862b919b1e0a969bc.

======

SYSTEMD_DIR=../systemd
COMMIT=cac26f0bc8c8b73796fd6da862b919b1e0a969bc

(
  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-02-14 17:52:02 +01:00
Beniamino Galvani
f9c50bf3d3 settings: preserve agent-owned secrets on connection update
After writing the connection to disk and rereading it, in addition to
restoring agent-owned secrets in the cache we must also restore
agent-owned secrets from the original connections since they are lost
during the write.

Reported-by: Märt Bakhoff <anon@sigil.red>

https://bugzilla.gnome.org/show_bug.cgi?id=793324
2018-02-14 11:49:39 +01:00
Beniamino Galvani
e27963d17f cli: fix connections completion
Let the matching continue when we are autocompleting arguments and we
have already found 'id', 'uuid' or 'path'.

Before:

 # nmcli connection modify path<TAB>
 path

After:
 # nmcli connection modify path<TAB>
 path
 pathfinder-wifi
2018-02-13 16:09:16 +01:00
Beniamino Galvani
6cba687bb3 cli: fix completion of help sub-command
'help' is completed without considering other alternatives:

 # nmcli connection modify h<TAB>
 help

After the patch:
 # nmcli connection modify h<TAB>
 help
 home-wifi

Fixes: 29bb6ae4fe
2018-02-13 16:09:16 +01:00
Lubomir Rintel
de9b74452c cli/polkit-agent: drop an extra newline
It looks bad and makes everyone super-sad:

  $ nmcli --ask c modify 'Oracle HQ' 802-11-wireless-security.psk solaris666
  System policy prevents modification of network settings for all users
  (action_id: org.freedesktop.NetworkManager.settings.modify.system)
  Password (lkundrak): *********

  $
2018-02-13 15:06:22 +01:00
Lubomir Rintel
9bf0b32cd1 cli/connections: avoid using synchronous get_secrets()
With --ask it might call back to nmcli's agent, causing a deadlock
while the client is waiting for the response. Let's give the client
a chance to service the agent requests while waiting:

  $ nmcli --ask --show-secrets c show 'Oracle HQ'
  <hang>

This is probably still rather suboptimal and inefficient, since we
still serialize the calls and block on response. However, if we submit
multiple calls to GetSecrets, the daemon would start authorizing the
first one and fail the other ones immediately before the authorization
succeeds.

This could perhaps be addressed in the daemon, but let's settle for a
fix that's compatible with the current daemon for now.
2018-02-13 15:03:49 +01:00
Lubomir Rintel
6788ced98d platform/test: drop the /sys/devices dance
The bridge test (and no other either) no longer sets sysfs properties,
so this whole madness is no longer needed. That is good, because Linux
got somewhat stricter (at least in 4.15) about mounting sysfs and the
whole thing wouldn't work with containers where /sys is red-only from
the start.
2018-02-12 20:46:47 +01:00
Lubomir Rintel
d7c70dd9ec platform/netns: don't try to overlay ro /sys with a rw one
Linux 4.15 won't allow us. No problem.
2018-02-12 20:46:47 +01:00
Lubomir Rintel
85c0dc4a92 ppp/plugin: use g_strlcpy()
It's nicer but also doesn't annoy gcc 8: "error: ‘strncpy’ specified bound
depends on the length of the source argument [-Werror=stringop-overflow=]"
2018-02-12 20:46:47 +01:00
Lubomir Rintel
7f847d71f3 platform/tests: (trivial) fix a typo 2018-02-12 20:46:47 +01:00
Lubomir Rintel
984e9d5655 platform/tests: disable tests touching sysctl when they're not writable
This is basically the case in the COPR build system where this
(mount -o bind,ro /proc/sys /proc/sys) is the case for reasons unknown.
2018-02-12 20:46:47 +01:00
Aleksander Morgado
a25d2e0a17 connectivity: fix portal detection when using HTTP 204 based checks
If we're going to use a 'no content' URL (HTTP 204) to check
connectivity, do not try to match prefix when the content is being
received. This issue was making the check not work properly, as the content
returned by the captive portal was assumed as expected (given that
g_str_has_prefix(str,"") always returns TRUE!).

Also, rework a log message that was being emitted on portal detection
to avoid specifying that the reason is the content being shorter than
expected, as that same logic now applies to the case where too much
content is received and none was expected.

Fixes: 88416394f8

https://mail.gnome.org/archives/networkmanager-list/2018-February/msg00009.html
2018-02-12 19:41:38 +01:00
Thomas Haller
be1d8c842f ifcfg: merge branch 'th/ifcfg-simple-dbus'
https://github.com/NetworkManager/NetworkManager/pull/63
2018-02-12 13:29:27 +01:00
Thomas Haller
46fad1fdb6 ifcfg-rh: rework D-Bus handling of ifcfg-rh settings plugin
The ifcfg-rh plugin provides its own D-Bus service which initscripts
query to determine whether NetworkManager handles an ifcfg file.

Rework the D-Bus glue to hook GDBus with NetworkManager to use
GDBusConnection directly. Don't use generated code, don't use
GDBusInterfaceSkeleton.

We still keep "src/settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml"
and still compile the static generated code. We don't actually need
them anymore, maybe the should be dropped later.

This is a proof of concept for reworking the D-Bus glue in
NetworkManager core to directly use GDBusConnection. Reworking core is
much more complicated, because there we also have properties, and a
class hierarchy.

Arguably, for the trivial ifcfg-rh service all this hardly matters, because
the entire D-Bus service only consists of one method, which is unlikely to
be extended in the future.

Now we get rid of layers of glue code, that were hard to comprehend.
Did you understand how nm_exported_object_skeleton_create() works
and uses the generated code and GDBusInterfaceSkeleton to hook into
GDBusConnection? Congratulations in that case. In my opinion, these
layers of code don't simplify but complicate the code.

The change also reduces the binary size of "libnm-settings-plugin-ifcfg-rh.so"
(build with contrib/rpm --without debug) by 8312 bytes (243672 vs. 235360).
2018-02-12 13:29:03 +01:00
Thomas Haller
86fd0402d9 ifcfg-rh: minor cleanup for _dbus_setup()
In _dbus_setup(), call _dbus_clear(). It feels more correct to do that.
Although, technically, we never even call _dbus_setup() if there is
anything to clear.

Also, minor refactoring of config_changed_cb(). It's not entirely clear
whether we need that code, or how to handle D-Bus disconnecting, if at all.
2018-02-12 13:29:03 +01:00
Thomas Haller
5b6612dea1 dhcp: use NM_DEFINE_GDBUS_INTERFACE_INFO() macros to define D-Bus registration info for DHCP listener 2018-02-12 13:29:03 +01:00
Thomas Haller
0dbd6b507c dhcp: mark descriptor tables for D-Bus as static const
Marking static variables as const will result in write-protected
memory, which is a desired property.
2018-02-12 13:29:03 +01:00
Thomas Haller
d46de19a9a shared: add nm_steal_int() helper 2018-02-12 13:29:03 +01:00
Thomas Haller
4e5bef3951 shared: add macros to define GDBus registration info 2018-02-12 13:29:03 +01:00
Thomas Haller
7a956644d4 shared: add NM_UNCONST_PTR() and NM_UNCONST_PPTR()
Add macros that cast away the constness of a pointer, but
ensure that the type of the pointer is as expected.

Unfortunately, there is no way (AFAIK) to remove the constness of
a variable, without explicitly passing @type to the macro.
2018-02-12 13:29:03 +01:00
Thomas Haller
3d41812945 contrib: add -h option to NM-log
Pass "-h" to highlight individual words.
"-h" stands for "highlight".

  $ NM-log -h wlan0 j
2018-02-12 13:06:49 +01:00
Francesco Giudici
aae263fbf2 team: merge 'fg/team-clean-tx-hash-on-set-rh1541922'
https://bugzilla.redhat.com/show_bug.cgi?id=1541922
2018-02-12 11:21:32 +01:00
Francesco Giudici
fd5b3f802e nmcli: team: do strict checking on runner-tx-hashes
Substrings matching the heading of valid values were allowed if not
ambiguous (e.g.: "et" for "eth"). Moreover, upper case variants were
accepted too.
Do a plain string comparison check against the valid values.
Improve also the error message: give a list of valid tx-hashes.
2018-02-12 11:20:12 +01:00
Francesco Giudici
38844e6c5e client: fix nmc_string_is_valid ambiguous detection
when input matched the heading of two allowed values the match was
reported as ambiguous without checking if there was a perfect match
following: fixed.

Example of a failing input:
const char **allowed = [ "ipv4, ipv6, ip" ];
const char *input = "ip";

"ip" was detected as ambiguous.
2018-02-12 10:42:58 +01:00
Francesco Giudici
350dbb55ab nmcli: team: clear runner-tx-hash before adding new hashes
https://bugzilla.redhat.com/show_bug.cgi?id=1541922
2018-02-12 10:42:58 +01:00
Thomas Haller
2a3de3778d build/meson: fix printing DHCP build status 2018-02-11 17:37:22 +01:00
Thomas Haller
574f2744dc ovs/trivial: fix indentation 2018-02-09 22:07:28 +01:00
Thomas Haller
873be8a37a wifi/iwd: merge branch 'az/more-iwd-fixes-pr62'
https://github.com/NetworkManager/NetworkManager/pull/62
2018-02-09 21:34:48 +01:00
Thomas Haller
6473b0868c wifi/iwd: make NMIwdManager:dispose() reentrant
Theoretically, dispose() could be called multiple times.
2018-02-09 21:34:20 +01:00
Andrew Zaborowski
3a30ea9fc6 iwd: avoid duplicate nm_device_iwd_set_dbus_object call
Avoid calling nm_device_iwd_set_dbus_object (device, NULL) if the
dbus_object was NULL already.  Apparently gdbus guarantees that a
name-owner notification either has a NULL old owner or a NULL new owner
but can also have both old and new owner NULL.
2018-02-09 21:30:46 +01:00
Andrew Zaborowski
86dd400049 iwd: recreate GDbusObjectManagerClient on reconnect
Reuse the apparent workaround from libnm/nm-client.c in which the
GDbusObjectManagerClient is recreated every time the name owner
pops up, instead of creating it once and using that object forever.
Resubscribe to all the signals on the new object.  The initial
GDbusObjectManager we create is only used to listed for the name-owner
changes.

There's nothing in gdbus docs that justifies doing that but there
doesn't seem to be any way to reliably receive all the signals from
the dbus service the normal way.  The signals do appear on dbus-monitor
and the gdbus apparently subscribes to those signals with AddMatch()
correctly but they sometimes won't be received by the client code,
unless this workaround is applied.

While making changes to got_object_manager, don't destroy the
cancellable there as it is supposed to be used throughout the
NMIwdManager life.
2018-02-09 21:30:46 +01:00
Andrew Zaborowski
d32987fdd1 iwd: keep reference to NMManager, disconnect signals
Disconnect from NMManager signals in our cleanup, make sure the
NMManager singleton is not destroyed before we are by keeping a
reference until we've disconnected from its signals.
2018-02-09 21:30:46 +01:00
Andrew Zaborowski
eea06b8a8c iwd: initialize priv->can_connect when DBus interface appears
Call state_changed with the initial Device.State property value to make
sure can_connect and can_scan are up to date.
2018-02-09 21:30:46 +01:00
Andrew Zaborowski
755d4e55c2 iwd: simple periodic scanning
Add very simple periodic scanning because IWD itself only does periodic
scanning when it is in charge of autoconnecting (by policy).  Since we
keep IWD out of the autoconnect state in order to use NM's autoconnect
logic, we need to request the scanning.  The policy in this patch is to
use a simple 10s period between the end of one scan the requesting of
another while not connected, and 20s when connected.  This is so that
users can expect similar results from both wifi backends but without
duplicating the more elaborate code in the wpa_supplicant backend which
can potentially be moved to a common superclass.
2018-02-09 21:30:46 +01:00
Thomas Haller
5f1c2e16c9 connectivity: cleanup conditions in curl_check_connectivity()
Refactor the nested ifs to if-else-if-else.
2018-02-09 21:17:54 +01:00
Aleksander Morgado
88416394f8 connectivity: allow 204 (no content) as connectivity test
If the user is requesting an empty response ("") as expected string,
let the connectivity check succeed if we actually get a 204 HTTP
response code (reporting a successful request but without content).

This allows using e.g. Android's default URLs for the connectivity
check purpose:

    [connectivity]
    uri=http://google.com/generate_204
    interval=60
    response=

https://mail.gnome.org/archives/networkmanager-list/2018-February/msg00005.html
2018-02-09 21:17:54 +01:00
Thomas Haller
0d53e093e6 platform: fix handling secondary addresses during nm_platform_ip4_address_sync()
Although IFA_F_TEMPORARY is numerically equal to IFA_F_SECONDARY,
their meaning is different. One applies to IPv6 temporary addresses,
and the other to IPv4 secondary addresses.

During _addr_array_clean_expired() we want to ignore and clear
IPv6 temporary addresses, but not IPv4 secondary addresses.

Fixes: f2c4720bca
2018-02-09 21:08:07 +01:00
Thomas Haller
3e9e51f1dd core: distinguish between IFA_F_SECONDARY and IFA_F_TEMPORARY
While the numerical values of IFA_F_SECONDARY and IFA_F_TEMPORARY
are identical, their meaning is not.

IFA_F_SECONDARY is only relevant for IPv4 addresses, while
IFA_F_TEMPORARY is only relevant for IPv6 addresses.

IFA_F_TEMPORARY is automatically set by kernel for the addresses
that it generates as part of IFA_F_MANAGETEMPADDR. It cannot be
actively set by user-space.

IFA_F_SECONDARY is automatically set by kernel depending on the order
in which the addresses for the same subnet are added.

This essentially reverts 8b4f11927 (core: avoid IFA_F_TEMPORARY alias for
IFA_F_SECONDARY).
2018-02-09 21:07:57 +01:00
Thomas Haller
fa41e5852c core: merge branch 'th/ip6-temp-addr-sync-rh1542609'
https://github.com/NetworkManager/NetworkManager/pull/65
https://bugzilla.redhat.com/show_bug.cgi?id=1542609
2018-02-09 17:40:09 +01:00
Thomas Haller
6d8a636563 device: fix IPv6 DAD to re-check whether address really failed DAD
In device_ipx_changed() we remember the addresses for which it appears
that DAD failed. Later, on an idle handler, we process them during
queued_ip6_config_change().

Note that nm_plaform_ip6_address_sync() might very well decide to remove
some or all addresses and re-add them immidiately later. It might do so,
to get the address priority/ordering right. At that point, we already
emit platform signals that the device disappeared, and track them in
dad6_failed_addrs.

Hence, later during queued_ip6_config_change() we must check again
whether the address is really not there and not still doing DAD.
Otherwise, we wrongly claim that DAD failed and remove the address,
generate a new one, and the same issue might happen again.
2018-02-09 17:40:01 +01:00