Commit graph

17161 commits

Author SHA1 Message Date
Lubomir Rintel c05befd5aa dns-manager: use libpsl directly
...instead of via libsoup. This makes it possible to do gTLD suffix checking
even if we're building without libsoup support.
2017-03-22 12:09:39 +01:00
Beniamino Galvani 80dfb8cdab core,libnm-core: use same route attribute names of iproute2
Users are probably more familiar with iproute2 route option names than
kernel ones.

Fixes: 54e58eb96b
2017-03-22 12:04:25 +01:00
Beniamino Galvani d3b1e08c9a Merge branch 'bg/wext-refresh-ifname-bgo779788'
https://bugzilla.gnome.org/show_bug.cgi?id=779788
2017-03-21 18:51:38 +01:00
Beniamino Galvani c26471e7de wifi-utils: nl80211: use logging macros 2017-03-21 18:46:52 +01:00
Beniamino Galvani dda2b84ccc wifi-utils: wext: use logging macros 2017-03-21 18:46:52 +01:00
Beniamino Galvani f4a8a7f2a6 shared: increase max number of args for _NM_UTILS_MACRO_REST
30 should be enough for anybody.
2017-03-21 18:46:52 +01:00
Beniamino Galvani ed8da2cd25 wifi-utils: fix use of errno
It can be overwritten when other arguments are evaluated.
2017-03-21 18:46:52 +01:00
Beniamino Galvani 3860c2fbe3 wifi-utils: don't cache interface name
For nl80211, we don't care about the interface name and only use it
when formatting error messages. For wext, an up-to-date interface name
should be obtained every time to minimize the chance of race
conditions when the interface is renamed.
2017-03-21 18:46:52 +01:00
Beniamino Galvani 7de4912ff0 libnm: fix emission of NMActiveConnection::state notify signal
state_changed_proxy() updates the value of @state and must also emit
the notify signal for it.

Without this, when the PropertiesChanged signal carrying the change of
'state' arrives after StateChanged, we notice that the value of @state
doesn't change and don't emit the notify, causing a loss of the state
change event.

Fixes: 40ffb962be

