diff options
author | Thomas Haller <thaller@redhat.com> | 2014-11-12 14:31:56 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-11-19 12:58:36 +0100 |
commit | 90a33321998de233aaa256ca73228647db0f1235 (patch) | |
tree | 0ab5fb59787b06d1f6d1df16807c704db929f1ac /src/devices | |
parent | b0b7473af1e6358fa5b694301f89f74c5bd79587 (diff) | |
download | NetworkManager-90a33321998de233aaa256ca73228647db0f1235.tar.gz |
firewall: invoke FwAddToZoneFunc callback also when cancelling
Not invoking a callback when cancelling the operation is counter
intuitive.
Note that NMPolicy refs the device, cancelling the call would leave
the reference hanging. That was not an issue because the call was
never cancelled. But still the behavior of NMFirewallManager is
unexpected.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/nm-device.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4a6ac2f151..2c60b69dd4 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4545,8 +4545,14 @@ out: static void fw_change_zone_cb (GError *error, gpointer user_data) { - NMDevice *self = NM_DEVICE (user_data); - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + NMDevice *self; + NMDevicePrivate *priv; + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + return; + + self = NM_DEVICE (user_data); + priv = NM_DEVICE_GET_PRIVATE (self); priv->fw_call = NULL; @@ -4555,7 +4561,6 @@ fw_change_zone_cb (GError *error, gpointer user_data) } activation_source_schedule (self, nm_device_activate_stage3_ip_config_start, 0); - _LOGI (LOGD_DEVICE, "Activation: Stage 3 of 5 (IP Configure Start) scheduled."); } @@ -4577,6 +4582,8 @@ nm_device_activate_schedule_stage3_ip_config_start (NMDevice *self) priv = NM_DEVICE_GET_PRIVATE (self); g_return_if_fail (priv->act_request); + g_return_if_fail (!priv->fw_call); + /* Add the interface to the specified firewall zone */ connection = nm_device_get_connection (self); g_assert (connection); |