Commit Graph

18368 Commits

Author SHA1 Message Date
Thomas Haller
e827925646 agent-manager: use CList to track requests 2017-05-11 18:26:10 +02:00
Thomas Haller
a844b98259 agent-manager/trivial: move code 2017-05-11 18:26:10 +02:00
Thomas Haller
04dfff7db8 secret-agent: use CList to track requests 2017-05-11 18:26:10 +02:00
Thomas Haller
8296de1823 firewall: use CList to track pending_calls 2017-05-11 18:26:10 +02:00
Thomas Haller
e6744bcb65 libnm: fix type for "notify_id" source id in "nm-object.c" 2017-05-11 18:26:10 +02:00
Thomas Haller
d6c1e565ff libnm: remove unused code reload_results and reload_error from "nm-object.c"
Fixes: 1f5b48a59e
2017-05-11 18:26:10 +02:00
Thomas Haller
65b440c9fa libnm: use CList instead of GSList for pending in "nm-object.c" 2017-05-11 18:26:10 +02:00
Thomas Haller
35f37151df libnm: use CList instead of GSList for notify_items in "nm-object.c" 2017-05-11 18:26:10 +02:00
Thomas Haller
c63a6772a4 libnm: use CList instead of GSList for pending_activations in "nm-manager.c" 2017-05-11 18:26:10 +02:00
Thomas Haller
c12dd0d970 ifcfg-rh: refactor shvar.c to use CList instead of GList 2017-05-11 18:26:10 +02:00
Thomas Haller
d079846330 shared: add "nm-utils/c-list.h" header
Include the circular, doubly-linked list implementation from
c-util/c-list [1], commit 864051de6e7e1c93c782064fbe3a86b4c17ac466.

[1] https://github.com/c-util/c-list
2017-05-11 18:26:07 +02:00
Thomas Haller
a08540d967 proxy: fix passing cancellable to async D-Bus operations
We must not cancel pacrunner_cancellable when the D-Bus proxy is
created. Instead, keep it around and use it later for the asynchronous
D-Bus operations.

This doesn't really matter at the moment, because the pacrunner manager
is only destroyed when NetworkManager is about to terminated. That is
the only time when we actually cancel the asynchronous request. Also,
at that time we no longer iterate the mainloop, so the pending requests
are never completed anyway.
2017-05-11 18:24:41 +02:00
Thomas Haller
df137fdf9a proxy: fix refcount handing for DestroyProxyConfiguration operation
Fixes: e895beb0da
2017-05-11 18:24:41 +02:00
Nikolay Martynov
58f7813283 platform: ignore RTM_GETLINK messages sent by wireless extentions
We listen to all RTM_GETLINK messages to get updates on interfaces statuses.
Unfortunately wireless code in the kernel sends those messages with wireless information included
and all other information excluded. When we receive such message we wipe out our valid cached entry
with new object that is almost empty because netlink message didn't contain any information.

Solution to this is to check that incoming message contains MTU field: this field is always
set for complete messages about interfaces and is not set by wireless code.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>

https://github.com/NetworkManager/NetworkManager/pull/17
2017-05-11 17:41:10 +02:00
Thomas Haller
fae84b16f8 dns: better detect systemd-resolved when checking for resolv.conf symlink
We autodetect systemd-resolved based on whether /etc/resolv.conf points
to one of the well known files of systemd-resolved.

Extend the check by also
 - follow symlinks and compare the absolute link target
 - open the file and compare the inodes for hard-linking

Note that when NetworkManager starts, systemd-resolved might not
have started yet. So, while comparing the inode is the best check,
we also compare symlinks (g_file_read_link() and realpath()).

Based-on-patch-by: Sam Morris <sam@robots.org.uk>

https://github.com/NetworkManager/NetworkManager/pull/16
https://bugzilla.gnome.org/show_bug.cgi?id=779269
2017-05-11 13:52:38 +02:00
Thomas Haller
e70dfb4df7 systemd: merge branch systemd into master 2017-05-10 22:18:53 +02:00
Thomas Haller
c5decf7e38 systemd: update code from upstream (2017-05-10)
This is a direct dump from systemd git on 2017-05-10, git commit
61b2f1976cec698696f6a2fe9b2f2c89e72571de.

======

