Commit graph

19249 commits

Author SHA1 Message Date
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
Beniamino Galvani
e4d237d86b ovs: don't consume error in method callback
The error should be freed by callback functions, but only
_monitor_bridges_cb() actually does it. Simplify this by letting the
caller own the error.

Fixes: 830a5a14cb
(cherry picked from commit 878a3a4125)
2018-02-21 14:09:39 +01:00
Beniamino Galvani
f05f12f53b ovs: add error code for callbacks to indicate NM is quitting
When NM quits it destroys all singletons including NMOvsdb, which
invokes callbacks for every pending method call. In the shutdown,
extra care must be taken to not access objects that are already in a
inconsistent state; for example here, the callback changes the device
state, and this causes an access to data that has already been
cleared:

 #0  _g_log_abort (breakpoint=breakpoint@entry=1) at gmessages.c:554
 #1  g_logv (log_domain=0x5635653b6817 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffb4b2c1e0) at gmessages.c:1362
 #2  g_log (log_domain=log_domain@entry=0x5635653b6817 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7fbb3f58fa4a "%s: assertion '%s' failed") at gmessages.c:1403
 #3  g_return_if_fail_warning (log_domain=log_domain@entry=0x5635653b6817 "NetworkManager", pretty_function=pretty_function@entry=0x5635653b6b00 <__func__.34463> "nm_device_factory_manager_find_factory_for_connection", expression=expression@entry=0x5635653b6719 "factories_by_setting") at gmessages.c:2702
 #4  nm_device_factory_manager_find_factory_for_connection (connection=connection@entry=0x56356627e0e0) at src/devices/nm-device-factory.c:243
 #5  nm_manager_get_connection_iface (self=0x563566241080 [NMManager], connection=connection@entry=0x56356627e0e0, out_parent=out_parent@entry=0x0, error=error@entry=0x0) at src/nm-manager.c:1458
 #6  check_connection_compatible (self=<optimized out>, connection=0x56356627e0e0) at src/devices/nm-device.c:4679
 #7  check_connection_compatible (device=0x56356647b1b0 [NMDeviceOvsInterface], connection=0x56356627e0e0) at src/devices/ovs/nm-device-ovs-interface.c:95
 #8  _nm_device_check_connection_available (self=0x56356647b1b0 [NMDeviceOvsInterface], connection=0x56356627e0e0, flags=NM_DEVICE_CHECK_CON_AVAILABLE_NONE, specific_object=0x0) at src/devices/nm-device.c:12102
 #9  nm_device_check_connection_available (self=self@entry=0x56356647b1b0 [NMDeviceOvsInterface], connection=0x56356627e0e0, flags=flags@entry=NM_DEVICE_CHECK_CON_AVAILABLE_NONE, specific_object=specific_object@entry=0x0) at src/devices/nm-device.c:12131
 #10 nm_device_recheck_available_connections (self=self@entry=0x56356647b1b0 [NMDeviceOvsInterface]) at src/devices/nm-device.c:12238
 #11 _set_state_full (self=self@entry=0x56356647b1b0 [NMDeviceOvsInterface], state=state@entry=NM_DEVICE_STATE_FAILED, reason=reason@entry=NM_DEVICE_STATE_REASON_OVSDB_FAILED, quitting=quitting@entry=0) at src/devices/nm-device.c:13065
 #12 nm_device_state_changed (self=self@entry=0x56356647b1b0 [NMDeviceOvsInterface], state=state@entry=NM_DEVICE_STATE_FAILED, reason=reason@entry=NM_DEVICE_STATE_REASON_OVSDB_FAILED) at src/devices/nm-device.c:13328
 #13 del_iface_cb (error=<optimized out>, user_data=0x56356647b1b0) at src/devices/ovs/nm-device-ovs-port.c:160
 #14 _transact_cb (self=self@entry=0x5635662b9ba0 [NMOvsdb], result=result@entry=0x0, error=0x563566259a10, user_data=user_data@entry=0x5635662ff320) at src/devices/ovs/nm-ovsdb.c:1449
 #15 ovsdb_disconnect (self=self@entry=0x5635662b9ba0 [NMOvsdb]) at src/devices/ovs/nm-ovsdb.c:1331
 #16 dispose (object=0x5635662b9ba0 [NMOvsdb]) at src/devices/ovs/nm-ovsdb.c:1558
 #17 g_object_unref (_object=0x5635662b9ba0) at gobject.c:3293
 #18 _nm_singleton_instance_destroy () at src/nm-core-utils.c:138
 #19 _dl_fini () at dl-fini.c:253
 #20 __run_exit_handlers (status=status@entry=0, listp=0x7fbb3e1ad6c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77
 #21 __GI_exit (status=status@entry=0) at exit.c:99
 #22 main (argc=1, argv=0x7fffb4b2cc38) at src/main.c:468

