From 6e31e64f8e7772dad0086fa739b51ae7a2b13dae Mon Sep 17 00:00:00 2001 From: Zhang Jun Hao Date: Fri, 19 Oct 2018 17:40:12 +0800 Subject: [PATCH] fix(smartconfig): fix ip address error in smartconfig callback --- components/smartconfig_ack/smartconfig_ack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/smartconfig_ack/smartconfig_ack.c b/components/smartconfig_ack/smartconfig_ack.c index 0bdaa48c..99408ef0 100644 --- a/components/smartconfig_ack/smartconfig_ack.c +++ b/components/smartconfig_ack/smartconfig_ack.c @@ -47,7 +47,8 @@ static void sc_ack_send_task(void *pvParameters) { sc_ack_t *ack = (sc_ack_t *)pvParameters; tcpip_adapter_ip_info_t local_ip; - uint8_t *remote_ip = ack->ctx.ip; + uint8_t remote_ip[4]; + memcpy(remote_ip, ack->ctx.ip, sizeof(remote_ip)); int remote_port = (ack->type == SC_ACK_TYPE_ESPTOUCH) ? SC_ACK_TOUCH_SERVER_PORT : SC_ACK_AIRKISS_SERVER_PORT; struct sockaddr_in server_addr; socklen_t sin_size = sizeof(server_addr);