Commit graph

17829 commits

Author SHA1 Message Date
Thomas Haller
7e472b4eb3 device: rename and minor refactoring of check_carrier()
The name should mirror what we already have: nm_device_set_carrier().
Also, move the code closer to nm_device_set_carrier() and refactor
it a bit.
2017-05-15 17:38:47 +02:00
Thomas Haller
eaba285375 device: downgrade logging messages about (non) pending action
Adding/Removing a pending action with assert_not_yet_pending/
assert_is_pending means that we expect that no action is taken.

Downgrade the logging level in those cases to <trace>.
2017-05-15 17:38:47 +02:00
Thomas Haller
6c5d883a4b device: minor cleanup of carrier_disconnected_action_cancel() 2017-05-15 17:38:47 +02:00
Thomas Haller
a07c6255a0 device/trivial: rename functions related to "carrier" 2017-05-15 17:38:47 +02:00
Thomas Haller
5a7374d8be device: don't call virtual function carrier_changed() directly
Don't give the subclass the ability to override the parents
behavior. The parent implementation is not intended to allow
for that. Instead, restrict the flexibility of how the virtual
function integrates with the larger picture. That means, the
virtual function is only called at one place, and there is only
one implementation in NMDeviceEthernet (and it doesn't really
matter whether the implementation chains up the parent implementation
or not).
2017-05-15 17:38:47 +02:00
Francesco Giudici
23bc781063 all/trivial: fix few comment typos 2017-05-15 15:52:21 +02:00
Thomas Haller
234bc0adcf cli: fix use-after-free in _get_fcn_gobject_enum()
Fixes: ddfff04a45
2017-05-15 15:16:22 +02:00
Lubomir Rintel
efafc98147 merge: branch 'lr/wps2'
https://bugzilla.gnome.org/show_bug.cgi?id=781336
2017-05-15 13:00:13 +02:00
Lubomir Rintel
1194641afe dbus/secret-agent: add a flag indicating WPS PBC is active
The agents may used this to learn that WPS PBC enrollment is active and
suggest that user pushes a button on the router instead of supplying a
network key.
2017-05-15 12:59:55 +02:00
Lubomir Rintel
2899bb3429 cli: add support for the WPS property 2017-05-15 12:59:55 +02:00
Lubomir Rintel
99c112a493 ifcfg-rh: save/restore WPS properties 2017-05-15 12:59:55 +02:00
Lubomir Rintel
0eb7617504 wifi: attempt a WPS enroll when secrets are missing
If the supplicant returns the credentials, update the PSK in the
connection and disable further WPS enrollment attempts.
2017-05-15 12:59:55 +02:00
Lubomir Rintel
f87912326c settings-connection: all method to internally supply new secrets
It's sort of a very very lightweight version of get_secrets_done_cb()
that allows as to add secrets to the connection that didn't come from
the agent manager.
2017-05-15 12:59:55 +02:00
Lubomir Rintel
5c80571006 wifi/ap: maintain the WPS flags
Exposure of this property on D-Bus would be useful for the GUIs to encourage
the users to enter a PIN or push a button.