Add a new error code to indicate to callbacks that we are quitting and
no further action must be taken. This is preferable to having
additional references because it allows us to free the resources owned
by callbacks immediately, while references can easily create loops.

https://bugzilla.redhat.com/show_bug.cgi?id=1543871
(cherry picked from commit cf79615169)
2018-02-21 12:00:37 +01:00
Thomas Haller
cbebc6494a ovs/trivial: fix indentation
(cherry picked from commit 574f2744dc)
2018-02-21 12:00:37 +01:00
Andika Triwidada
7e7e6a8cb8 po: update Indonesian (id) translation (bgo #785582)
https://bugzilla.gnome.org/show_bug.cgi?id=785582
2018-02-21 11:57:41 +01:00
Francesco Giudici
bcb37e8093 dhcp: merge branch 'fg/dhcp_lease-rh1503587'
https://bugzilla.redhat.com/show_bug.cgi?id=1503587

(cherry picked from commit b9e22ece2d)
2018-02-20 18:51:42 +01:00
Francesco Giudici
b6d2ad3312 device: enable DHCPv6 retries on lease renewal failure
https://bugzilla.gnome.org/show_bug.cgi?id=792745
(cherry picked from commit 1289450146)
2018-02-20 18:45:26 +01:00
Francesco Giudici
56353bfb82 device: never stop trying renewing the lease
Always reschedule a lease renewal attempt: just clear the scheduled
renewal if the connection is really deactivated.

(cherry picked from commit 1a20ff86d5)
2018-02-20 18:45:09 +01:00
Francesco Giudici
2d98ce9018 device: always consider both ip families when deciding to fail
Example: when dhcpv4 lease renewal fails, if ipv4.may-fail was "yes",
check also if we have a successful ipv6 conf: if not fail.
Previously we just ignored the other ip family status.

(cherry picked from commit da0fee4d9f)
2018-02-20 18:44:55 +01:00
Lubomir Rintel
19c22a13b2 core/connection: don't emit Updated on Connection.GetSecrets
The secrets are transient -- when they are loaded into the connections and
subsequently cleared the connection itself doesn't change. The Update
signal is to be emmited only on explicit Update()/Update2() or
ClearSecrets() which is already the case.

Apart from Update being wrong, it has the ill effect of causing libnm to
drop secrets from the cached connection.

(cherry picked from commit 66ae0cc306)
2018-02-20 17:04:13 +01:00
Beniamino Galvani
9479a014bc 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
(cherry picked from commit f9c50bf3d3)
2018-02-15 10:16:49 +01:00
Lubomir Rintel
f71a1cfbd9 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): *********

  $

(cherry picked from commit de9b74452c)
2018-02-13 15:14:36 +01:00
Lubomir Rintel
57b347e69b 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.

(cherry picked from commit 9bf0b32cd1)
2018-02-13 15:14:35 +01:00
Lubomir Rintel
0d991026fe 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.

(cherry picked from commit 6788ced98d)
2018-02-13 11:53:55 +01:00
Lubomir Rintel
e7341d219b platform/netns: don't try to overlay ro /sys with a rw one
Linux 4.15 won't allow us. No problem.

(cherry picked from commit d7c70dd9ec)
2018-02-13 11:53:54 +01:00
Lubomir Rintel
04a6600a60 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=]"

