Commit graph

7828 commits

Author SHA1 Message Date
Thomas Haller
aa67e0c005 sleep-monitor/trivial: rename "sd_proxy" instance to "proxy"
It's not only relevant for systemd (sd).

(cherry picked from commit 6e45909f79)
2016-05-24 15:12:14 +02:00
Thomas Haller
f8a7e32eba manager: use _LOGx() macros in nm-manager
They give each logging message a "manager: " prefix.

(cherry picked from commit e0c272c153)
2016-05-24 15:11:17 +02:00
Thomas Haller
5293991255 sleep-monitor: disconnect signal handlers from D-Bus proxy on destroy
The lifetime of the proxy is not necesarily the same as the lifetime
of the NMSleepMonitor instance. Disconnect the signals during dispose().

(cherry picked from commit a09a5f7fc1)
2016-05-24 15:09:03 +02:00
Thomas Haller
3f30283a76 sleep-monitor: don't localize messages in core daemon
The daemon does not run with a particular locale of a user. Localizing
makes no sense (at least, we don't do it usually and it would make
logging localized).

(cherry picked from commit 753f727af5)
2016-05-24 15:09:01 +02:00
Thomas Haller
331f571dff sleep-monitor: properly handle cancelling of "Inhibit" D-Bus call
As we don't take a reference on @self during the asynchronous
request, we must properly support cancelling in case of early
destruction.

I think, it's gdbus' responsibility not to leak any file descriptors
when cancelling a D-Bus request that returns file descriptors. Thus,
our usual pattern works here too.

(cherry picked from commit 2e3ff56cdc)
2016-05-24 15:08:59 +02:00
Thomas Haller
eaa068cfb3 sleep-monitor: handle early destruction of NMSleepMonitor instance
When destroing the sleep monitor before the D-Bus proxy is created,
we must cancel creation of the proxy.

(cherry picked from commit 3fa3dba1b1)
2016-05-24 15:08:57 +02:00
Thomas Haller
23bd466af6 sleep-monitor: drop unused class methods for signals
(cherry picked from commit 2919b9271d)
2016-05-24 15:08:56 +02:00
Thomas Haller
a61ff3de97 sleep-monitor: implement dispose() instead of finalize()
To release resources, dispose() is preferred over finalize()
because it is called earlier.

(cherry picked from commit a7308bbe9c)
2016-05-24 15:08:54 +02:00
Thomas Haller
f8fc8b3302 sleep-monitor: don't return value from drop_inhibitor()
(cherry picked from commit fc14d32e99)
2016-05-24 15:08:52 +02:00
Thomas Haller
1648fd3c14 sleep-monitor: use LOG macros in "nm-sleep-monitor-systemd.c"
(cherry picked from commit d0a6f6f34c)
2016-05-24 15:08:48 +02:00
Thomas Haller
ed050337b3 active-connection: update D-Bus properties of active-connection when settings-connection changes
$ nmcli connection up my-connection
  Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/42)

  $ nmcli connection modify my-connection connection.id other-name

  $ nmcli -f connection.id connection show other-name
  connection.id: other-name

  $ nmcli -f GENERAL.CONNECTION device show enp0s25
  GENERAL.CONNECTION: my-connection

  $ nmcli connection down other-name
  Error: 'other-name' is not an active connection.
  Error: no active connection provided.

  $ nmcli connection down my-connection
  Connection 'my-connection' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/13)

When modifying a connection, NMActiveConnection must update the D-Bus
properties that belong to the settings-connection.

(cherry picked from commit 18019d55a1)
2016-05-24 15:03:26 +02:00
Thomas Haller
ab6d813e96 settings: merge "connection-updated" and "connection-updated-by-user" signals
This is mostly interesting of NMPolicy, which no longer needs to
subscribe to two almost identical signals (where the by-user signal
was always invoked together with the plain "updated" signal).

(cherry picked from commit 3164c026a2)
2016-05-24 15:03:24 +02:00
Thomas Haller
52644bfebd settings: combine "updated" and "updated-by-user" signal in NMSettingsConnection
Instead of connecting to two similar signals, combine them into one
and pass "by_user" argument.

