Commit graph

19296 commits

Author SHA1 Message Date
Thomas Haller
eca12c2ee1 device/ndisc: skip link-local addresses from NDisc
(cherry picked from commit fa09e7eb53)
2018-10-13 20:28:26 +02:00
Thomas Haller
cb5a47a4db ndisc/trivial: rename name for internal signal enum to match signal name
(cherry picked from commit ede4dd70f3)
2018-10-13 20:28:08 +02:00
Thomas Haller
8389888e08 ndisc: ensure proper lifetime of NMNDiscAddress in ndisc_set_router_config()
In ndisc_set_router_config(), we initialize NMNDiscAddress based on
NMPlatformIP6Address instances. Note that their handling of timestamps
is not entirely identical.

For convenience of the user, NMPlatformIP6Address allows to not specify
any timestamp. On the contrary, for convenience of implementation does
NMNDiscAddress always require fully specified timestamps.

Properly convert one representation into the other.

(cherry picked from commit 5c4f4b3540)
2018-10-13 20:27:20 +02:00
Thomas Haller
2ff8ece27e device: add const specifier to nm_ndisc_dad_failed() argument
(cherry picked from commit cd6cf0ea36)
2018-10-13 20:26:14 +02:00
Thomas Haller
b9dace0aa3 ndisc: adjust logging of timeouts for NDisc result
Previously, we would directly log get_expiry(), which is the absolute timestamp
inn nm_utils_get_monotonic_timestamp_s() scale. This time scale starts counting
somewhere around the time when the NetworkManager process starts, hence it is not
very intuitive to look at.

Instead, print the remaining time that is left counting from now. Since
we anyway only track timeouts with a granularity of whole seconds,
printing up to 4 decimal places is sufficiently precise.

(cherry picked from commit b680cdd063)
2018-10-13 20:25:37 +02:00
Thomas Haller
e3e86af74e wwan: don't assume DNS info is always available for IPv6
See also "5df024f57a wwan: don't assume DNS info is always available"
which does the same for IPv4.