We'll also use it to decide whether a connection will initiate WPS
enrollment unless the user overrides the default.
2017-05-15 12:59:55 +02:00
Lubomir Rintel
a3040bf92f wifi/ap: add flags accessor
The wifi device will inspect this to decide whether to initiate a WPS enrollment
unless the user overrides the default.
2017-05-15 12:59:55 +02:00
Lubomir Rintel
1d15e9c6de supplicant-interface: add support for WPS enrollment 2017-05-15 12:59:55 +02:00
Lubomir Rintel
e6f95b50c8 setting-wireless: add wps-method property
This property will be used to decide if it makes sense to attempt a WPS
enrollment on connection activation.
2017-05-15 12:59:55 +02:00
Lubomir Rintel
36b6bbdae3 dbus: add WPS methods to AP flags
Will be used to indicate WPS method discovered to be supported by the
access point.
2017-05-15 12:59:55 +02:00
Lubomir Rintel
63836f3945 ifcfg-rh: don't skip 802-11-security if there's no WPA-PSK 2017-05-15 12:59:55 +02:00
Thomas Haller
fb2ef01d85 contrib: update fedora's REQUIRED_PACKAGES list 2017-05-15 12:40:32 +02:00
Thomas Haller
d875df5ab4 device: simplify check for ready slaves 2017-05-14 09:52:18 +02:00
Thomas Haller
f4de6734a9 device: remove function nm_device_is_enslaved()
There were only two callers. Let them access the field
directly.
2017-05-14 09:47:01 +02:00
Thomas Haller
019d3adbca device: remove unused function nm_device_master_get_slave_by_ifindex() 2017-05-13 22:08:48 +02:00
Thomas Haller
9740fef906 device: use CList to track SlaveInfo 2017-05-13 22:05:10 +02:00
Thomas Haller
36e7a1f8a0 core: merge branch 'th/async-bgo781643'
https://bugzilla.gnome.org/show_bug.cgi?id=781643
2017-05-12 17:41:12 +02:00
Thomas Haller
af5b86aa1e policy: log policy's orig_hostname 2017-05-12 17:29:33 +02:00
Thomas Haller
25c5a96da7 policy: drop out argument from _get_hostname()
It serves no purpose, because the function always allocates a new
result and returns it. It would make sense, if the output string
would only be cloned when we need to allocate a new string. But
since that optimization is not done, the argument serves no purpose.
2017-05-12 17:29:33 +02:00
Thomas Haller
f0a229c1e2 policy: namespace fields related to DNS reverse lookup for hostname 2017-05-12 17:29:33 +02:00
Thomas Haller
5819b0de8e policy: add lookup_by_address() function for g_resolver_lookup_by_address_async() 2017-05-12 17:29:33 +02:00
Thomas Haller
9f4a5b85b6 hostname: change logging of hostname-mode
Don't log with level <info>. It's not important enough and only
noise. Also, move the logging line outside of nm_policy_init(). At that
point, the policy instance is not yet initialized (much), so we shouldn't
use the logging macro _LOGD().
2017-05-12 17:29:33 +02:00
Thomas Haller
54f5407abf hostname: cache hostname-manager's hostname property
A property preferably only emits a notify-changed signal when
the value actually changes and it caches the value (so that
between property-changed signals the value is guaranteed not to change).

NMSettings and NMManager both already cache the hostname, because
NMHostnameManager didn't guarantee this basic concept.

Implement it and rely on it from NMSettings and NMPolicy.
And remove the copy of the property from NMManager.

Move the call for nm_dispatcher_call_hostname() from NMHostnameManager
to NMManager. Note that NMPolicy also has a call to the dispatcher
when set-transient-hostname returns. This should be cleaned up later.
2017-05-12 17:29:33 +02:00
Thomas Haller
5bfb7c3c89 hostname: split out hostname management from NMSettings
Hostname management is complicated. At least, how it is implemented currently.
For example, NMPolicy also sets the hostname (NMPolicy calls
nm_settings_set_transient_hostname() to have hostnamed set the hostname,
but then falls back to sethostname() in settings_set_hostname_cb()).
Also, NMManager tracks the hostname in NM_MANAGER_HOSTNAME too, and
NMPolicy listens to changes from there -- instead of changes from
NMSettings.

Eventually, NMHostnameManager should contain the hostname parts from NMSettings
and NMPolicy.
2017-05-12 17:29:33 +02:00
Thomas Haller
f3dfe0f745 ofono: clenaup NMModemOfono's disconnect()
- anticipate missing callback/ctx->result

- always invoke the result callback when given

- fix leaking GVariant in disconnect_done()

- fix crash due to non-initialized ctx->result

- pass cancellable to g_dbus_proxy_call()
2017-05-12 17:29:33 +02:00
Thomas Haller
663dfd7d51 ofono: make asynchrounous operations for context_proxy cancellable
Also,

  - disconnect signal handlers in dispose()

  - fix memleak in stage1_prepare_down()()
