Merge branch 'bugfix/fix_smartconfig_setopt_fail_v4.3' into 'release/v4.3'

smartconfig: Fix smartconfig set socket option fail(backport v4.3)

See merge request espressif/esp-idf!16771
This commit is contained in:
Jiang Jiang Jian
2022-02-14 13:03:35 +00:00

View File

@@ -127,7 +127,15 @@ static void sc_ack_send_task(void *pvParameters)
goto _end; goto _end;
} }
setsockopt(send_sock, SOL_SOCKET, SO_BROADCAST | SO_REUSEADDR, &optval, sizeof(int)); if (setsockopt(send_sock, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(int)) < 0) {
ESP_LOGE(TAG, "setsockopt SO_BROADCAST failed");
goto _end;
}
if (setsockopt(send_sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(int)) < 0) {
ESP_LOGE(TAG, "setsockopt SO_REUSEADDR failed");
goto _end;
}
if (ack->type == SC_TYPE_AIRKISS) { if (ack->type == SC_TYPE_AIRKISS) {
char data = 0; char data = 0;