We still need to keep the original NM_SETTINGS_CONNECTION_UPDATED signal,
because it is exposed on D-Bus.

(cherry picked from commit 65c55e2a78)
2016-05-24 15:03:22 +02:00
Thomas Haller
fba19c43ee settings: emit NM_SETTINGS_CONNECTION_UPDATED right away and not on an idle handler
I want to combine NM_SETTINGS_CONNECTION_UPDATED and NM_SETTINGS_CONNECTION_UPDATED_BY_USER
into one signal. Thus, they must have same behavior with respect as to whether they are
scheduled on idle.

Emit NM_SETTINGS_CONNECTION_UPDATED right away.

The "Updated" signal is exposed via D-Bus on the settings object.
Removing the idle handling has no bad consequences there.

Apart from that, the signal has only the listener NMSettings::connection_updated().
connection_updated() first emits NM_SETTINGS_SIGNAL_CONNECTION_UPDATED, which only
has listener: NMPolicy::connection_updated(), which already delegates to
an idle handler.

Second, NMSettings::connection_updated() emits
NM_CP_SIGNAL_CONNECTION_UPDATED which has the following listeners:

  - NMBluezDevice::cp_connection_updated(), which can cause the
    connection to be tracked/untracked. Any further changes are
    already delayed on an idle handler (check_emit_usable_schedule()).

  - NMDevice::cp_connection_added_or_updated(), which causes the
    connection to be tracked by the device. It also emits
    "notify::available-connections", which however is only relevant
    for the D-Bus bindings.
    At last, it does available_connections_check_delete_unrealized()
    which also is on an idle handler already.

(cherry picked from commit a4f1a1794f)
2016-05-24 15:03:20 +02:00
Thomas Haller
887fc983be device/bluez: delay check_emit_usable() for NM_CP_SIGNAL_CONNECTION_UPDATED
Currently, NM_CP_SIGNAL_CONNECTION_UPDATED signal will be invoked on an
idle handler. I want to change that, so to be save, delay actions that
matter on an idle handler.

(cherry picked from commit 640ef67cd7)
2016-05-24 15:03:18 +02:00
Thomas Haller
30590effc8 device/bluez: refactor registering to connections
No (intentional) change in behavior.

(cherry picked from commit 3325cd3d90)
2016-05-24 15:03:17 +02:00
Thomas Haller
946fb983f6 policy: handle schedule_activate_all() in an idle handler
schedule_activate_all() needs to iterate over all devices and is thus
relatively costly (and scales O(n^2)).

By scheduling the action on an idle handler we delay and combine
multiple redundant requests.

Another reason is that NM_SETTINGS_CONNECTION_UPDATED is currently
executed on an idle handler which first leads to
NM_SETTINGS_SIGNAL_CONNECTION_UPDATED signal and eventually calls
schedule_activate_all().
I want to change that to emit the connection update signal immediately,
thus to preserve the delay, we delay handling in NMPolicy.

(cherry picked from commit 920054d8aa)
2016-05-24 15:03:16 +02:00
Thomas Haller
8b357f43c6 settings: drop signal slots from NMSettings
NMSettings has no derived classes and obviously nobody is using
those slots. Just drop them.

(cherry picked from commit d571933505)
2016-05-24 15:03:13 +02:00
Thomas Haller
480e69cc82 settings: refactor connection_changed()
Again, no functional change.

(cherry picked from commit f7e7df772d)
2016-05-24 15:03:12 +02:00
Thomas Haller
6359213ea4 settings: refactor connection-changed handler
No change in behavior, just not pass on this GUINT_TO_POINTER (TRUE).

(cherry picked from commit 866df17e97)
2016-05-24 15:03:11 +02:00
Thomas Haller
c70d6bf498 settings: use NM_GOBJECT_PROPERTIES_DEFINE in NMSettings/NMSettingsConnection/NMActiveConnection
(cherry picked from commit 30b8842a48)
2016-05-24 15:03:09 +02:00
Thomas Haller
a6634183e1 device: drop available_connections_notify() and call _notify() directly
(cherry picked from commit 8c86648313)
2016-05-24 15:03:08 +02:00
Thomas Haller
f4113b8b24 manager: fix implementation of NMManager's "startup-complete
Due to a bug, NMManager would connect to "notify::connections"
and might miss an important notification when NMSettings declares
startup-complete.