SYSTEMD_DIR=../systemd
COMMIT=61b2f1976cec698696f6a2fe9b2f2c89e72571de

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

git ls-files :/src/systemd/src/ | xargs -d '\n' rm -f

nm_copy_sd() {
    mkdir -p "./src/systemd/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/systemd/$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/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.c"
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/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 "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"
2017-05-10 22:08:40 +02:00
Thomas Haller
fe648f6cde contrib/rpm: fix specifying build with/without libpsl
Fixes: faad17f9e8
2017-05-10 17:07:25 +02:00
Thomas Haller
1975d6fa75 contrib/rpm: reorder variables in spec file 2017-05-10 16:47:24 +02:00
Thomas Haller
0893c3756e utils: fix maybe-uninitialized in "nm-udev-utils.c"
CC       shared/nm-utils/libnm_core_libnm_core_la-nm-udev-utils.lo
    In file included from ./shared/nm-utils/nm-glib.h:27:0,
                     from ./shared/nm-utils/nm-macros-internal.h:29,
                     from ./shared/nm-default.h:178,
                     from shared/nm-utils/nm-udev-utils.c:21:
    shared/nm-utils/nm-udev-utils.c: In function ‘nm_udev_client_enumerate_new’:
    ./shared/nm-utils/gsystem-local-alloc.h:53:50: error: ‘to_free’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
                                                      ^~~~~~
    shared/nm-utils/nm-udev-utils.c:147:18: note: ‘to_free’ was declared here
        gs_free char *to_free;
                      ^~~~~~~
    In file included from ./shared/nm-utils/nm-glib.h:27:0,
                     from ./shared/nm-utils/nm-macros-internal.h:29,
                     from ./shared/nm-default.h:178,
                     from shared/nm-utils/nm-udev-utils.c:21:
    shared/nm-utils/nm-udev-utils.c: In function ‘nm_udev_client_new’:
    ./shared/nm-utils/gsystem-local-alloc.h:53:50: error: ‘to_free’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
                                                      ^~~~~~
    shared/nm-utils/nm-udev-utils.c:243:20: note: ‘to_free’ was declared here
          gs_free char *to_free;
                        ^~~~~~~

Fixes: e32839838e
2017-05-10 15:34:23 +02:00
Thomas Haller
5dd335584c release: bump version to 1.9.1-dev after 1.8.0 release
After 1.8.0 is released, merge it back into master so that
1.8.0 is part of the history of master. That means,
  $ git log --first-parent master
will also traverse 1.8.0 and 1.8-rc*.

Also bump the micro version to 1.9.1-dev to indicate that this is
after 1.8.0 is out.
2017-05-10 15:13:10 +02:00
Thomas Haller
4dc905a954 po: make update-po 2017-05-10 15:06:30 +02:00
Thomas Haller
9c3df9caa3 release: bump version to 1.8.0 2017-05-10 14:57:41 +02:00
Thomas Haller
89af3b3e34 firewall: avoid invalid -Werror=maybe-uninitialized warning in _handle_dbus_start()
../../src/nm-firewall-manager.c: In function ‘_handle_dbus_start’:
    ../../src/nm-firewall-manager.c:318:2: error: ‘dbus_method’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      g_dbus_proxy_call (priv->proxy,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         dbus_method,
                         ~~~~~~~~~~~~
                         arg,
                         ~~~~

Fixes: d8bf05d3e6
(cherry picked from commit 3ba614d696)
2017-05-10 13:55:33 +02:00
Thomas Haller
3ba614d696 firewall: avoid invalid -Werror=maybe-uninitialized warning in _handle_dbus_start()
../../src/nm-firewall-manager.c: In function ‘_handle_dbus_start’:
    ../../src/nm-firewall-manager.c:318:2: error: ‘dbus_method’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      g_dbus_proxy_call (priv->proxy,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         dbus_method,
                         ~~~~~~~~~~~~
                         arg,
                         ~~~~

Fixes: d8bf05d3e6
2017-05-10 13:49:19 +02:00
Thomas Haller
4d47d5bf51 release: update NEWS 2017-05-10 13:19:16 +02:00
Thomas Haller
904ef2cd7a po: make update-po 2017-05-10 13:19:16 +02:00
Thomas Haller
bd530f396e travis: fix build due to missing libcurl library
Since using libcurl for connectivity checks, we failed to build
with connectivity checking on travis. Fix that by installing the
required library (from trusty).

Fixes: 4e6967e33d
(cherry picked from commit 1f2b5a2032)
2017-05-10 13:19:15 +02:00
Lubomir Rintel
5d9ff0fd3f connectivity: don't do periodic checks on interval=0
https://bugzilla.redhat.com/show_bug.cgi?id=1449296

Fixes: 7307dea9c4
(cherry picked from commit a95563996f)
2017-05-10 13:18:02 +02:00
Lubomir Rintel
c271d78d6b device: don't await for IPv6 DAD to finish if we are ignoring that there's no carrier
It's not the correct thing to do, but is the same behavior we've done
previously.

DAD is not even going to start until there's carrier and the client would
just wait indefinitely. Ideally, the client would choose not to waiat, but
it currently there's no way the client would discover what is going on.

https://bugzilla.redhat.com/show_bug.cgi?id=1446367
(cherry picked from commit bd9988f984)
2017-05-10 13:18:01 +02:00
Lubomir Rintel
a95563996f connectivity: don't do periodic checks on interval=0
https://bugzilla.redhat.com/show_bug.cgi?id=1449296

Fixes: 7307dea9c4
2017-05-10 13:17:31 +02:00
Lubomir Rintel
bd9988f984 device: don't await for IPv6 DAD to finish if we are ignoring that there's no carrier
It's not the correct thing to do, but is the same behavior we've done
previously.

DAD is not even going to start until there's carrier and the client would
just wait indefinitely. Ideally, the client would choose not to waiat, but
it currently there's no way the client would discover what is going on.

https://bugzilla.redhat.com/show_bug.cgi?id=1446367
2017-05-10 13:17:23 +02:00
Thomas Haller
1f2b5a2032 travis: fix build due to missing libcurl library
Since using libcurl for connectivity checks, we failed to build
with connectivity checking on travis. Fix that by installing the
required library (from trusty).

Fixes: 4e6967e33d
2017-05-10 13:10:19 +02:00
Francesco Giudici
faa1b85dab build: set --enable-conckeck as default
connectivity check functionality should be explicitly set as disabled if
not wanted: this prevents building NM without connectivity check support
without any evident warning on systems where libcurl is not installed.

(cherry picked from commit 4e6967e33d)
2017-05-10 09:25:49 +02:00
Francesco Giudici
170e6b7772 build: restore --enable-concheck as default if libcurl is detected
Recently we removed libsoup dependency in favor of libcurl.
Connectivity checking functionality was enabled by defaut when libsoup
was detected: do the same now when detecting libcurl.

(cherry picked from commit ad35fbf3a3)
2017-05-10 09:19:47 +02:00
Francesco Giudici
4e6967e33d build: set --enable-conckeck as default
connectivity check functionality should be explicitly set as disabled if
not wanted: this prevents building NM without connectivity check support
without any evident warning on systems where libcurl is not installed.
2017-05-10 09:11:48 +02:00
Beniamino Galvani
227bc5ed27 dhcp: merge branch 'bg/dhcp-full-hostname-rh1443437'
https://bugzilla.redhat.com/show_bug.cgi?id=1443437
(cherry picked from commit 31e063fcb2)
2017-05-09 22:45:53 +02:00
Beniamino Galvani
75884c3aff dhcp: allow FQDNs in ipv4.dhcp-hostname
If users wrote a FQDN in ipv4.dhcp-hostname presumably it's because
they really want to send the full value, not only the host part, so
let's send it as-is.

This obviously is a change in behavior, but only for users that have a
FQDN in ipv4.dhcp-hostname, where it's not clear if they really want the
domain to be stripped.

When the property is unset, we keep sending only the host part of the
system hostname to maintain backwards compatibility.

This commit aligns NM behavior to initscripts.

(cherry picked from commit cf5fab8f55)
2017-05-09 22:43:02 +02:00
Beniamino Galvani
099b790d2b dhcp: simplify how hostname and FQDN are passed down to backends
Since they are mutually exclusive, pass a string and a boolean to
indicate whether we want to use the hostname or the FQDN option.

(cherry picked from commit d286aa9dfa)
2017-05-09 22:42:29 +02:00
Francesco Giudici
f4226e750f manager: avoid generating in memory connections during startup for managed devices
Commit #acf1067a allowed to assume connections on already managed
devices. Anyway, in complex scenario with layered connections, during
the startup of NetworkManager, this could interfere with the connection
assumption based on saved state.
So, avoid to re-assume connections on already managed devices during
startup.

Fixes: acf1067a45
(cherry picked from commit b6b7d909f7)
2017-05-09 10:57:29 +02:00
Francesco Giudici
b6b7d909f7 manager: avoid generating in memory connections during startup for managed devices
Commit #acf1067a allowed to assume connections on already managed
devices. Anyway, in complex scenario with layered connections, during
the startup of NetworkManager, this could interfere with the connection
assumption based on saved state.
So, avoid to re-assume connections on already managed devices during
startup.

Fixes: acf1067a45
2017-05-09 10:45:39 +02:00
Beniamino Galvani
179ad1ee2e dhcp: set @was_active flag for external activations
Set the @was_active flag for external activations with DHCP, so that
DHCP is retried multiple times in case of failure, as we do for
managed connections when the lease expires and for assumed
connections.

Fixes test: renewal_gw_after_dhcp_outage_for_assumed_var1
Fixes: e3113fdc4b

(cherry picked from commit ddfeed4530)
2017-05-08 15:44:14 +02:00
Beniamino Galvani
ddfeed4530 dhcp: set @was_active flag for external activations
Set the @was_active flag for external activations with DHCP, so that
DHCP is retried multiple times in case of failure, as we do for
managed connections when the lease expires and for assumed
connections.

Fixes test: renewal_gw_after_dhcp_outage_for_assumed_var1
Fixes: e3113fdc4b
2017-05-08 15:43:30 +02:00
Beniamino Galvani
e6ff7f211d platform: fix double initialization
(cherry picked from commit 708ee92c29)
2017-05-08 15:05:01 +02:00
Beniamino Galvani
2aeb8dbadd device: fix check in addrconf6_start()
We check the return value of _get_stable_id(); when it is NULL
priv->ndisc would stay NULL too and we would crash when dereferencing
@error.

Actually, _get_stable_id() can never return NULL, so replace the check
with an assertion.

(cherry picked from commit 8b73812062)
2017-05-08 15:04:59 +02:00
Beniamino Galvani
5adf360e97 ip-tunnel: fix coverity warnings
src/devices/nm-device-ip-tunnel.c:257:8: warning: Branch condition evaluates to a garbage value
                        if (local4)
                            ^~~~~~

src/devices/nm-device-ip-tunnel.c:264:8: warning: Branch condition evaluates to a garbage value
                        if (remote4)
                            ^~~~~~~

(cherry picked from commit aaaefd827e)
2017-05-08 15:04:58 +02:00
Beniamino Galvani
708ee92c29 platform: fix double initialization 2017-05-08 15:01:39 +02:00
Beniamino Galvani
8b73812062 device: fix check in addrconf6_start()
We check the return value of _get_stable_id(); when it is NULL
priv->ndisc would stay NULL too and we would crash when dereferencing
@error.

Actually, _get_stable_id() can never return NULL, so replace the check
with an assertion.
2017-05-08 15:01:39 +02:00
Beniamino Galvani
aaaefd827e ip-tunnel: fix coverity warnings
src/devices/nm-device-ip-tunnel.c:257:8: warning: Branch condition evaluates to a garbage value
                        if (local4)
                            ^~~~~~

src/devices/nm-device-ip-tunnel.c:264:8: warning: Branch condition evaluates to a garbage value
                        if (remote4)
                            ^~~~~~~
2017-05-08 15:01:39 +02:00
Beniamino Galvani
492bdea3f2 clients: print expected route syntax on parsing failure
Now that routes can include optional attributes, print the expected
syntax in case of parsing failure.

 $ nmcli connection modify dummy ipv4.routes a
 Error: failed to modify ipv4.routes: invalid route: Invalid IPv4
 address 'a'. The valid syntax is: 'ip[/prefix] [next-hop] [metric]
 [attribute=val]... [,ip[/prefix] ...]'.

(cherry picked from commit 00df57a066)
2017-05-08 10:42:05 +02:00