https://bugzilla.redhat.com/show_bug.cgi?id=1433883
2017-03-21 17:52:58 +01:00
Thomas Haller 9749fdbf34 po: make update-po 2017-03-21 15:07:17 +01:00
Piotr Drąg 531b05f3d6 po: update Polish (pl) translation (bgo #780277)
https://bugzilla.gnome.org/show_bug.cgi?id=780277
2017-03-21 14:58:08 +01:00
Yuri Chornoivan e2c526f071 po: update Ukrainian (uk) translation (bgo#780201)
https://bugzilla.gnome.org/show_bug.cgi?id=780201
2017-03-21 14:55:24 +01:00
Thomas Haller 6c2895f875 po: import Zanata translations 2017-03-21 14:55:00 +01:00
Beniamino Galvani 2e0c3d1dac manager: ensure proper disposal of unrealized devices
When remove_device() is called on an already unrealized device, we
should release it from master if necessary and clear its IP
configurations to avoid leaks.

https://bugzilla.redhat.com/show_bug.cgi?id=1433303
2017-03-21 13:25:36 +01:00
Thomas Haller 714504faf2 libnm/nm-vpn-connection: un-deprecate the NMVpnStateReason use in a header
Otherwise merely including a header would trigger a deprecation warhing.
The signal slot is not really used anyway.
2017-03-20 14:51:11 +01:00
Thomas Haller c033330c41 libnm: fix memleak of GUdevDevice in get_bus_name()
Fixes: f7b1b28202
2017-03-20 11:28:58 +01:00
Thomas Haller b33b15ae76 doc: fix generate-setting-docs.py for supporting Python 3 sorted() style
Python 3 has no "cmp" argument to sorted().

Fixes: b0da972f5f
2017-03-20 11:12:40 +01:00
Thomas Haller b869d9cc0d device: add spec "driver:" to match devices
Changing the MAC address of devices is known to fail with
certain drivers. Add a device-spec to allow disabling it
for for such devices.

Related: https://bugzilla.gnome.org/show_bug.cgi?id=777523
2017-03-17 17:40:00 +01:00
Yuri Chornoivan 4c6edb22b7 all: fix typos in documentation and comments
https://bugzilla.gnome.org/show_bug.cgi?id=780199

[thaller@redhat.com: reworded commit message]
2017-03-17 15:11:20 +01:00
Thomas Haller 5022e3b8ee libnm: revert coercing NMVpnConnectionStateReason to NMActiveConnectionStateReason
NMVpnConnectionStateReason is no longer used and replaced by
NMActiveConnectionStateReason. However, the old enums should
stay in place as they were:

Otherwise:
  #define NMVpnConnectionStateReason NMActiveConnectionStateReason
causes compiler warnings:
  NMVpnConnectionStateReason x;
  x = NM_VPN_CONNECTION_STATE_REASON_UNKNOWN;             // -Wenum-conversion
  if (x == NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS) { } // -Wenum-compare

Similarly, a user who didn't upgrade shall continue to get the
old GType for NM_TYPE_VPN_CONNECTION_STATE_REASON.

In practice, old users will have no issues using the old enum
the places where it worked before.
The only use of the deprecated enum is in vpn_state_changed()
signal slot of NMVpnConnection. This makes the signal slot
itself deprecated. However, NMVpnConnection is an NMObject and commonly
created within libnm itself, not by the user. It is very unlikely that
a user of libnm subclassed NMVpnConnection and makes use of the
vpn_state_changed() signal slot. So, deprecate it without replacement.

Fixes: a91369f80d
2017-03-17 13:00:32 +01:00
Thomas Haller e65aa9e6ff trivial/whitespace: remove non-leading tabs 2017-03-17 10:58:33 +01:00
Thomas Haller fa262e3dc4 libnm: fix chaining up NMActiveConnection::constructed()
Fixes: 40ffb962be
2017-03-17 10:50:42 +01:00
Lubomir Rintel 1e4f1892e0 merge: branch 'lr/active-connection-state-changed'
https://bugzilla.gnome.org/show_bug.cgi?id=779627
2017-03-17 10:21:57 +01:00
Lubomir Rintel d190ca487f vpn-connection: use NMActiveConnectionStateReason 2017-03-17 10:21:19 +01:00
Lubomir Rintel a91369f80d libnm-core: drop NMVpnConnectionStateReason
It's now the same as NMActiveConnectionStateReason. Keep a compatibility
typedef and enum.
2017-03-17 10:21:19 +01:00
Lubomir Rintel d9d78ac2aa vpn-connection: drop reason_to_string
It's utterly useless: the textual version of the reason if logged only if
the plugin fails; but the plugin failure already logs the plugin state
change reason which is directly translated to the connection one.
2017-03-17 10:21:19 +01:00
Lubomir Rintel c61c16513e fixup! libnm/active-connection: track reason for state changes 2017-03-17 10:21:19 +01:00
Lubomir Rintel 57a26fd2aa cli/connections: decide about activation success and failure in single place
Track both device and active connections at the same time and decide
whether activation finished (either successfully or not) in a single
place, check_activated().

This makes the already too complex code path a bit more straightforward
and also makes it possible to be more reasonable about the diagnostics.

Now that the active connection signals the reason, we include it; but if
the failure is due to the device disconnection while we're activating,
include a device reason instead, since it's often more useful. Like:

Before:
  Error: Connection activation failed.

Without considering the device:
  Error: Connection activation failed: the base network connection was interrupted

After:
  Error: Connection activation failed: The Wi-Fi network could not be found
2017-03-17 10:21:19 +01:00
Lubomir Rintel 40ffb962be libnm/active-connection: track reason for state changes
Note that the reason tracking starts as soon as the object exists (which
is immediately after GDBusObject is created), not when the asynchronous
NMObject initialization finishes. That is so that we the reason changes
in between are not lost.

The vpn-connection should probably be doing the same.
2017-03-17 10:21:19 +01:00
Lubomir Rintel 8b649a8c84 active-connection: emit a StateChanged signal on state changes
It includes a reason code that makes it possible for the clients to be
more reasonable about error messages.

The reason code is essentially copied from the VPN, plus three more
reasons that were useful for non-VPN connections.
2017-03-17 10:21:19 +01:00
Lubomir Rintel 67688fd2e5 libnm-core/trivial: include literals next to NMVPNStateReason values
Makes it slightly more readable, useful when we copy it to
NMActiveConnectionStateReason.
2017-03-17 10:21:19 +01:00
Thomas Haller 2e5ff63e1d device: cast enum types for variadic g_signal_emit() function 2017-03-17 10:21:19 +01:00
Lubomir Rintel 6da6318e88 merge: branch 'lr/api-docs'
https://bugzilla.gnome.org/show_bug.cgi?id=779934
2017-03-17 10:15:19 +01:00
Lubomir Rintel a1cf9f4339 docs/libnm: add some more documentation 2017-03-17 10:15:11 +01:00
Lubomir Rintel 374abc3f50 docs/api: restructure
This splits the manual into parts and groups the D-Bus interfaces into chapters
by the object class. It looks considerably better.
2017-03-17 10:15:11 +01:00
Lubomir Rintel 967207f5bc docs/api: move D-Bus reference after nm-settings 2017-03-17 10:15:11 +01:00
Lubomir Rintel c673c52101 docs/api: make the connection settings look better
Turn the it into a chapter with refentries to better fit the structure
of the table of contects. Also, include the properties in the index.
2017-03-17 10:15:11 +01:00
Lubomir Rintel 265269855b docs/api: add abstract 2017-03-17 10:15:11 +01:00
Lubomir Rintel 6926eaeb05 docs/api: add standard release information 2017-03-17 10:15:11 +01:00
Lubomir Rintel 74b6a015f7 docs/api: reorder the manual pages
I guess the daemon and its configuration first makes most sense.
2017-03-17 10:15:11 +01:00
Lubomir Rintel 96042c41f8 man: include the description for settings 2017-03-17 10:15:11 +01:00
Lubomir Rintel a1c5f43501 libnm/generate-setting-docs.py: include description attribute 2017-03-17 10:15:11 +01:00
Lubomir Rintel 7bd69aa08d libnm-core: sensible docstrings for NMSettings* 2017-03-17 10:15:11 +01:00
Lubomir Rintel f6e9b1d328 introspection: include short description everywhere 2017-03-17 10:15:11 +01:00
Lubomir Rintel b0da972f5f doc: sort "connection" settings first in nm-settings manual 2017-03-17 10:15:11 +01:00
Lubomir Rintel 3f6af3360b libnm-core/8021x: add a missing colon in gtk-doc
The universe is now perfect.
2017-03-17 10:15:11 +01:00
Thomas Haller 2d1b85f8d7 core: merge branch 'th/assume-vs-unmanaged-bgo746440'
This branch only does part of what bgo#746440 is about.
But it's a large and necessary step towards the full
solution. It cleanups tracking of whether to assume
a device, treat it as external or fully manage it.

Future work will need to fine tune the behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=746440
https://bugzilla.redhat.com/show_bug.cgi?id=1394579
2017-03-16 18:27:48 +01:00
Thomas Haller 850c977953 device: track system interface state in NMDevice
When deciding whether to touch a device we sometimes look at whether
the active connection is external/assumed. In many cases however,
there is no active connection around (e.g. while moving the device
from state unmanaged to disconnected before assuming).
So in most cases we instead look at the device-state-reason to decide
whether to touch the interface (see nm_device_state_reason_check()).

Often it's desirable to have no state and passing data as function
arguments. However, the state reason has to be passed along several hops
(e.g. a queued state change). Or a change to a master/slave can affect
the slave/master, where we pass on the state reason. Or an intermediate
event might invalidate a previous state reason. Passing the state
whether to touch a device or not as a state-reason is cumbersome
and limited.

Instead, the device should be aware of whats going on. Add a
sys-iface-state with:
  - SYS_IFACE_STATE_EXTERNAL: meaning, NM should not touch it
  - SYS_IFACE_STATE_ASSUME: meaning, NM is gracefully taking over
  - SYS_IFACE_STATE_MANAGED: meaning, the device is managed by NM
  - SYS_IFACE_STATE_REMOVED: the device no longer exists

This replaces most checks of nm_device_state_reason_check() and
nm_active_connection_get_activation_type() by instead looking at
the sys-iface-state of the device.

This patch probably has still issues, but the previous behavior was
not very clear either. We will need to identify those issues in future
tests and tweak the behavior. At least, now there is one flag that
describes how to behave.
2017-03-16 18:27:33 +01:00
Thomas Haller 9395f163f4 manager: always cleanup volatile settings-connection on active-connection removal
This is not only relevant if the active connection is
assumed/external.
2017-03-16 18:27:33 +01:00
Thomas Haller 72de503d39 manager: simplify searching assumed connection
Now we only search for a candiate with matching UUID. No need to
first lookup all activatable connections, just find the candidate
by UUID and see if it is activatable.
2017-03-16 18:27:33 +01:00