Fixes: b067ca7034
(cherry picked from commit c57e5a6b66)
2016-05-24 15:03:06 +02:00
Beniamino Galvani
a97ba456fe config: add file name to error messages for parsing failures
When one of the configuration snippet is malformed, NM doesn't tell
which file caused the error:

$ NetworkManager --print-config
Failed to read configuration: Key file does not start with a group

Fix this.

$ NetworkManager --print-config
Failed to read configuration: /usr/lib/NetworkManager/conf.d/test.conf: Key file does not start with a group

(cherry picked from commit 57c001200d)
2016-05-19 18:13:55 +02:00
Michael Olbrich
10ba492047 sleep-monitor-upower: add missing include
Otherwise building fails with:

  nm-sleep-monitor-upower.c:132:45: error: expected declaration specifiers or '...' before 'nm_sleep_monitor_get'
  nm-sleep-monitor-upower.c:132:67: error: expected declaration specifiers or '...' before '(' token

https://mail.gnome.org/archives/networkmanager-list/2016-May/msg00053.html
2016-05-19 12:41:12 +02:00
Beniamino Galvani
c65baf3121 device: take care of default route of DHCP generated-assumed connections
In general we don't touch the externally set default route on devices
that use a generated-assumed connection. When the IP method is AUTO
(or DHCP), this means that we are not able to restore the default
route after a temporary expiration of the lease which removes
addresses/routes from the device.

Change this, and let NM update the default route for generated-assumed
devices using dynamic addressing.

https://bugzilla.redhat.com/show_bug.cgi?id=1265239
(cherry picked from commit 9b7f9af077)
2016-05-16 15:47:33 +02:00
Beniamino Galvani
1d01cd587c device: don't update applied connection for generated assumed devices
The applied connection must describe the configuration that was
initially activated on the device. Even if the IP configuration
changes, we shouldn't reset the applied connection for devices using a
generated-assumed connection, otherwise we would lose information on
the IP method we're trying on the device.

(cherry picked from commit c84fd50287)
2016-05-16 15:47:29 +02:00
Beniamino Galvani
2959977164 device: apply MTU setting also to devices without IPv4 configuration
Usually the MTU in the ethernet.mtu property is applied to the device
during the commit of IPv4 configuration.  For devices with
ipv4.method=disabled or slave devices that phase is skipped and so the
setting does not have effect.  Apply the MTU explicitly in such cases.

https://bugzilla.redhat.com/show_bug.cgi?id=1303968
https://bugzilla.redhat.com/show_bug.cgi?id=1303731
(cherry picked from commit 53dfaddda2)
2016-05-16 10:57:27 +02:00
Dan Williams
3cba4194f2 manager: don't unmanage devices without L3 config on shutdown
Use the following logic when quitting, if the device is managed:

  1) if the connection is assumed, leave it up
  2) if the device has no connection (eg, !req) leave it up
  3) if the device only has L2 leave it up

[thaller@redhat.com: original patch reworked by bgalvani@redhat.com and me]

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

(cherry picked from commit 25aaaab3b7)
(cherry picked from commit dab2d46aa2)
2016-05-13 19:30:11 +02:00
Thomas Haller
ddefd6931e settings: fix write_hostname for relative-symbolic links
g_file_read_link() "reads" the symbolic link. If it's a relative path,
we get a relative path which is anchored on @file. We must resolve that
to be absolute.

(cherry picked from commit 7f7e1eb60b)
2016-05-12 15:28:05 +02:00
Thomas Haller
51188fb046 settings: remove unnecessary "file" field for hostname from NMSettingPrivate
(cherry picked from commit d6e7fa164b)
2016-05-12 15:28:05 +02:00
Thomas Haller
9ebc6e1157 utils: fix memleak in nm_utils_read_link_absolute()
Fixes: c4b88bf23f
(cherry picked from commit d3be90e3e7)
2016-05-12 15:28:05 +02:00
Thomas Haller
9e66849f54 utils: add nm_utils_read_link_absolute()
(cherry picked from commit c4b88bf23f)
2016-05-12 15:27:41 +02:00
Thomas Haller
11bfe8a881 platform: ensure refetching routes when link goes down
It's not enough to consider IF_LOWER_UP flag. Instead,
the important flag is actually IF_UP.