(cherry picked from commit 85c0dc4a92)
2018-02-13 11:53:54 +01:00
Lubomir Rintel
1ace7832c8 platform/tests: (trivial) fix a typo
(cherry picked from commit 7f847d71f3)
2018-02-13 11:53:53 +01:00
Lubomir Rintel
c3e6e752e6 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.

(cherry picked from commit 984e9d5655)
2018-02-13 11:53:49 +01:00
Francesco Giudici
11f0ca1f23 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.

(cherry picked from commit fd5b3f802e)
2018-02-12 12:16:10 +01:00
Francesco Giudici
01d1f64ad4 nmcli: team: clear runner-tx-hash before adding new hashes
https://bugzilla.redhat.com/show_bug.cgi?id=1541922
(cherry picked from commit 350dbb55ab)
2018-02-12 11:46:46 +01:00
Thomas Haller
36d767e6d5 contrib/rpm: make "snapshot" for package version configurable via script
Will be used by CI trigger to name packages that are build during testing
of a github pull request with the corresponding pull request ID.

"build_clean.sh" now supports a command line option -s|--snapshot. But the
same paramter can also be set via $NM_BUILD_SNAPSHOT environment
variable. Using the environment variable is useful to support older versions
and new versions of "build_clean.sh", so that the script can just ignore the
snapshot setting if it doesn't understand it yet.

(cherry picked from commit 86a18b2df2)
2018-02-09 17:39:38 +01:00
Beniamino Galvani
1c27ee350d dns: on quit only update resolv.conf if dns=dnsmasq
Previously we always updated resolv.conf on quit. When we are using
systemd-resolved the update is not necessary because the resolver on
127.0.0.53 would still be reachable after NM quits. Also, when NM
manages resolv.conf directly there is no need to update the file
again. Let's rewrite resolv.conf only when using dnsmasq.

https://bugzilla.redhat.com/show_bug.cgi?id=1541031
(cherry picked from commit 37eed6984b)
2018-02-09 13:19:53 +01:00
Philip Withnall
338b4e6b21 libnm-util: Fix a minor type problem with GValue
The code was passing the gpointer alias of the GValue, rather than the
GValue* itself. This doesn’t matter normally, but broke an experimental
patch in GLib to remove a cast from G_VALUE_TYPE.

We’ve reverted the patch in GLib (see
https://bugzilla.gnome.org/show_bug.cgi?id=793186), but this should be
fixed in NetworkManager anyway.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=793302
(cherry picked from commit daadb8fbe9)
2018-02-08 17:48:09 +01:00
Lubomir Rintel
88cea63dfa contrib/rpm: build verbosely
The RPM build should be not use silent output -- it better be possible
to check whether the correct compiler flags were present at the build
time.

(cherry picked from commit c4c8ffd113)
2018-02-08 17:47:42 +01:00
Beniamino Galvani
258f4fc769 ppp: don't start IPv6 configuration on the device
If IPV6CP terminates before IPCP, pppd enters the RUNNING phase and we
start IP configuration without having an IP interface set, which
triggers assertions. Instead, reimplement stage3_ip6_config_start to
be a no-op. Note that IPv6 configuration on PPP devices has never been
supported by NM.

This is a simpler version of upstream commit dd98ada33f ("ppp:
introduce SetIfindex pppd plugin D-Bus method") that doesn't require
changing the internal plugin API.

https://bugzilla.redhat.com/show_bug.cgi?id=1515829
2018-02-08 09:49:26 +01:00
Thomas Haller
167ca04f37 device: merge branch 'th/device-activation-fix-rh1537160'
I was unable to actually reproduce the crash from rh1537160. But
these fixes seem right either way and might even fix the bug.

https://bugzilla.redhat.com/show_bug.cgi?id=1537160

(cherry picked from commit 665d47466a)
2018-02-07 12:56:33 +01:00
Thomas Haller
33cdfd8e0c device: gracefully handle unmanaged device during _device_activate()
(cherry picked from commit bbaa603a72)
2018-02-07 12:56:06 +01:00
Thomas Haller
26121eff14 device: don't return value from _device_activate()
It was only used at one place for an assertion. And it's not clear that the
assertion always holds.

(cherry picked from commit 9c094f93fb)
2018-02-07 12:54:53 +01:00