|
|
613f66 |
From 6347e939e6210c8f6bc40f8b43f41acec27ea6b8 Mon Sep 17 00:00:00 2001
|
|
|
613f66 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
613f66 |
Date: Sat, 29 Feb 2020 19:14:10 +0100
|
|
|
613f66 |
Subject: [PATCH 1/2] dhcp: clean source on dispatch failure
|
|
|
613f66 |
|
|
|
613f66 |
Fix the following warning:
|
|
|
613f66 |
|
|
|
613f66 |
NetworkManager[1524461]: Source ID 3844 was not found when attempting to remove it
|
|
|
613f66 |
|
|
|
613f66 |
g_logv (log_domain=0x7f2816fa676e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7ffe697374d0) at gmessages.c:1391
|
|
|
613f66 |
g_log (log_domain=log_domain@entry=0x7f2816fa676e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f2816fae240 "Source ID %u was not found when attempting to remove it") at gmessages.c:1432
|
|
|
613f66 |
g_source_remove (tag=519) at gmain.c:2352
|
|
|
613f66 |
nm_clear_g_source (id=<optimized out>) at ./shared/nm-glib-aux/nm-macros-internal.h:1198
|
|
|
613f66 |
dispose (object=0x55f7289b1ca0) at src/dhcp/nm-dhcp-nettools.c:1433
|
|
|
613f66 |
g_object_unref (_object=<optimized out>) at gobject.c:3303
|
|
|
613f66 |
g_object_unref (_object=0x55f7289b1ca0) at gobject.c:3232
|
|
|
613f66 |
dhcp4_cleanup (self=self@entry=0x55f728af3b20, cleanup_type=cleanup_type@entry=CLEANUP_TYPE_DECONFIGURE, release=release@entry=0) at src/devices/nm-device.c:7565
|
|
|
613f66 |
...
|
|
|
613f66 |
|
|
|
613f66 |
Fixes: 45521b1b3872 ('dhcp: nettools: move to failed state if event dispatch fails')
|
|
|
613f66 |
(cherry picked from commit 843d696e46d96eb30642d872ba6c1a46c900ca14)
|
|
|
613f66 |
(cherry picked from commit 7a004ef0bb49717606acbf47326a4c6c753cb09b)
|
|
|
613f66 |
---
|
|
|
613f66 |
src/dhcp/nm-dhcp-nettools.c | 1 +
|
|
|
613f66 |
1 file changed, 1 insertion(+)
|
|
|
613f66 |
|
|
|
613f66 |
diff --git a/src/dhcp/nm-dhcp-nettools.c b/src/dhcp/nm-dhcp-nettools.c
|
|
|
613f66 |
index 45ff46f53fbd..2af73cdc3c3c 100644
|
|
|
613f66 |
--- a/src/dhcp/nm-dhcp-nettools.c
|
|
|
613f66 |
+++ b/src/dhcp/nm-dhcp-nettools.c
|
|
|
613f66 |
@@ -1074,6 +1074,7 @@ dhcp4_event_cb (GIOChannel *source,
|
|
|
613f66 |
*/
|
|
|
613f66 |
_LOGE ("error %d dispatching events", r);
|
|
|
613f66 |
nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL);
|
|
|
613f66 |
+ priv->event_id = 0;
|
|
|
613f66 |
return G_SOURCE_REMOVE;
|
|
|
613f66 |
}
|
|
|
613f66 |
|
|
|
613f66 |
--
|
|
|
613f66 |
2.24.1
|
|
|
613f66 |
|
|
|
613f66 |
|
|
|
613f66 |
From b978458c375e06722ae16b332d26b9678c0da455 Mon Sep 17 00:00:00 2001
|
|
|
613f66 |
From: Thomas Haller <thaller@redhat.com>
|
|
|
613f66 |
Date: Tue, 3 Mar 2020 09:50:43 +0100
|
|
|
613f66 |
Subject: [PATCH 2/2] dhcp/nettools: first clear source before emitting event
|
|
|
613f66 |
in dhcp4_event_cb()
|
|
|
613f66 |
|
|
|
613f66 |
A similar patch was done on master, but here the situation is different.
|
|
|
613f66 |
|
|
|
613f66 |
I feel we should not allow for the possibility where we invoke an event
|
|
|
613f66 |
that might mess with the source id. In practice there was no problem.
|
|
|
613f66 |
But it feels cleaner to clear it first.
|
|
|
613f66 |
|
|
|
613f66 |
Fixes: 843d696e46d9 ('dhcp: clean source on dispatch failure')
|
|
|
613f66 |
(cherry picked from commit 0549351111ccfde9d6a404952c43234612028d13)
|
|
|
613f66 |
(cherry picked from commit beeb067c71b4b67778badb6eed6ee2dd00a5218f)
|
|
|
613f66 |
---
|
|
|
613f66 |
src/dhcp/nm-dhcp-nettools.c | 2 +-
|
|
|
613f66 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
613f66 |
|
|
|
613f66 |
diff --git a/src/dhcp/nm-dhcp-nettools.c b/src/dhcp/nm-dhcp-nettools.c
|
|
|
613f66 |
index 2af73cdc3c3c..622251a31c27 100644
|
|
|
613f66 |
--- a/src/dhcp/nm-dhcp-nettools.c
|
|
|
613f66 |
+++ b/src/dhcp/nm-dhcp-nettools.c
|
|
|
613f66 |
@@ -1073,8 +1073,8 @@ dhcp4_event_cb (GIOChannel *source,
|
|
|
613f66 |
* a predefined number of times (possibly infinite).
|
|
|
613f66 |
*/
|
|
|
613f66 |
_LOGE ("error %d dispatching events", r);
|
|
|
613f66 |
- nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL);
|
|
|
613f66 |
priv->event_id = 0;
|
|
|
613f66 |
+ nm_dhcp_client_set_state (NM_DHCP_CLIENT (self), NM_DHCP_STATE_FAIL, NULL, NULL);
|
|
|
613f66 |
return G_SOURCE_REMOVE;
|
|
|
613f66 |
}
|
|
|
613f66 |
|
|
|
613f66 |
--
|
|
|
613f66 |
2.24.1
|
|
|
613f66 |
|