Commit graph

20510 commits

Author SHA1 Message Date
Lubomir Rintel
e2bc6ba935 release: bump version to 1.12.3 (development) 2018-07-25 12:32:34 +02:00
Lubomir Rintel
1e74a4b43e release: bump version to 1.12.2 2018-07-25 12:21:34 +02:00
Lubomir Rintel
e4c40c809f release: update NEWS 2018-07-25 12:17:57 +02:00
Lubomir Rintel
834f7946f6 contrib/rpm: add RHEL connectivity checking package
https://github.com/NetworkManager/NetworkManager/pull/166
(cherry picked from commit c40dbeb49a)
2018-07-25 12:16:30 +02:00
Lubomir Rintel
50e4afdcd8 contrib/rpm: use whitespace consistently
Double newline is used to visually separate sections.

(cherry picked from commit 3f449654f7)
2018-07-25 12:16:29 +02:00
Lubomir Rintel
be106d6e19 build: do not randomize tests by default
We don't want the users to default to running the code paths in tests that
we didn't check before. They may end up failing randomly.

(cherry picked from commit 9c6ff7fe18)
2018-07-24 20:19:04 +02:00
Lubomir Rintel
c252851f00 rpm: own /etc/sysconfig/network-scripts
We don't rely on initscripts. If they're gone, we still use the
directory.

(cherry picked from commit 0413704470)
2018-07-24 20:18:16 +02:00
Lubomir Rintel
8d09660481 libnm: add accessors for ovs port/bridge slaves
(cherry picked from commit 5f30a2b525)
2018-07-24 19:08:38 +02:00
Lubomir Rintel
9e015bab81 devices/ovs: expose slaves on D-Bus for OVS bridges and ports
[lkundrak@v3.sk: changed 1.14 to 1.12.2]

(cherry picked from commit 8d65f636e1)
2018-07-24 19:08:38 +02:00
Lubomir Rintel
995ed66cda all/trivial: grammar fix
(cherry picked from commit 889961f8b6)
2018-07-24 19:08:38 +02:00
Thomas Haller
f0c84b5240 gitignore: ignore config-extra.h
Master added the generated header "config-extra.h".
That file does not exist on this branch, so when
switching branches, this file shows up as untracked.

Just let git ignore it.
2018-07-24 17:35:34 +02:00
Thomas Haller
80fa0604d0 connectivity: merge branch 'th/connectivity-busy-loop-fix'
(cherry picked from commit 057c7b94a0)
2018-07-24 17:31:48 +02:00
Thomas Haller
660e308dd2 connectivity: avoid busy looping with connectivity-check failed
It seems, curl_multi_socket_action() can fail with

  connectivity check failed: 4

where "4" means CURLM_INTERNAL_ERROR.

When that happens, it also seems that the file descriptor may still have data
to read, so the glib IO callback _con_curl_socketevent_cb() will be called in
an endless loop. Thereby, keeping the CPU busy with doing nothing (useful).

Workaround by disabling polling on the file descriptor when something
goes wrong.

Note that optimally we would cancel the affected connectivity-check
right away. However, due to the design of libcurl's API, from within
_con_curl_socketevent_cb() we don't know which connectivity-checks
are affected by a failure on this file descriptor. So, all we can do
is avoid polling on the (possibly) broken file descriptor. Note that
we anyway always schedule a timeout of last resort for each check. Even
if something goes very wrong, we will fail the check within 15 seconds.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903996
(cherry picked from commit 884a28b28c)
2018-07-24 17:31:32 +02:00
Thomas Haller
4af9ae13e0 connectivity: add compile time check that "curl_socket_t" is a typedef to plain "int"
On non-Windows, libcurl's "curl_socket_t" type is just a typedef for
int. We rely on that, because we use it as file descriptor.

Add a compile time check to ensure that.

(cherry picked from commit 970af59731)
2018-07-24 17:31:32 +02:00
Thomas Haller
a54ffc6c01 connectivity/trivial: rename socket argument in multi_socket_cb() callback
"s" might be a good name for a temporary string.

But here it's really a file descriptor. Call it "fd".

(cherry picked from commit cd0bd8a2ee)
2018-07-24 17:31:32 +02:00
Thomas Haller
abd994d916 connectivity/trivial: rename local functions to avoid "curl" prefix
Since this is "C" there are not namespaces and libraries commonly choose
a particular name prefix for their symbols.

In case of libcurl, that is "curl_".

We should avoid using the same name prefix, and choose something distinct.

