Commit graph

19276 commits

Author SHA1 Message Date
Rodrigo
38d8d10249 po: update Spanish (es) translation (bgo #796849)
https://bugzilla.gnome.org/show_bug.cgi?id=796849
2018-08-01 15:07:55 +02:00
Beniamino Galvani
cd6c17cb21 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)
(cherry picked from commit a03b867ba4)
2018-07-04 14:15:33 +02:00
Lubomir Rintel
00bdd67e08 ovs: only finish waiting for a link when we actually got one
https://bugzilla.redhat.com/show_bug.cgi?id=1546659
(cherry picked from commit 7af1bc7cf0)
2018-06-19 10:12:38 +02:00
Thomas Haller
ce5b8ac8a4 release: bump version to 1.10.11 (development) 2018-06-16 08:48:38 +02:00
Thomas Haller
25c3239d04 release: bump version to 1.10.10 2018-06-16 08:48:38 +02:00
Thomas Haller
8d4d3f8246 release: update NEWS 2018-06-16 08:48:38 +02:00
Thomas Haller
dccc449522 ifnet: avoid compiler warning about casting function pointers
../../src/settings/plugins/ifnet/nms-ifnet-plugin.c: In function ‘monitor_file_changes’:
  ../../src/settings/plugins/ifnet/nms-ifnet-plugin.c:140:42: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, GObject *)’ {aka ‘void (*)(void *, struct _GObject *)’} [-Werror=cast-function-type]
     g_object_weak_ref (G_OBJECT (monitor), (GWeakNotify) g_free,
                                            ^
2018-06-16 08:48:38 +02:00
Thomas Haller
28cf2ecd0d device: fix crash during reapply
Fixes: bf3b3d444c
(cherry picked from commit fe1f5871c8)
2018-06-15 09:13:49 +02:00
Lubomir Rintel
66b35bc5a2 Revert "platform/wifi: do not double-free nl_msg"
I've applied this without much thinking. Despite applying cleanly it
doesn't do the right thing before nm_auto_nlmsg was introduced.
Whoops.

This reverts commit bc41a9ba75.
2018-06-01 12:08:14 +02:00
Lubomir Rintel
783093f04f ifnet: add dependency on nm-core-enum-types.h
Fixes parallel build:

  In file included from src/settings/plugins/ifnet/nms-ifnet-connection.c:22:
  In file included from ./shared/nm-default.h:203:
  In file included from ./src/nm-logging.h:25:
  ./libnm-core/nm-core-types.h:28:10: fatal error: 'nm-core-enum-types.h' file not found
  #include "nm-core-enum-types.h"
           ^~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  make[2]: *** [Makefile:13628: src/settings/plugins/ifnet/src_settings_plugins_ifnet_libnm_settings_plugin_ifnet_la-nms-ifnet-connection.lo] Error 1
2018-06-01 11:04:12 +02:00
Lubomir Rintel
520542fc45 ppp-manager: fix build with GCC 8
src/ppp/nm-ppp-manager.c: In function ‘monitor_cb’:
src/ppp/nm-ppp-manager.c:184:2: error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
  strncpy (req.ifr_name, priv->ip_iface, sizeof (req.ifr_name));
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-06-01 10:58:46 +02:00
Lubomir Rintel
5052c8793d build: add a missing dependency
Parallel make failed for me:

  /usr/bin/xsltproc --output man/nm-settings-keyfile.xml ...
    ... man/nm-settings-keyfile.xsl libnm/nm-settings-keyfile-docs.xml
  man/nm-settings-keyfile.xsl:4: warning: failed to load external entity "man/common.ent"
  %entities;
            ^
  man/nm-settings-keyfile.xsl:26: parser error : Entity 'NM_VERSION' not defined
          <refmiscinfo class="version">&NM_VERSION;</refmiscinfo>
                                                   ^
  cannot parse man/nm-settings-keyfile.xsl
  make[2]: *** [Makefile:18130: man/nm-settings-keyfile.xml] Error 4

(cherry picked from commit 43e3ebfaa2)
2018-06-01 10:55:13 +02:00
Alfonso Sánchez-Beato
bc41a9ba75 platform/wifi: do not double-free nl_msg
In some places, there was an unneeded call to nlmsg_free () for
messages declared with the nm_auto_nlmsg macro.

(cherry picked from commit cdbd99c5d5)
2018-06-01 10:44:43 +02:00
Frederic Danis
c3fc960587 devices/wwan: Stop PPP manager in deactivate_cleanup()
When ModemManager exits, pppd is not killed due to nm_exported_object not
unexported (ppp_manager refcount = 2).
Call to nm_ppp_manager_stop_sync() allows to correctly clean ppp_manager
before calling g_clear_object(), as this is done in nm-device-ethernet.c and
nm-device-adsl.c.

[thaller@redhat.com: rebase and adjust patch]

https://bugzilla.gnome.org/show_bug.cgi?id=796108

https://mail.gnome.org/archives/networkmanager-list/2018-May/msg00015.html
(cherry picked from commit 227e179560)
2018-05-18 10:17:32 +02:00
Thomas Haller
cf6a5e0f0a wwan: disconnect signals from ppp-manager before clearing instance
(cherry picked from commit bc3aebbab8)
2018-05-18 10:17:27 +02:00
Beniamino Galvani
7ce845a2a2 release: bump version to 1.10.9 (development) 2018-05-11 16:20:59 +02:00
Beniamino Galvani
cb96d787c9 release: bump version to 1.10.8 2018-05-11 16:18:31 +02:00
Beniamino Galvani
d17a9aa99a release: update NEWS 2018-05-11 16:16:54 +02:00
Beniamino Galvani
f03ae35593 device: start IP configuration when master carrier goes up
If the master has no carrier in act_stage3_ip6_config_start(), we set
IP state WAIT and wait until carrier goes up before starting IP
configuration.

However, in carrier_changed() if the device state is ACTIVATED we only
call nm_device_update_dynamic_ip_setup(), which just restarts DHCP if
it was already running.

Let's also ensure that we start IP configuration if the IP state is
WAIT.

Fixes: b0f6baad90

https://bugzilla.redhat.com/show_bug.cgi?id=1575944
(cherry picked from commit 1829126f3a)
2018-05-09 14:22:23 +02:00
Beniamino Galvani
7fbbe7ebee dhcp: handle expiry by letting the client continue for some time
Previously we would kill the client when the lease expired and we
restarted it 3 times at 2 minutes intervals before failing the
connection. If the client is killed after it received a NACK from the
server, it doesn't have the chance to delete the lease file and the
next time it is started it will request the same lease again.

Also, the previous restart logic is a bit convoluted.

Since clients already know how to deal with NACKs, let them continue
for a grace period after the expiry. When the grace period ends, we
fail the method and this can either fail the whole connection or keep
it active depending on the may-fail configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=783391
(cherry picked from commit 17009ed91d)
2018-05-05 15:22:00 +02:00
Stas Solovey
e1b98a7503 po: updated Russian (ru) translation (bgo #794737)
https://bugzilla.gnome.org/show_bug.cgi?id=794737
2018-04-27 13:31:33 +02:00
Beniamino Galvani
7eedaea83c manager: trust the state file more when assuming connections
If we can't generate a connection and maybe_later is TRUE, it means
that the device can generate/assume connections but it failed for the
moment due to missing master/slaves/addresses. In this case, just
assume the connection from state file.

https://bugzilla.redhat.com/show_bug.cgi?id=1551958
(cherry picked from commit 236edfc908)
2018-04-23 14:07:57 +02:00
Thomas Haller
8e64c4fa76 manager: don't coalesce duplicate internal activations with different reasons
When combining internal activations, do that only if their reason also
matches.

Fixes: 4985ca5ada
(cherry picked from commit 786adf969c)
2018-04-12 15:59:40 +02:00
Lubomir Rintel
aeaa895049 session-monitor: fix a -Wcast-function-type warning
See-Also: ee916a1e9e
(cherry picked from commit b686dd8488)
2018-04-12 14:08:05 +02:00
Lubomir Rintel
42913505a3 all: fix -Wcast-function-type warnings
GCC 8.0's -Wcast-function-type objects casting function pointers to ones
with incompatible prototypes. Sometimes we do that on purpose though.

Notably, the g_source_set_callback()'s func argument can point to functions
of various prototypes. Also, libnm-glib/nm-remote-connection is perhaps
just not worth reworking, that would just be a waste of time.

A cast to void(*)(void) avoids the GCC warning, let's use it.

(cherry picked from commit ee916a1e9e)
2018-04-12 14:07:51 +02:00
Lubomir Rintel
92b78c187a platform/nmp-object: make nmp_object_unref() return void
This makes its prototype compatible with GDestroyNotify so that GCC 8.0
won't warn.

The return value is not used anywhere and the unref() functions typically
don't return any.

(cherry picked from commit 3113e193c0)
2018-04-12 14:07:45 +02:00
Lubomir Rintel
77e4af1991 shared/utils/dedup-multi: make nm_dedup_multi_obj_unref() return void
This makes its prototype compatible with GDestroyNotify so that GCC 8.0
won't warn.

The return value is not used anywhere and the unref() functions typically
don't return any.

(cherry picked from commit 411e72b3c9)
2018-04-12 14:07:35 +02:00
Lubomir Rintel
17b488cfd5 libnm/vpn-plugin: avoid bad function pointer type casts
This makes GCC 8.0 unhappy and it is probably right about that -- it's more
difficult to get things wrong when the function prototypes actually match.

(cherry picked from commit 7f7207f36b)
2018-04-12 10:58:08 +02:00
Beniamino Galvani
0a1b1a4e5c device: look at 'all' rp_filter value too to determine actual value
Currently we overwrite the interface rp_filter value with 2 ("loose")
only when it is 1 ("strict") because when it is 0 ("no validation") it
is already more permissive.

So, if the value for the interface is 0 and
net/ipv4/conf/all/rp_filter is 1 (like it happens by default on Fedora
28), we don't overwrite it; since kernel considers the maximum between
{all,$dev}/rp_filter, the effective value remains 'strict'.

We should instead combine the two {all,$dev}/rp_filter, and if it's 1
overwrite the value with 2.

https://bugzilla.redhat.com/show_bug.cgi?id=1565529
(cherry picked from commit 150cf44d50)
2018-04-12 10:18:37 +02:00
Beniamino Galvani
58df222cbb core: merge branch 'bg/autoconnect-slaves-rh1548265'
https://bugzilla.redhat.com/show_bug.cgi?id=1548265
(cherry picked from commit 7a063a91c7)
2018-04-09 15:24:52 +02:00
Beniamino Galvani
370f84081c manager: allow autoconnect-slaves to reconnect the same connection
When a master connection is activated and has autoconnect-slaves=yes,
we want to reactivate an existing slave connection even if it is
already active.

https://bugzilla.redhat.com/show_bug.cgi?id=1548265
(cherry picked from commit 4985ca5ada)
2018-04-09 15:24:24 +02:00
Beniamino Galvani
ca12c0fafb core: specify an activation reason for active connections
Specify a reason when creating active connections. The reason will be
used in the next commit to tell whether slaves must be reconnected or
not if a master has autoconnect-slaves=yes.

(cherry picked from commit 43a0f47ea2)
2018-04-09 15:24:11 +02:00
Thomas Haller
f9fc0b7ec8 Revert "core: merge branch 'bg/restart-assume-rh1551958'"
This reverts commit cc1920d714, reversing
changes made to eb8257dea5.

This breaks restart, at least for Wi-Fi devices:

    #0  0x00007ffff5ee8771 in _g_log_abort (breakpoint=breakpoint@entry=1) at gmessages.c:554
    #1  0x00007ffff5ee9a5b in g_logv (log_domain=0x7ffff671a738 "GLib-GIO", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffd720) at gmessages.c:1362
    #2  0x00007ffff5ee9baf in g_log (log_domain=log_domain@entry=0x7ffff671a738 "GLib-GIO", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff5f347ea "%s: assertion '%s' failed") at gmessages.c:1403
    #3  0x00007ffff5eea0f9 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7ffff671a738 "GLib-GIO", pretty_function=pretty_function@entry=0x7ffff673fc10 <__func__.25628> "g_dbus_proxy_call_internal", expression=expression@entry=0x7ffff673fb1c "G_IS_DBUS_PROXY (proxy)") at gmessages.c:2702
    #4  0x00007ffff66cdc5f in g_dbus_proxy_call_internal (proxy=0x0, method_name=method_name@entry=0x555555810510 "Scan", parameters=0x555555c7a530, flags=flags@entry=G_DBUS_CALL_FLAGS_NONE, timeout_msec=timeout_msec@entry=-1, fd_list=fd_list@entry=0x0, cancellable=0x0, callback=0x55555574cb96 <scan_request_cb>, user_data=0x555555ac2220) at gdbusproxy.c:2664
    #5  0x00007ffff66cf686 in g_dbus_proxy_call (proxy=<optimized out>, method_name=method_name@entry=0x555555810510 "Scan", parameters=<optimized out>, flags=flags@entry=G_DBUS_CALL_FLAGS_NONE, timeout_msec=timeout_msec@entry=-1, cancellable=cancellable@entry=0x0, callback=0x55555574cb96 <scan_request_cb>, user_data=0x555555ac2220) at gdbusproxy.c:2970
    #6  0x000055555574e026 in nm_supplicant_interface_request_scan (self=0x555555ac2220 [NMSupplicantInterface], ssids=ssids@entry=0x0) at src/supplicant/nm-supplicant-interface.c:1821
    #7  0x00007fffe1038276 in request_wireless_scan (self=self@entry=0x555555c6ee60 [NMDeviceWifi], periodic=periodic@entry=0, force_if_scanning=force_if_scanning@entry=0, ssids=<optimized out>, ssids@entry=0x0) at src/devices/wifi/nm-device-wifi.c:1347
    #8  0x00007fffe1039011 in device_state_changed (device=0x555555c6ee60 [NMDeviceWifi], new_state=NM_DEVICE_STATE_DISCONNECTED, old_state=<optimized out>, reason=<optimized out>)
        at src/devices/wifi/nm-device-wifi.c:2998
    #9  0x00007ffff432ed1e in ffi_call_unix64 () at ../src/x86/unix64.S:76
    #10 0x00007ffff432e68f in ffi_call (cif=cif@entry=0x7fffffffdc70, fn=fn@entry=0x7fffe1038e1e <device_state_changed>, rvalue=<optimized out>, avalue=avalue@entry=0x7fffffffdb60)
        at ../src/x86/ffi64.c:525
    #15 0x00007ffff63db66f in <emit signal ??? on instance 0x555555c6ee60 [NMDeviceWifi]> (instance=instance@entry=0x555555c6ee60, signal_id=<optimized out>, detail=detail@entry=0)
        at gsignal.c:3447
        #11 0x00007ffff63bff39 in g_cclosure_marshal_generic (closure=0x555555c22ea0, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1490
        #12 0x00007ffff63bf73d in g_closure_invoke (closure=0x555555c22ea0, return_value=0x0, n_param_values=4, param_values=0x7fffffffdea0, invocation_hint=0x7fffffffde20) at gclosure.c:804
        #13 0x00007ffff63d1f30 in signal_emit_unlocked_R (node=node@entry=0x555555c22750, detail=detail@entry=0, instance=instance@entry=0x555555c6ee60, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffdea0) at gsignal.c:3673
        #14 0x00007ffff63dad05 in g_signal_emit_valist (instance=0x555555c6ee60, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffe0b0) at gsignal.c:3391
    #16 0x00005555556f0f18 in _set_state_full (self=self@entry=0x555555c6ee60 [NMDeviceWifi], state=state@entry=NM_DEVICE_STATE_DISCONNECTED, reason=reason@entry=NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED, quitting=quitting@entry=0) at src/devices/nm-device.c:13268
    #17 0x00005555556f1774 in nm_device_state_changed (self=self@entry=0x555555c6ee60 [NMDeviceWifi], state=state@entry=NM_DEVICE_STATE_DISCONNECTED, reason=reason@entry=NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED) at src/devices/nm-device.c:13435
    #18 0x00005555555bcf95 in recheck_assume_connection (self=self@entry=0x555555b09140 [NMManager], device=device@entry=0x555555c6ee60 [NMDeviceWifi]) at src/nm-manager.c:2297
    #19 0x00005555555bd53e in _device_realize_finish (self=self@entry=0x555555b09140 [NMManager], device=device@entry=0x555555c6ee60 [NMDeviceWifi], plink=plink@entry=0x555555ae43d8)
        at src/nm-manager.c:2473
    #20 0x00005555555c01d0 in platform_link_added (self=self@entry=0x555555b09140 [NMManager], ifindex=<optimized out>, plink=plink@entry=0x555555ae43d8, guess_assume=<optimized out>, dev_state=<optimized out>) at src/nm-manager.c:2789
    #21 0x00005555555c0cec in platform_query_devices (self=self@entry=0x555555b09140 [NMManager]) at src/nm-manager.c:2901
    #22 0x00005555555c439e in nm_manager_start (self=0x555555b09140 [NMManager], error=<optimized out>) at src/nm-manager.c:5632
    #23 0x000055555558498e in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:413

(cherry picked from commit d18d292b69)
2018-04-06 14:45:19 +02:00
Beniamino Galvani
d930de2609 core: merge branch 'bg/restart-assume-rh1551958'
https://bugzilla.redhat.com/show_bug.cgi?id=1551958
(cherry picked from commit cc1920d714)
2018-04-04 13:38:38 +02:00
Beniamino Galvani
88dfa2e42e core: remove @indicated argument of nm_utils_match_connection()
It is not needed anymore.

(cherry picked from commit 346064189a)
2018-04-04 13:38:23 +02:00
Beniamino Galvani
8d3eca7955 manager: relax checks for assuming connections after restart
Instead of generating a connection and checking whether it is
compatible with the connection indicated in the state file, just pick
the indicated connection after a basic check of compatibility with the
device.

https://bugzilla.redhat.com/show_bug.cgi?id=1551958
(cherry picked from commit f0357b8f6c)
2018-04-04 13:38:21 +02:00
Beniamino Galvani
34ca168071 manager: retry activating devices when the parent becomes managed
Since commit ed640f857a ("manager: ignore unmanaged devices when
looking for parent by UUID"), unmanaged devices are ignored when
looking for potential parent connection matches. Therefore, a software
device can fail autoactivation because the parent is not managed yet
and NM never tries to reactivate it. Ensure that we retry other
devices when a parent device becomes managed.

Fixes: ed640f857a

https://bugzilla.redhat.com/show_bug.cgi?id=1553595
(cherry picked from commit 6493bd443f)
2018-03-22 13:50:01 +01:00
Thomas Haller
e9faff5fd7 connectivity: fix evaluating @what argument of CURLMOPT_SOCKETFUNCTION
It's not a bitfields, it's documented to be an enum with 4
possible values.

(cherry picked from commit 89ccfa8dde)
2018-03-19 14:49:22 +01:00
Thomas Haller
d29ba1bbbe connectivity: fix timeout handling for curl
g_timeout_add() expects the timeout in milliseconds, not seconds.

Reported-by: Serban Iorga <serban300@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=794464

Fixes: 7307dea9c4
(cherry picked from commit bfe60cb7b9)
2018-03-19 14:49:22 +01:00
Thomas Haller
71175e3d4f connectivity: fix integer type for signal-id NMDevicePrivate.concheck_periodic_id
(cherry picked from commit b680d118ee)
2018-03-19 14:49:22 +01:00
Thomas Haller
06569528ce arping/tests: better handle wait timeout for test IPv4 DAD
The test tries to do IPv4 DAD. That necessarily involves waiting
for a timeout. Since the NMArpingManager spawns arping processes,
the precise timings depend on the load of the machine and may be
large in some cases.

Usually, our test would run fast to successful completion.
However, sometimes, it can take several hundered milliseconds.

Instead of increasing the timeout to a large value (which would
needlessly extend the run time of our tests in the common cases),
try first with a reasonably short timeout. A timeout which commonly
results in success. If the test with the short timeout fails, just
try again with an excessively large timeout.

This saves about 400 msec for the common case, but extends the
races that we saw where not even 250 msec of wait time were
sufficient.

(cherry picked from commit 059d34a27f)
2018-03-15 11:41:57 +01:00
Thomas Haller
4c9ebd5abb release: bump version to 1.10.7 (development) 2018-03-12 13:51:59 +01:00
Thomas Haller
dd8cf21cea release: bump version to 1.10.6 2018-03-12 13:51:59 +01:00
Thomas Haller
c8cfd713a0 release: update NEWS 2018-03-12 13:51:59 +01:00
Benjamin Berg
e1b99d9201 Add calls to g_simple_async_result_set_check_cancellable
If an operation is cancelled through the GCancellable, then the idiom is
that the operation is always cancelled, even if it has finished
successfully. To ensure this is the case, add calls to
g_simple_async_result_set_check_cancellable everywhere.

Without this, e.g. gnome-control-center will crash when switching away
from the power panel quickly, as the NMClient creation finishes
asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to
ensure it doesn't access the now invalid user_data parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=794088
(cherry picked from commit 26c215e22d)
2018-03-08 15:02:40 +01:00
Fabian Vogt
0824a32703 policy: fix blocking autoconnect for no-secrets
The condition was obviosly inverted, blocking autoconnect when
it should not, and not blocking it when it should.

[thaller@redhat.com: modified original patch and rewrite commit message]

Fixes: e2c8ef45ac

https://bugzilla.gnome.org/show_bug.cgi?id=794014
(cherry picked from commit d2f019409d)
2018-03-08 11:35:26 +01:00
Beniamino Galvani
596d59bda0 platform: don't require cloned flag for RTM_GETROUTE IPv6 result
IPv4 routes that are a response to RTM_GETROUTE must have the cloned
flag while IPv6 routes don't have to. Don't check the flag for IPv6
routes and add a test case to verify that RTM_GETROUTE works for IPv6.

https://bugzilla.gnome.org/show_bug.cgi?id=793962
(cherry picked from commit 2d1fad641b)
2018-03-05 18:51:08 +01:00
Thomas Haller
b8b59478e6 core: fix leaking connection in impl_settings_add_connection_helper()
Fixes: 0f6baeef35
(cherry picked from commit 608dfacb0b)
2018-02-28 12:18:33 +01:00
Thomas Haller
dad2269fbd core: fix typo for parameter as "paramter"
(cherry picked from commit 19a78f8954)
2018-02-28 12:18:32 +01:00
Thomas Haller
878baf7b33 dhcp: fix uninitialized pointer in DHCP listener's _method_call_handle()
Fixes: f67269b49d
(cherry picked from commit 6292851248)
2018-02-28 06:47:11 +01:00