2017-05-12 17:29:33 +02:00
Thomas Haller
1e5be78eb9 ofono: make asynchrounous operations for modem_proxy cancellable
Also,

  - chain up the constructed() function

  - fix memleak in modem_get_properties_done()
2017-05-12 17:29:33 +02:00
Thomas Haller
58712c9546 ofono: take D-Bus proxy for ConnectionManager asynchronously
Also,

  - disconnect signals from connman_proxy in dispose()

  - don't take reference to self for GetProperties call
2017-05-12 17:29:33 +02:00
Thomas Haller
b7329fccce ofono: take D-Bus proxy for SimManager asynchronously
Also,

  - fix memleaks in sim_get_properties_done()

  - don't take reference to self for GetProperties call
2017-05-12 17:29:33 +02:00
Thomas Haller
615aa3f077 modem: prettify logging output about available ModemManager/oFono
These lines are logged with <info> level. They should look pleasant.
2017-05-12 17:29:33 +02:00
Thomas Haller
f61b1dadae bt: use logging macros in nm-bluez4-manager.c 2017-05-12 17:29:33 +02:00
Thomas Haller
7d11fe5581 bt: use logging macros in nm-bluez4-adapter.c 2017-05-12 17:29:33 +02:00
Thomas Haller
e68a33d114 bt: create D-Bus proxy for NMBluez4Manager asynchronously
And some fixes:

  - proxy creation may fail. Don't handle it by retrying,
    but at least don't access the invalid proxy instance.

  - quering "DefaultAdapter" did not take a reference to @self
    nor was the operation cancellable. This leads to crash
    if the instance gets destroyed early.
2017-05-12 17:29:33 +02:00
Thomas Haller
44f5e372ce bt: create D-Bus proxy for NMBluez4Adapter asynchronously
And some fixes:

  - proxy creation may fail. Don't handle it by retrying,
    but at least don't access the invalid proxy instance.

  - get_properties_cb() did not take a reference to @self
    nor was the operation cancellable. This leads to crash
    if the instance gets destroyed early.
2017-05-12 17:29:33 +02:00
Thomas Haller
e84a52ea42 bt: track name-owner changes via NMModemManager and create D-Bus proxy asynchronously
Fix two issues of the previous code:

  - the D-Bus proxy for the modem manager should not get created
    synchronously.
  - NMModemManager is a singleton, let it track the name-owner
    change and the D-Bus proxy, instead of having one per NMDeviceBt.
2017-05-12 17:29:33 +02:00
Thomas Haller
7840dde47b bt: minor refactoring of mm_name_owner_changed() function 2017-05-12 17:29:33 +02:00
Thomas Haller
d1ef7f7aac bt: move initialization of NMDeviceBt to constructed()
Don't do non-trivial initialization in nm_device_bt_init(). At
this point, the object is not yet fully created. As we already have
a constructed() implemented, move the initialization there.
2017-05-12 17:29:33 +02:00
Thomas Haller
a087278e8e modem: make NMModemManager a singleton
Singletons are not entirely bad, if used carefully. We will need
the singleton from bluetooth plugin.
2017-05-12 17:29:33 +02:00
Thomas Haller
ce1ae5f458 modem: add define for ModemManager D-Bus path
Also, bluetooth plugin uses NMModem from the wwan plugin. Don't
include such a foreign header in a "nm-device-bt.h". Instead, forward
declare what we need.
2017-05-12 17:29:33 +02:00
Thomas Haller
c257e22cb5 modem: cleanup construction of NMModem
It is invalid that a constructor() returns NULL. These anyway were
only assertions, checking conditions that should never fail.
2017-05-12 17:29:33 +02:00
Thomas Haller
2dbb4d8d2b modem/trivial: move code around 2017-05-12 17:29:33 +02:00
Thomas Haller
4c070639d3 modem/trivial: rename functions in nm-modem-manager.c
Most of the functions are strictly related to ModemManager. Their
name should hint to that, so that they are clearly separated from
the ofono functions and general purpose functions.

Same for data fields.
2017-05-12 17:29:33 +02:00