From 9b11c0b174bd543ababb4d8b757f49cd37edab55 Mon Sep 17 00:00:00 2001 From: Senthil Kumar G S Date: Thu, 24 Oct 2019 12:41:00 +0530 Subject: [PATCH] Set socket family for IPv4 Patch for [CONPRO-1509] https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/588 has a bug due to which the following error comes in Tizen Platform. "01-01 11:43:56.060+0900 E/OIC_CA_TCP_SERVER_1023(P 2022, T 2031): catcpserver.c: CATCPCreateSocket(1029) > bind socket failed: Address family not supported by protocol" Reason: Address family is not set. This patch fixes the issue. https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/commit/992729fd6eab4f1b57280f6502ce09d460ace39c (cherry-picked from 992729fd6eab4f1b57280f6502ce09d460ace39c) Change-Id: I98edd8c18ec8183bd2208d587599bf9ae294db12 Signed-off-by: Senthil Kumar G S Signed-off-by: Sudipto --- resource/csdk/connectivity/src/tcp_adapter/catcpserver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c index ad7f8fb..1a1702a 100755 --- a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c +++ b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c @@ -1024,6 +1024,7 @@ static CAResult_t CATCPCreateSocket(int family, CATCPSessionInfo_t *svritem) { struct sockaddr_in client; memset(&client, 0x00, sizeof(client)); + client.sin_family = AF_INET; inet_pton(AF_INET, host_address, &(client.sin_addr.s_addr)); if (-1 == bind(fd, (struct sockaddr *)&client, socklen)) { -- 2.7.4