Actually, I suspect that IF_LOWER_UP is not needed. But for
now leave it, in order not to break something.

(cherry picked from commit 02e84ba1e8)
2016-05-12 15:07:26 +02:00
Thomas Haller
5367eac814 device: restore IP configuration when link comes up
This is especially important, because changing MTU takes the
link down for a moment. Taking a link down deletes IP routes and
IPv6 addresses. Thus, when the link comes up again, we must restore
them.

Otherwise, we don't call merge_and_apply() until the next DHCP lease
(or possibly never in case of static addressing).

https://bugzilla.redhat.com/show_bug.cgi?id=1309899
(cherry picked from commit 35a7ea77b0)
2016-05-12 15:07:25 +02:00
Thomas Haller
a3b3e17bf9 device: improve logging when changing IP configuration
nm_device_set_ip4_config() is called during cleanup and
from ip4_config_merge_and_apply(). The latter, has several
call sites.

It's not easy to track whether we called set_ip4_config with
or without commit (and if we call it without commit, we might
not see a logging line at all).

(same for nm_device_set_ip6_config()/ip6_config_merge_and_apply()).

(cherry picked from commit f50e39fc98)
2016-05-12 15:07:23 +02:00
Thomas Haller
b04db262cb all: replace nm_unauto() by g_steal_pointer()
They do essentially the same.

(cherry picked from commit ba90c9601c)
2016-05-12 14:35:14 +02:00
Thomas Haller
7d2458e51c vpn: fix crash when VPN service times-out to start
Previously, we took a reference when scheduling _daemon_exec_timeout().
That was changed, but we still wrongly unref'ed the VPN connection
on timeout.

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

Fixes: 6c12f04e87
(cherry picked from commit 1ec5e0b958)
2016-05-12 13:03:07 +02:00
Lubomir Rintel
1c7668f896 dnsmasq: don't add router option for non-default-route connections
This is useful to set up a DHCP server, but don't hijack the default
route of the clients.

(cherry picked from commit 9770024f63)
2016-05-11 12:49:25 +02:00
Thomas Haller
e35d3bfb41 sd/dhcp: workaround multiple "Domain Name" (option 15) entries
https://mail.gnome.org/archives/networkmanager-list/2005-April/msg00022.html
https://tools.ietf.org/html/rfc2132#section-3.17
https://bugzilla.gnome.org/show_bug.cgi?id=766191
(cherry picked from commit 2e710c2e10)
2016-05-11 11:18:20 +02:00
Thomas Haller
0b63dbdef7 wwan: return from send_pin_ready() when operation cancelled and fix leak
We call the asynchrnous function mm_sim_send_pin() without taking a
reference on @self. During send_pin_ready() we must first check whether
the request was cancelled because self might be a dangling pointer at
this point.

Also, avoid leaking @error if the ctx is no longer valid.

Fixes: aa0b379699
(cherry picked from commit 37827fcafa)
2016-05-10 19:05:32 +02:00
Beniamino Galvani
21ca2cf0f6 device: remove pending dhcp actions also in IP_DONE state
When the IP status is IP_DONE and a DHCP transaction succeeds the
'dhcp4' and 'dhcp6' pending actions must be removed. Without this, a
temporary link loss just after the activation would cause a DHCP
restart and those actions would remain set, blocking the startup.

