From: Cheoleun Moon Date: Tue, 4 Dec 2018 23:19:04 +0000 (+0900) Subject: Remove GSource before calling g_timeout_add() X-Git-Tag: accepted/tizen/unified/20181205.154818^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=672f8e4d5b8c3a411074e0007dafdf8e08d6d813;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Remove GSource before calling g_timeout_add() Change-Id: I4f7af8297b298496e31577c381fd02b1024a0f23 Signed-off-by: Cheoleun Moon --- 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;