(cherry picked from commit a24f118a1f)
2018-07-24 17:31:32 +02:00
Lubomir Rintel
7e8425de52 setting-connection: fix ovs-port parent setting verification
$ nmcli c add type ovs-port ifname ovsport0
  Error: Failed to add 'ovs-port-ovsport0' connection: connection.type:
      Only 'ovs-port' connections can be enslaved to 'ovs-bridge'

nm_streq0() is not good here. It fails (with a wrong error message) even
when the slave_type is not set, which it shouldn't since slave_type can
be normalized. The real problem is the lack of the master property.

This fixes the condition:

  $ nmcli c add type ovs-port ifname ovsport0
  Error: Failed to add 'ovs-port-ovsport0' connection: connection.master:
    A connection with a 'ovs-port' setting must have a master.

Corrects the error message:

  $ nmcli c add con-name br0 type bridge
  $ nmcli c add type ovs-port ifname ovsport0 parent br0
  Error: Failed to add 'bridge-slave-ovsport0' connection: connection.slave-type:
    'ovs-port' connections must be enslaved to 'ovs-bridge', not 'bridge'

And gets rid of a confusing nm_streq0 use when comparing the type, since
at that point type must not be NULL anymore.

Fixes: 4199c976da
(cherry picked from commit 354140e8d3)
2018-07-13 20:54:58 +02:00
Jan Alexander Steffens (heftig)
461f511227 wifi/ifd: Allow D-Bus activation to launch iwd
iwd does not ship activation configuration yet; until then we simply
fail the way we already do.

https://bugzilla.gnome.org/show_bug.cgi?id=796805
(cherry picked from commit 21f955b4dd)
2018-07-13 20:54:17 +02:00
Beniamino Galvani
87cd30c7d9 device: destroy pending acd-managers when the device disconnects
We previously kept any acd-manager running if the device was
disconnected. It was possible to trigger a crash by setting a long
dad-timeout and interrupting the activation request:

  nmcli con add type ethernet ifname eth0 con-name eth0+ ip4 1.2.3.4/32
  nmcli con mod eth0+ ipv4.dad-timeout 10000
  nmcli -w 2 con up eth0+
  nmcli con down eth0+

After this, the n-acd timer would fire after 10 seconds and try to
disconnect an already disconnected device, throwing the assertion:

  NetworkManager:ERROR:src/devices/nm-device.c:9845:
  activate_stage5_ip4_config_result: assertion failed: (req)

Fixes: 28f6e8b4d2
(cherry picked from commit 260cded3d6)
2018-07-11 17:28:22 +02:00
Thomas Haller
d2b4a6c35b connectivity: downgrade verbosity of error logging
Such failures during connectivity checks, may happen frequently
and due to external causes. Don't log with error level to avoid
spamming the logfile.