https://bugzilla.redhat.com/show_bug.cgi?id=1330893
(cherry picked from commit 0b66eb298e)
2016-05-10 18:01:30 +02:00
Lubomir Rintel
b2f35d58f5 modem: clear the connection context on device disconnection
If the device is disconnected, we should also disconnect the modem; and
while we disconnect the device we should clean the connection context.
Otherwise the modem will surprise us by emitting PREPARED signal when
the device is no longer PREPARED:

  NetworkManager[28469]: <info>  [1462383185.8714] (ttyACM1): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested)
  NetworkManager[28469]: <info>  [1462383185.8715] (ttyACM1): modem state changed, 'registered' --> 'connecting' (reason: user-requested)
  NetworkManager[28469]: <info>  [1462383185.8716] device (ttyACM1): state change: deactivating -> disconnected (reason 'connection-removed') [110 30 38]
  NetworkManager[28469]: <info>  [1462383185.8759] (ttyACM1): modem state changed, 'connecting' --> 'disconnecting' (reason: user-requested)
  NetworkManager[28469]: <warn>  [1462383185.8937] (ttyACM1): failed to connect modem: Dial operation has been cancelled

  (NetworkManager:28469): NetworkManager-wwan-CRITICAL **: modem_prepare_result: assertion 'state == NM_DEVICE_STATE_PREPARE' failed

  Program received signal SIGTRAP, Trace/breakpoint trap.
  g_logv (log_domain=0x7fffea31bc47 "NetworkManager-wwan", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcfc0) at gmessages.c:1086
  1086              g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
  (gdb) bt
  #0  0x00007ffff4ebe643 in g_logv (log_domain=0x7fffea31bc47 "NetworkManager-wwan", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcfc0) at gmessages.c:1086
  #1  0x00007ffff4ebe7bf in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1119
  Python Exception <type 'exceptions.RuntimeError'> Cannot locate object file for block.:
  #2  0x00007ffff2ce6dac in ffi_call_unix64#3  0x00007ffff2ce66d5 in ffi_call (cif=cif@entry=0x7fffffffd300, fn=<optimized out>, rvalue=0x7fffffffd230, avalue=avalue@entry=0x7fffffffd1d0) at ../src/x86/ffi64.c:522
  #4  0x00007ffff51b55a5 in g_cclosure_marshal_generic_va (closure=0x555555b30cb0, return_value=0x0, instance=0x555555a8d360, args_list=<optimized out>, marshal_data=0x0, n_params=2, param_types=0x555555c2bb60) at gclosure.c:1600
  #5  0x00007ffff51b4b37 in _g_closure_invoke_va (closure=closure@entry=0x555555b30cb0, return_value=return_value@entry=0x0, instance=instance@entry=0x555555a8d360, args=args@entry=0x7fffffffd5b8, n_params=2, param_types=0x555555c2bb60) at gclosure.c:864
  #6  0x00007ffff51ce117 in g_signal_emit_valist (instance=instance@entry=0x555555a8d360, signal_id=signal_id@entry=168, detail=detail@entry=0, var_args=var_args@entry=0x7fffffffd5b8) at gsignal.c:3292
  #7  0x00007ffff51cf2e8 in g_signal_emit_by_name (instance=instance@entry=0x555555a8d360, detailed_signal=detailed_signal@entry=0x7fffea074cdd "prepare-result") at gsignal.c:3479
  #8  0x00007fffea011fd3 in connect_context_step (self=self@entry=0x555555a8d360 [NMModemBroadband]) at nm-modem-broadband.c:529
  #9  0x00007fffea01264d in connect_ready (simple_iface=<optimized out>, res=<optimized out>, self=0x555555a8d360 [NMModemBroadband]) at nm-modem-broadband.c:378
  #10 0x00007ffff546a297 in g_simple_async_result_complete (simple=0x7fffe00104e0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
  #11 0x00007fffe9d82fec in connect_context_complete_and_free (ctx=ctx@entry=0x555555c52f60) at mm-modem-simple.c:93
  #12 0x00007fffe9d83155 in simple_connect_ready (self=0x7fffdc00b9f0 [MMModemSimple], res=0x7fffdc004410, ctx=0x555555c52f60) at mm-modem-simple.c:159
  #13 0x00007ffff547af93 in g_task_return_now (task=0x7fffdc004410 [GTask]) at gtask.c:1106
  #14 0x00007ffff547b62e in g_task_return (task=0x7fffdc004410 [GTask], type=<optimized out>) at gtask.c:1164
  #15 0x00007ffff54d4239 in reply_cb (connection=<optimized out>, res=<optimized out>, user_data=0x7fffdc004410) at gdbusproxy.c:2570
  #16 0x00007ffff547af93 in g_task_return_now (task=0x7fffdc004340 [GTask]) at gtask.c:1106
  #17 0x00007ffff547b62e in g_task_return (task=0x7fffdc004340 [GTask], type=<optimized out>) at gtask.c:1164
  #18 0x00007ffff54c8c9f in g_dbus_connection_call_done (source=<optimized out>, result=0x555555a60920, user_data=0x7fffdc004340) at gdbusconnection.c:5702
  #19 0x00007ffff547af93 in g_task_return_now (task=0x555555a60920 [GTask]) at gtask.c:1106
  #20 0x00007ffff547afc9 in complete_in_idle_cb (task=0x555555a60920) at gtask.c:1120
  #21 0x00007ffff4eb7d7a in g_main_context_dispatch (context=0x555555a4a000) at gmain.c:3152
  #22 0x00007ffff4eb7d7a in g_main_context_dispatch (context=context@entry=0x555555a4a000) at gmain.c:3767
  #23 0x00007ffff4eb80b8 in g_main_context_iterate (context=0x555555a4a000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
  #24 0x00007ffff4eb838a in g_main_loop_run (loop=0x555555a48780) at gmain.c:4032
  #25 0x00005555555aebf2 in main (argc=1, argv=0x7fffffffdc48) at main.c:477
  (gdb)

