From cc9bace8328b40879236a84fd509a440d63db69e Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Wed, 5 Dec 2018 08:19:04 +0900 Subject: [PATCH] Remove GSource before calling g_timeout_add() Change-Id: I4f7af8297b298496e31577c381fd02b1024a0f23 Signed-off-by: Cheoleun Moon --- src/ip-conflict-detect.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ip-conflict-detect.c b/src/ip-conflict-detect.c index 4f9fc98..a2492e6 100755 --- a/src/ip-conflict-detect.c +++ b/src/ip-conflict-detect.c @@ -136,6 +136,8 @@ static gboolean __arp_reply_timeout_cb(gpointer data) initial_bursts = true; } + if (sd->timer_id > 0) + g_source_remove(sd->timer_id); sd->timer_id = g_timeout_add(sd->timeout, send_arp, sd); return G_SOURCE_REMOVE; } @@ -324,6 +326,7 @@ static gboolean send_arp(gpointer data) } g_source_remove(sd->timer_id); + sd->timer_id = 0; if (conflict_state == NETCONFIG_IP_CONFLICT_STATE_CONFLICT_DETECTED || initial_bursts) sd->timeout = BURST_ARP_SEND_TIME; -- 2.34.1