From 0aff3787e495381a4f0875d221a4b1b55434375e Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Mon, 17 Feb 2020 21:06:15 +0900 Subject: [PATCH] Fix branch past initialization issue Change-Id: I250d6815e939b0e7d33b6a98efc1b3157135fa10 Signed-off-by: Jaehyun Kim --- src/ip-conflict-detect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ip-conflict-detect.c b/src/ip-conflict-detect.c index 2aad203..b21d958 100755 --- a/src/ip-conflict-detect.c +++ b/src/ip-conflict-detect.c @@ -152,6 +152,7 @@ static gboolean __netconfig_check_arp_receive(GIOChannel *source, char sbuf[WLAN_MAC_ADDR_MAX]; char tbuf[WLAN_MAC_ADDR_MAX]; const char *default_ip = NULL; + int mac_cmp = 0; if (g_io_channel_read_chars(source, buffer, ARP_PACKET_SIZE, &bytes_read, NULL) == G_IO_STATUS_NORMAL) { @@ -181,7 +182,7 @@ static gboolean __netconfig_check_arp_receive(GIOChannel *source, goto skip; } DBG("our mac= %s source mac= %s target mac= %s", netconfig_get_default_mac_address(), sbuf, tbuf); - int mac_cmp = strcmp(tbuf , netconfig_get_default_mac_address()); + mac_cmp = strcmp(tbuf , netconfig_get_default_mac_address()); if (mac_cmp != 0) { INFO("Packet not intended to us.\n"); goto out; -- 2.34.1