(cherry picked from commit cec7ade86c)
(cherry picked from commit 00f14736e6)
(cherry picked from commit 7c09527d5e)
2018-10-12 00:19:20 +02:00
Lubomir Rintel
00bc0ae30c devices/olpc: correct the signal handler arguments
Commit 631ca806 ("devices/wifi: flip meaning of scanning allowed
signal") added a "periodic" argument, but the OLPC companion handler was
not adjusted. Fix it now.

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

Fixes: 631ca80692
(cherry picked from commit aa0e395530)
2018-10-09 20:27:05 +02:00
Beniamino Galvani
12e2d62673 wifi: support hidden ssid in AP mode
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/48
(cherry picked from commit 5d97e76c7d)
(cherry picked from commit f235d57a3a)
(cherry picked from commit 6f6a810189)
2018-09-27 14:21:14 +02:00
Thomas Haller
b02000a2f3 libnm/doc: explicitly point out privacy issue of setting wifi.hidden
(cherry picked from commit bca28c8c0c)
2018-09-27 14:21:10 +02:00
Thomas Haller
e74f310d30 release: bump version to 1.10.13 (development) 2018-09-18 15:21:37 +02:00
Thomas Haller
912548d37a release: bump version to 1.10.12 2018-09-18 15:21:37 +02:00
Thomas Haller
b74cd2a2b3 release: update NEWS 2018-09-18 15:21:37 +02:00
Thomas Haller
f4af4e1d5a vpn: disconnect signal handlers from proxy in NMVpnConnection::dispose()
We cannot be sure who holds a reference to the proxy, and
who is gonna call us back after the VPN connection instance
is destroyed.

(cherry picked from commit 6ebb9091d2)
(cherry picked from commit f71f9b54a8)
(cherry picked from commit 6c1cbe4d61)
2018-09-14 15:25:53 +02:00
Thomas Haller
6fd26b6a46 vpn: fix assertion during "SecretsRequired" in unexpected state
Got this assertion:

    NetworkManager[12939]: <debug> [1536917977.4868] active-connection[0x563d8fd34540]: set state deactivated (was deactivating)
    ...
    NetworkManager[12939]: nm-openvpn[1106] <info>  openvpn[1132]: send SIGTERM
    NetworkManager[12939]: nm-openvpn[1106] <info>  wait for 1 openvpn processes to terminate...
    NetworkManager[12939]: nm-openvpn[1106] <warn>  openvpn[1132] exited with error code 1
    NetworkManager[12939]: <info>  [1536917977.5035] vpn-connection[0x563d8fd34540,2fdeaea3-975f-4325-8305-83ebca5eaa26,"my-openvpn-Red-Hat",0]: VPN plugin: requested secrets; state disconnected (9)
    NetworkManager[12939]: plugin_interactive_secrets_required: assertion 'priv->vpn_state == STATE_CONNECT || priv->vpn_state == STATE_NEED_AUTH' failed

Meaning. We should either ensure that secrets_required_cb() signal callback
is disconnected from proxy's signal, or we gracefully handle callbacks at
unexpected moments. Do the latter.

(cherry picked from commit 92344dd084)
(cherry picked from commit 011dd919fa)
(cherry picked from commit 0e633c232d)
2018-09-14 15:25:52 +02:00
Thomas Haller
4a345b2e78 wifi: fix leaking fake AP in NMDeviceWifi's act_stage1_prepare()
Fixes: 96f40dcdcd
(cherry picked from commit ef61d7909f)
(cherry picked from commit d08530ac4b)
(cherry picked from commit 6c4c12c796)
2018-09-13 16:30:14 +02:00
Aleksander Morgado
eebaf181d5 policy: don't block connection if device is gone
If the active connection is deactivated because the device is gone,
don't block autoconnection. Otherwise, whenever the device comes
back (e.g. maybe it was reset in the middle of a connection attempt),
the autoconnection logic won't be triggered, as the settings are still
blocked.

I'm able to reproduce this by performing a WWAN modem reset in the
middle of a connection attempt.

https://github.com/NetworkManager/NetworkManager/pull/121
(cherry picked from commit d97eab6c5a)
2018-09-13 15:16:02 +02:00
Thomas Haller
0a69572cae dhcp: fix leak in dhclient's dhclient_start()
Fixes: 5d6d5cd136
(cherry picked from commit c87faf07a1)
(cherry picked from commit 8f9240de96)
(cherry picked from commit c740726b57)
2018-09-10 14:39:12 +02:00
Thomas Haller
71e2a25a0d libnm/keyfile: fix double free in keyfile's get_bytes()
Fixes: 5e7b14af03
(cherry picked from commit fcf254c03a)
(cherry picked from commit 1c56be4090)
2018-09-04 07:49:23 +02:00
Beniamino Galvani
9b46af1a62 libnm-core: support private keys encrypted with AES-{192,256}-CBC
https://github.com/NetworkManager/NetworkManager/pull/189
(cherry picked from commit 93f85edcce)
(cherry picked from commit 74fc6f30b2)
2018-08-30 10:09:17 +02:00
Thomas Haller
7689b9b73b wifi: don't use :1 bitfield for gboolean type
gboolean is a typedef for "int".

While older compilers might treat such bitfields as unsigned ([1]),
commonly such a bitfield is signed and can only contain the values 0
and -1.

We only want to use numeric 1 for TRUE, hence, creating such bitfields
is wrong, or at least error prone.

In fact, in this case it's a bug, because later we compare
it with a regular gboolean

  if (priv->scanning != new_scanning)

[1] https://lgtm.com/rules/1506024027114/

Fixes: e0f9677018
(cherry picked from commit 610ca87016)
(cherry picked from commit f326feaba3)
2018-08-26 18:34:06 +02:00
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