summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-01-25 09:47:02 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2016-01-25 15:22:15 +0100
commit94b4e1515fac9b6e59e53789fbb93caca423e84a (patch)
tree906e16307aa1ec1e82b08cb411cdb345a75cb7ec
parent7aff24478a13cc074f483f2c42788b0ed0187d68 (diff)
downloadNetworkManager-bg/internal-dhcp-fixes.tar.gz
dhcp/systemd: disable callback before stopping the clientbg/internal-dhcp-fixes
Otherwise the call to stop() would generate a new unwanted state transition.
-rw-r--r--src/dhcp-manager/nm-dhcp-systemd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c
index ca4027e8dd..2dc351dbee 100644
--- a/src/dhcp-manager/nm-dhcp-systemd.c
+++ b/src/dhcp-manager/nm-dhcp-systemd.c
@@ -815,10 +815,13 @@ stop (NMDhcpClient *client, gboolean release, const GByteArray *duid)
NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (client);
int r = 0;
- if (priv->client4)
+ if (priv->client4) {
+ sd_dhcp_client_set_callback (priv->client4, NULL, NULL);
r = sd_dhcp_client_stop (priv->client4);
- else if (priv->client6)
+ } else if (priv->client6) {
+ sd_dhcp6_client_set_callback (priv->client6, NULL, NULL);
r = sd_dhcp6_client_stop (priv->client6);
+ }
if (r) {
nm_log_warn (priv->client6 ? LOGD_DHCP6 : LOGD_DHCP4,