Remove GSource before calling g_timeout_add() 62/194462/1 accepted/tizen/unified/20181205.154818 submit/tizen/20181205.011946
authorCheoleun Moon <chleun.moon@samsung.com>
Tue, 4 Dec 2018 23:19:04 +0000 (08:19 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Tue, 4 Dec 2018 23:19:10 +0000 (08:19 +0900)
Change-Id: I4f7af8297b298496e31577c381fd02b1024a0f23
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
src/ip-conflict-detect.c

index 4f9fc98..a2492e6 100755 (executable)
@@ -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;