[Bugfix][API-1547] Change RIL FWK broadcast addr to 127.255.255.255
Only Configure: No
Affected branch: LYNQ_PUBLIC master
Affected module: RIL
Is it affected on both ZXIC and MTK: only MTK
Self-test: Yes
Doc Update: No
Change-Id: I1538fed1ad6fccdee69b607423b97bb6598dfc5a
diff --git a/common_src/framework/lynq-ril-service/src/ril.cpp b/common_src/framework/lynq-ril-service/src/ril.cpp
index ef41d33..bf24c67 100755
--- a/common_src/framework/lynq-ril-service/src/ril.cpp
+++ b/common_src/framework/lynq-ril-service/src/ril.cpp
@@ -170,6 +170,12 @@
#define LYNQ_SERVICE_PORT 8088
#define LYNQ_AT_SERVICE_PORT 8087
#define LYNQ_BRODCAST_PORT 8086
+#ifdef GSW_RIL_CFG
+/*Interfaces lo net addr 127.0.0.1,mask 255.0.0.0,so lo broadcast addr is 127.255.255.255*/
+#define LYNQ_RIL_FWK_BROADCAST_IP "127.255.255.255" /*hong.liu change broadcast addr on 2024.2.18*/
+#else
+#define LYNQ_RIL_FWK_BROADCAST_IP "255.255.255.255"
+#endif
#define LYNQ_SOCKET_BUFFER (1024*8+sizeof(int)*3+10)
/*lei add*/
#define LYNQ_AT_SOCKET_BUFFER 1024
@@ -6052,8 +6058,6 @@
perror("creaet socket for udp fail");
return;
}
- /* 设置socket允许重复使用地址与端口,SO_REUSEADDR值为2 */
- //setsockopt(socket_fd,SOL_SOCKET,SO_REUSEADDR,&on,sizeof on);
/* 使能广播功能,SO_BROADCAST值为6 */
ret= setsockopt(lynq_urc_socket_fd,SOL_SOCKET,SO_BROADCAST,&on,sizeof(on));
if(ret<0)
@@ -6076,8 +6080,8 @@
urc_broadcast_addr.sin_family = AF_INET; //IPv4
urc_broadcast_addr.sin_port = htons(LYNQ_BRODCAST_PORT);
- urc_broadcast_addr.sin_addr.s_addr = inet_addr("255.255.255.255" );//255.255.255.255 broadcast addrress.
- printf("LYNQ_RIL_urcClientInit success!!!\n");
+ urc_broadcast_addr.sin_addr.s_addr = inet_addr(LYNQ_RIL_FWK_BROADCAST_IP);/*hong.liu change broadcast addr on 2024.2.18*/
+ RLOGE("LYNQ_RIL_urcClientInit success!!!");
return;
}