(cherry picked from commit ca9981eb5d)
2018-07-11 16:44:28 +02:00
Beniamino Galvani
9748aef7c7 manager: accept non-null device for VPN activations
Commit 10753c3616 ("manager: merge VPN handling into
_new_active_connection()") added a check to fail the activation of
VPNs when a device is passed to ActivateConnection(), since the device
argument is ignored for VPNs.

This broke activating VPNs from nm-applet as nm-applet sets both the
specific_object (parent-connection) and device arguments in the
activation request.

Note that we already check in _new_active_connection() that when a
device is supplied, it matches the device of the parent
connection. Therefore, the check can be dropped.

Reported-by: Michael Biebl <biebl@debian.org>
Fixes: 10753c3616

https://github.com/NetworkManager/NetworkManager/pull/159
(cherry picked from commit e205664ba8)
2018-07-09 13:41:42 +02:00
Thomas Haller
ffcd74e9e4 build/meson: fix meson build without pppd
Fixes: 1cdb36b8de
(cherry picked from commit 530b82a372)
2018-07-09 12:31:36 +02:00
Jan Tojnar
e117fc0b2d ppp-manager: use configured pppd path
Path to pppd can be set via configure flag but the source code ignores it.

Let's use PPPD_PATH like other calls of nm_utils_find_helper do.

https://bugzilla.gnome.org/show_bug.cgi?id=796752
(cherry picked from commit 1cdb36b8de)
2018-07-09 11:34:44 +02:00
Jan Tojnar
d23af045f6 meson: define PPPD_PATH variable
configure.ac defines it just like it defines other PATH variables
for use with nm_utils_find_helper. Meson for some reason did not.

https://bugzilla.gnome.org/show_bug.cgi?id=796752
(cherry picked from commit f3c1e7f6ab)
2018-07-09 11:34:43 +02:00
Michael Biebl
d34e5e29f4 Increase timeout in test-nm-client to 30s
On slow architectures it can take longer then 3s for the test service to
start up.

(cherry picked from commit 7ab7dc9487)
2018-07-05 17:00:30 +02:00
Beniamino Galvani
a03b867ba4 libnm: add (allow-none) annotations to nm_device_reapply()
The @connection argument can be NULL; add the (allow-none) annotation
otherwise calling the API with a NULL argument through GObject
introspection fails with:

 Argument 1 does not allow None as a value

Fixes: 278fd4fb0f
(cherry picked from commit f396826466)
2018-07-04 14:13:28 +02:00
Beniamino Galvani
fa5fa51f4b platform: change temp variable name in NLA_PUT_TYPE()
__tmp clashes with htole16() on s390x.

Fixes: 4120ad2431

https://github.com/NetworkManager/NetworkManager/pull/151
(cherry picked from commit 4888ee7e83)
2018-07-01 18:42:35 +02:00
Thomas Haller
b693daf6ba libnm: fix missing symbols in libnm ABI
Also backport the ABI to 1.12.2 (and thus, don't bother
initially adding the API as libnm_1_14_0).

(cherry picked from commit b26efa5b68)
2018-06-30 12:40:14 +02:00
Thomas Haller
ae6661fdce release: bump version to 1.12.1 (development) 2018-06-29 17:18:00 +02:00
Thomas Haller
8964dbe8bc release: bump version to 1.12.0 2018-06-29 17:06:25 +02:00
Thomas Haller
db8696f164 release: update NEWS 2018-06-29 17:01:42 +02:00
Thomas Haller
e0dc1da411 release: fix NEWS entry for NM_DISPATCHER_ACTION
This was not backported to nm-1-10 branch.
2018-06-29 17:01:42 +02:00
Thomas Haller
f3d1cf8100 device: merge branch 'th/device-dad-handling-rh1593210'
While this fixes rh#1593210 and CI test "ipv6_keep_external_routes",
it breaks CI test "ipv6_add_static_address_manually_not_active". See
related bug rh#1585078. It seems in the short term, the fix is more
important than the new issue, hence merging.

https://bugzilla.redhat.com/show_bug.cgi?id=1593210
https://github.com/NetworkManager/NetworkManager/pull/144

(cherry picked from commit 8076a6f003)
2018-06-29 16:43:31 +02:00
Thomas Haller
1609344eda device: only check for IPv6 DAD and link-local address on actively managed devices
In device_ipx_changed() we only keep track of dad6_failed_addrs
addresses if the device's state is > DISCONNECTED.

For the same reason, we should also do that in queued_ip_config_change().

But it's worse. If the device is in state disconnected, and the user
externally adds IPv6 addresses, we will end up in queued_ip_config_change().
It is easily possible that "need_ipv6ll" ends up being TRUE, which results
in a call to check_and_add_ipv6ll_addr() and later possibly

  ip_config_merge_and_apply (self, AF_INET6, TRUE);

This in turn will modify the IP configuration on the device, although
the device may be externally managed and NetworkManager shouldn't touch it.

https://bugzilla.redhat.com/show_bug.cgi?id=1593210
(cherry picked from commit 890c748643)
2018-06-29 16:43:10 +02:00
Thomas Haller
e7ea66eb1a device: emit IP address changes in queued_ip_config_change() only once
We first iterate over addresses that might have failed IPv6 DAD and
update the state in NMNDisc.

However, while we do that, don't yet invoke the changed signal.
Otherwise, we will invoke it multiple times (in case multiple addresses
failed). Instead, keep track of whether something changed, and handle
it once a bit later.

(cherry picked from commit f312620276)
2018-06-29 16:43:10 +02:00
Thomas Haller
b638edf4a0 device: refactor handling dad6_failed_addrs in queued_ip_config_change()
Whenever we process queued IP changes, we must handle all pending
dad6_failed_addrs. This is, to ensure we don't accumulate more
and more addresses in the list.

Rework the code, by stealing the entire list once at the beginning

    dad6_failed_addrs = g_steal_pointer (&priv->dad6_failed_addrs);

and free it at the end:

    g_slist_free_full (dad6_failed_addrs, (GDestroyNotify) nmp_object_unref);

This makes it easier to see, that we always process all addresses in
priv->dad6_failed_addrs.

(cherry picked from commit e2c13af805)
2018-06-29 16:43:10 +02:00
Thomas Haller
f5b48bd973 device: split handling for dad6_failed_addrs and dad6_ip6_config in queued_ip_config_change()
There is no change in behavior, however don't handle dad6_failed_addrs
and dad6_ip6_config in the same block.

While both parts are related to IPv6 DAD, they do something rather
different:

 - the first block, checks all candidates from dad6_failed_addrs whether
   they actually indicate DAD failed, and handles them by notifying
   NMNDisc about failed addresses.

 - the second block, checks whether we have now all addresses from
   dad6_ip6_config that we are waiting for.

Split the blocks.

(cherry picked from commit 3fcdba1a19)
2018-06-29 16:43:10 +02:00
Thomas Haller
b86d8968d5 device: simplify postponing IP config change in queued_ip_config_change()
We don't need to cancel the current idle-action and schedule a new
one. Just return and wait to be called again.

Also, drop the logging. Similarly, we don't log the postponing for
the previous case either.

(cherry picked from commit 63cf5bd249)
2018-06-29 16:43:10 +02:00
Thomas Haller
171001c34d device: clear dad6_failed_addrs in _cleanup_ip_pre()
We also cancel the idle handler

  nm_clear_g_source (&priv->queued_ip_config_id_x[IS_IPv4])

which means, nobody is going to process these addresses (at least
for the moment).

The purpose of "dad6_failed_addrs" is to keep track of addresses that
might be interesting for checking about DAD failures. If we are no
longer reacting on IP changes (because the idle handler was removed),
we also no longer need these addresses.

(cherry picked from commit dbb936e5c8)
2018-06-29 16:43:10 +02:00
Thomas Haller
3ce80c8d65 device: simplify handling of IP config changes while initializing link
This simplifies commit 31ca7962f8.

We don't need the boolean flags like "queued_ip4_config_pending" to
track whether we received any platform signals while being not yet
initialized in platform (udev, NM_UNMANAGED_PLATFORM_INIT).

In general, as long as the device is NM_UNMANAGED_PLATFORM_INIT,
all platform signals are ignored. And when the device becomes managed,
we schedule anyway an initial config-change.

(cherry picked from commit 18ecc4b4f1)
2018-06-29 16:43:10 +02:00
Beniamino Galvani
5ccd7f7fd7 device: clear the dhcp grace-period source id
Fixes: 17009ed91d
(cherry picked from commit db1867bafd)
2018-06-29 16:12:14 +02:00
Thomas Haller
c2b4e8b290 mailmap: minor adjustment to mailmap not to match by name
We use the email address of the user as their ID. In this case,
there is no need to restrict the match based on the name as well.

In practice, this makes no difference at all, because these email
addresses only come with the present names.

(cherry picked from commit d1aca62475)
2018-06-29 11:10:35 +02:00
Lubomir Rintel
44cca6b31f mailmap: add mailmap
This allows us to disambiguate committers. The list was compiled
manually, with preference of latter e-mail addresses if more were used
throughout the history.

(cherry picked from commit 0eafdcd572)
2018-06-29 11:10:34 +02:00
Thomas Haller
863428ef26 clients/docs: fix generated documentation for Open vSwitch
Fixes: 9be0c3330d
(cherry picked from commit bf7b941502)
2018-06-29 09:59:51 +02:00
Lubomir Rintel
225f25e041 docs: provide soft descriptions for NM{Simple,Remote}Connection
...and order them on more logical places in the libnm manual.

(cherry picked from commit e53a7365ca)
2018-06-28 20:43:29 +02:00
Lubomir Rintel
4fa1a49542 docs: include missing documentation in libnm and D-Bus docs
Check that we don't repeat the omission in future.

(cherry picked from commit cb1172ee3d)
2018-06-28 20:43:26 +02:00
Lubomir Rintel
79fe82753d examples/qt/meson: drop dbus-glib dependency
It's not actually required.

(cherry picked from commit 22813fdc60)
2018-06-28 20:41:12 +02:00
Lubomir Rintel
b478b77558 libnm/meson: make generate_setting_docs depend on the typelib
Otherwise it would attempt to use a system-wide installed one, resulting
in sadness and misery.

(cherry picked from commit d6c08691d9)
2018-06-28 20:41:12 +02:00
Lubomir Rintel
03733911cb meson: generate-setting-docs.py environment correctly
It's ugly, because meson doesnt' seem to provide any useful facilities for
dealing with environment variables. Not my fault.

(cherry picked from commit 21840f5321)
2018-06-28 20:41:12 +02:00
Timothy Redaelli
bb9ce74a59 contrib/rpm: Use Open vSwitch instead of OpenVSwitch
The correct naming is Open vSwitch so use it instead of OpenVSwitch

[lkundrak@v3.sk: added some more cases of the same]

https://github.com/NetworkManager/NetworkManager/pull/150

Fixes: 830a5a14cb
(cherry picked from commit 9be0c3330d)
2018-06-28 20:40:13 +02:00