(cherry picked from commit 702b74c9f7)
2016-05-10 16:53:42 +02:00
Lubomir Rintel
741be402fb modem-broadband: ignore late callbacks
If libmm invokes callbacks after the connect context has been disposed
we should just ignore them. Fixes crash on dereferencing already freed
connect context (due to explicit disconnection while the modem is
connecting):

  NetworkManager[29074]: <info>  [1462383917.8718] (ttyACM1): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested)
  NetworkManager[29074]: <info>  [1462383917.8719] (ttyACM1): modem state changed, 'registered' --> 'connecting' (reason: user-requested)
  NetworkManager[29074]: <info>  [1462383917.8720] device (ttyACM1): state change: deactivating -> disconnected (reason 'connection-removed') [110 30 38]
  NetworkManager[29074]: <info>  [1462383917.8758] (ttyACM1): modem state changed, 'connecting' --> 'disconnecting' (reason: user-requested)
  NetworkManager[29074]: <warn>  [1462383917.8909] (ttyACM1): failed to connect modem: Dial operation has been cancelled

  (NetworkManager:29074): NetworkManager-wwan-CRITICAL **: modem_prepare_result: assertion 'state == NM_DEVICE_STATE_PREPARE' failed
  NetworkManager[29074]: <info>  [1462383917.8912] (ttyACM1): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested)
  NetworkManager[29074]: <info>  [1462383917.8913] (ttyACM1): modem state changed, 'registered' --> 'connecting' (reason: user-requested)
  NetworkManager[29074]: <info>  [1462383917.9693] (ttyACM1): modem state changed, 'connecting' --> 'registered' (reason: user-requested)

  Program received signal SIGSEGV, Segmentation fault.
  connect_ready (simple_iface=<optimized out>, res=0x7fffe0009200, self=0x555555a8d670 [NMModemBroadband]) at nm-modem-broadband.c:329
  329                     if (!ctx->first_error) {
  (gdb) bt
  #0  0x00007fffea01272a in connect_ready (simple_iface=<optimized out>, res=0x7fffe0009200, self=0x555555a8d670 [NMModemBroadband]) at nm-modem-broadband.c:329
  #1  0x00007ffff546a297 in g_simple_async_result_complete (simple=0x7fffe0009200 [GSimpleAsyncResult]) at gsimpleasyncresult.c:801
  #2  0x00007fffe9d82fec in connect_context_complete_and_free (ctx=ctx@entry=0x7fffdc00c550) at mm-modem-simple.c:93
  #3  0x00007fffe9d83155 in simple_connect_ready (self=0x7fffdc00c960 [MMModemSimple], res=0x555555a7c2b0, ctx=0x7fffdc00c550) at mm-modem-simple.c:159
  #4  0x00007ffff547af93 in g_task_return_now (task=0x555555a7c2b0 [GTask]) at gtask.c:1106
  #5  0x00007ffff547b62e in g_task_return (task=0x555555a7c2b0 [GTask], type=<optimized out>) at gtask.c:1164
  #6  0x00007ffff54d4239 in reply_cb (connection=<optimized out>, res=<optimized out>, user_data=0x555555a7c2b0) at gdbusproxy.c:2570
  #7  0x00007ffff547af93 in g_task_return_now (task=0x7fffdc004470 [GTask]) at gtask.c:1106
  #8  0x00007ffff547b62e in g_task_return (task=0x7fffdc004470 [GTask], type=<optimized out>) at gtask.c:1164
  #9  0x00007ffff54c8c9f in g_dbus_connection_call_done (source=<optimized out>, result=0x7fffe00036f0, user_data=0x7fffdc004470) at gdbusconnection.c:5702
  #10 0x00007ffff547af93 in g_task_return_now (task=0x7fffe00036f0 [GTask]) at gtask.c:1106
  #11 0x00007ffff547afc9 in complete_in_idle_cb (task=0x7fffe00036f0) at gtask.c:1120
  #12 0x00007ffff4eb7d7a in g_main_context_dispatch (context=0x555555a4a000) at gmain.c:3152
  #13 0x00007ffff4eb7d7a in g_main_context_dispatch (context=context@entry=0x555555a4a000) at gmain.c:3767
  #14 0x00007ffff4eb80b8 in g_main_context_iterate (context=0x555555a4a000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838
  #15 0x00007ffff4eb838a in g_main_loop_run (loop=0x555555a48780) at gmain.c:4032
  #16 0x00005555555aebf2 in main (argc=1, argv=0x7fffffffdc78) at main.c:477
  (gdb)

(cherry picked from commit aa0b379699)
2016-05-10 16:53:42 +02:00
Thomas Haller
ce05f19c68 device: disconnect platform signal handlers first in dispose
Once we start with dispose, we certainly don't want to process any platform
events for the device anymore.

Previously, we disconnect those handlers only later during dispose, so it's
not clear that we would not receive a device_ipx_changed signal after _cleanup_generic_pre().

Fix this possible (or actual) bug.

(cherry picked from commit 0175056a6d)
2016-05-05 12:28:22 +02:00
Thomas Haller
953300d48a device: don't cancel queued_ip4_config_id when scheduling activate_stage5_ip4_config_commit
Since commit a47c13a7a2, update_ip4_config() re-schedules
itself in case activate_stage5_ip4_config_commit is pending. Thus, there is no need to
cancel any queued queued_ip4_config_id.

Also as that does not properly fix the issue unlike a47c13a7a.

(cherry picked from commit 73cec4e912)
2016-05-05 12:05:23 +02:00
Thomas Haller
1f04cef99d device: ensure not rescheduling IP config changed on initial capture
update_ip4_config() and update_ip6_config() are called from nm_device_capture_initial_config().
At that point, we don't expect any activation-source scheduled, thus the "if" should not
not be hit anyway.

So, this patch should actually make no difference, but it seems clearer
to me. Also, because it would be a bug to re-schedule the idle handler
that is already pending, but from inspecting nm_device_capture_initial_config()
it is not immediately clear that this cannot be the case.

(cherry picked from commit bac06c5ae6)
2016-05-05 12:05:22 +02:00
Thomas Haller
dbc735d3f8 device: add assertions for queued_ip4_config_change() and queued_ip6_config_change()
(cherry picked from commit ec2a21702a)
2016-05-05 12:05:21 +02:00
Thomas Haller
6af508cebd device: refactor clearing @queued_ip4_config_id and @queued_ip6_config_id
(cherry picked from commit b6a92cbdc3)
2016-05-05 12:05:20 +02:00
Thomas Haller
4a1b7f40c6 device: improve error message for failure to reapply
(cherry picked from commit c71bd9df82)
2016-05-03 11:59:35 +02:00