diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ffd1c33..def893ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,50 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [1.3.0](https://github.com/rdkcentral/utopia/compare/1.2.2...1.3.0) + +- XB10-2198: SYS_SH_dnsmasq_restart is continuous with 8.2p5s1 upgrade [`#119`](https://github.com/rdkcentral/utopia/pull/119) +- revert of kernel_pid.max val set from utopia_init.sh file [`#117`](https://github.com/rdkcentral/utopia/pull/117) +- RDKB-60798-IPv6 Support for WiFi Hotspot [`#115`](https://github.com/rdkcentral/utopia/pull/115) +- XER10-1687-Observing intermittent ovsh crash [`#114`](https://github.com/rdkcentral/utopia/pull/114) +- RDKB-61612 : WAN Failover Utility is required in Ethwan mode similar to DOCSIS [`#97`](https://github.com/rdkcentral/utopia/pull/97) +- RDKB-62232: Syntax error in /etc/utopia/service.d/service_ntpd.sh [`#111`](https://github.com/rdkcentral/utopia/pull/111) +- SHARMAN-1210:Add telemetry support to report FW info from both banks [`#70`](https://github.com/rdkcentral/utopia/pull/70) +- IPv6 support for WIFI hotspot [`#52`](https://github.com/rdkcentral/utopia/pull/52) +- Presence Notification [`04d5da3`](https://github.com/rdkcentral/utopia/commit/04d5da34148680adce639b27d63f790a5438832a) +- Merge tag '1.2.2' into develop [`3b14a92`](https://github.com/rdkcentral/utopia/commit/3b14a92d8a532ec9e34064eb5b0ddc861fe1c88f) +- Merge tag '1.2.1' into develop [`d652c3a`](https://github.com/rdkcentral/utopia/commit/d652c3a4266e78d843c330383c334f79a3e051ea) + +#### [1.2.2](https://github.com/rdkcentral/utopia/compare/1.2.1...1.2.2) + +> 28 October 2025 + +- Add CHANGELOG.md for hotfix 1.2.2 [`d101335`](https://github.com/rdkcentral/utopia/commit/d1013350a35701126277638f15726ada20e84ad9) +- RDKB-62232: Syntax error in /etc/utopia/service.d/service_ntpd.sh [`71f62ac`](https://github.com/rdkcentral/utopia/commit/71f62ac3e8601aaa4bb3147488bd40d49c127dfc) + +#### [1.2.1](https://github.com/rdkcentral/utopia/compare/1.2.0...1.2.1) + +> 23 October 2025 + +- RDKB-61777: [utopia] Code development to remove _64BIT_ARCH_SUPPORT_ macro [`#99`](https://github.com/rdkcentral/utopia/pull/99) +- XB9-429 : Upstream xb9 specific changes to github repo [`#53`](https://github.com/rdkcentral/utopia/pull/53) +- XF10-18 : XF10 Model support in Utopia Scripts [`#73`](https://github.com/rdkcentral/utopia/pull/73) +- RDKCOM-5434: RDKBDEV-3290,RDKBACCL-1052 fynecli connection was not established from remote ubuntu pc via 49153 port [`#47`](https://github.com/rdkcentral/utopia/pull/47) +- Update service_routed.c [`92feb43`](https://github.com/rdkcentral/utopia/commit/92feb43e4b9528b801ada6c7b6c5be286ba9329a) +- Update service_routed.c [`9eedf98`](https://github.com/rdkcentral/utopia/commit/9eedf983fbc74a4701b7e15226f2efea11040e8f) +- Add CHANGELOG.md for Release 1.2.1 [`9715e7f`](https://github.com/rdkcentral/utopia/commit/9715e7f5b7df31507f69a2e29e556b2baf5964d3) + #### [1.2.0](https://github.com/rdkcentral/utopia/compare/1.1.3...1.2.0) +> 9 October 2025 + - Update CODEOWNERS [`#100`](https://github.com/rdkcentral/utopia/pull/100) - Add the XF10 product common flag [`#72`](https://github.com/rdkcentral/utopia/pull/72) - RDKB-59938 : Observing SYSCFG DB stored with junk values [`#61`](https://github.com/rdkcentral/utopia/pull/61) - Deploy fossid_integration_stateless_diffscan_target_repo action [`#93`](https://github.com/rdkcentral/utopia/pull/93) - Update CODEOWNERS [`#81`](https://github.com/rdkcentral/utopia/pull/81) - Deploy cla action [`#82`](https://github.com/rdkcentral/utopia/pull/82) +- Add CHANGELOG.md for Release 1.2.0 [`29800ce`](https://github.com/rdkcentral/utopia/commit/29800ce8221a3251b5bab5fb0b43ded3ff82fab8) #### [1.1.3](https://github.com/rdkcentral/utopia/compare/1.1.2...1.1.3) diff --git a/source/firewall/firewall.c b/source/firewall/firewall.c index 0cb72caf..eff8ea68 100644 --- a/source/firewall/firewall.c +++ b/source/firewall/firewall.c @@ -697,6 +697,7 @@ char current_wan_ip6_addr[128]; bool isDefHttpsPortUsed = FALSE ; int current_wan_ipv6_num = 0; char default_wan_ifname[50]; // name of the regular wan interface +char hotspot_wan_ifname[50]; int rfstatus; /* * For timed internet access rules we use cron @@ -2468,6 +2469,19 @@ static int prepare_globals_from_configuration(void) pStr = NULL; } } + + // Update WIFI hotspot interface name -> from PSM + memset(hotspot_wan_ifname,0,sizeof(hotspot_wan_ifname)); + rc = PSM_VALUE_GET_STRING(PSM_HOTSPOT_WAN_IFNAME, pStr); + if(rc == CCSP_SUCCESS && pStr != NULL){ + FIREWALL_DEBUG("HotSpot wan interface fetched \n"); + safec_rc = strcpy_s(hotspot_wan_ifname, sizeof(hotspot_wan_ifname),pStr); + ERR_CHK(safec_rc); + Ansc_FreeMemory_Callback(pStr); + pStr = NULL; + } + FIREWALL_DEBUG(" line:%d current_wan_ifname:%s hotspot_wan_ifname %s \n" COMMA __LINE__ COMMA current_wan_ifname COMMA hotspot_wan_ifname); + memset(mesh_wan_ipv6addr,0,sizeof(mesh_wan_ipv6addr)); get_ip6address(mesh_wan_ifname, mesh_wan_ipv6addr, &mesh_wan_ipv6_num,IPV6_ADDR_SCOPE_GLOBAL); #endif @@ -5264,6 +5278,37 @@ static int do_nat_ephemeral(FILE *fp) return(0); } +void applyHotspotPostRoutingRules(FILE *fp, bool isIpv4) +{ + FIREWALL_DEBUG(" Entering applyHotspotPostRoutingRules \n"); + char sysEventName[256]; + if (isIpv4 == true) + { + if(strncmp(current_wan_ifname, hotspot_wan_ifname, strlen(current_wan_ifname) ) == 0) + { + FIREWALL_DEBUG("Apply Post Routing Rules for IPv4\n"); + FIREWALL_DEBUG("Source natting all traffic on %s interface to %s address\n" COMMA current_wan_ifname COMMA current_wan_ipaddr); + fprintf(fp, "-A postrouting_towan -o %s -j SNAT --to-source %s\n" , current_wan_ifname, current_wan_ipaddr); + } + } + else + { + memset(current_wan_ip6_addr, 0, sizeof(current_wan_ip6_addr)); + memset(sysEventName, 0, sizeof(sysEventName)); + snprintf(sysEventName, sizeof(sysEventName),"tr_%s_dhcpv6_client_v6addr", hotspot_wan_ifname); + sysevent_get(sysevent_fd, sysevent_token, sysEventName, current_wan_ip6_addr, sizeof(current_wan_ip6_addr)); + + if(strncmp(current_wan_ifname, hotspot_wan_ifname, strlen(current_wan_ifname) ) == 0) + { + FIREWALL_DEBUG("Apply Post Routing Rules for IPv6\n"); + FIREWALL_DEBUG("Source natting all traffic on %s interface to %s address\n" COMMA current_wan_ifname COMMA current_wan_ip6_addr); + fprintf(fp, "-A POSTROUTING -o %s -j SNAT --to-source %s\n", current_wan_ifname, current_wan_ip6_addr); + } + + } + FIREWALL_DEBUG(" Exiting applyHotspotPostRoutingRules \n"); +} + #if defined(_BWG_PRODUCT_REQ_) /* * Procedure : do_raw_table_staticip @@ -5416,7 +5461,14 @@ static int do_wan_nat_lan_clients(FILE *fp) #ifdef RDKB_EXTENDER_ENABLED fprintf(fp, "-A postrouting_towan -j MASQUERADE\n"); #else + #ifdef WAN_FAILOVER_SUPPORTED + if (0 == checkIfULAEnabled()) + { + applyHotspotPostRoutingRules(fp, true); + } else { fprintf(fp, "-A postrouting_towan -j SNAT --to-source %s\n", natip4); + } + #endif #endif #if defined (FEATURE_MAPT) || defined (FEATURE_SUPPORT_MAPT_NAT46) } @@ -9311,30 +9363,59 @@ static int do_parcon_mgmt_site_keywd(FILE *fp, FILE *nat_fp, int iptype, FILE *c } else if (strncasecmp(method, "KEYWD", 5)==0) { - // consider the case that user input whole url. - if(strstr(query, "://") != 0) { - fprintf(fp, "-A lan2wan_pc_site -m string --string \"%s\" --algo kmp --icase -j %s\n", strstr(query, "://") + 3, drop_log); -#if defined(_HUB4_PRODUCT_REQ_) || defined (_RDKB_GLOBAL_PRODUCT_REQ_) -#if defined (_RDKB_GLOBAL_PRODUCT_REQ_) - if( 0 == strncmp( devicePartnerId, "sky-", 4 ) ) -#endif - { - //In Hub4 keyword blocking feature is not working with FORWARD chain rules as CPE (dnsmasq) acts as DNS Proxy. - //Add rules in INPUT chain to resolve this issue. - fprintf(fp, "-I INPUT -i %s -j lan2wan_pc_site \n", lan_ifname); - } -#endif + const char *keyword = NULL; + int range_max = 1024; //max payload bytes to filter + int range_multiplier = 2; + + // Extract keyword if user input is a full URL + if (strstr(query, "://") != NULL) { + keyword = strstr(query, "://") + 3; } else { - fprintf(fp, "-A lan2wan_pc_site -m string --string \"%s\" --algo kmp --icase -j %s\n", query, drop_log); + keyword = query; + } + + if (keyword == NULL || strlen(keyword) == 0) { + fprintf(stderr, "Warning: Empty keyword, skipping rule generation.\n"); + return(0); + } + + // Create rules for various ranges of payload to filter + int from,to; + for (from = 0, to = 64; from < range_max; from = to, to = (to * range_multiplier > range_max) ? range_max : to * range_multiplier) + { + char chainName[64] = {'\0'}; + + // Create new chain + // linux iptables chainname length is max 29 chars + snprintf(chainName, sizeof(chainName), "LOG_SiteBlk_KW_%d_%d", from, to); + fprintf(fp, ":%s - [0:0]\n", chainName); + + // Add rule to jump to private chain if "Host:" is found in this offset range + fprintf(fp, "-A lan2wan_pc_site -p tcp --dport 80 -m string --string \"Host:\" --algo kmp --from %d --to %d --icase -j %s\n", + from, to, chainName); + + // Add rule to match keyword in private chain within same offset range + fprintf(fp, "-A %s -m string --string \"%s\" --algo kmp --from %d --to %d --icase -j %s\n", + chainName, keyword, from, to, drop_log); + + // Default rule to return if not matched + fprintf(fp, "-A %s -j RETURN\n", chainName); + } + + // Add rule for https filter + fprintf(fp, "-A lan2wan_pc_site -p tcp --dport 443 -m string --string \"%s\" --algo kmp --icase -j %s\n", + keyword, drop_log); + #if defined(_HUB4_PRODUCT_REQ_) || defined (_RDKB_GLOBAL_PRODUCT_REQ_) #if defined (_RDKB_GLOBAL_PRODUCT_REQ_) - if( 0 == strncmp( devicePartnerId, "sky-", 4 ) ) -#endif - { - fprintf(fp, "-I INPUT -i %s -j lan2wan_pc_site \n", lan_ifname); - } + if( 0 == strncmp( devicePartnerId, "sky-", 4 ) ) #endif + { + //In Hub4 keyword blocking feature is not working with FORWARD chain rules as CPE (dnsmasq) acts as DNS Proxy. + //Add rules in INPUT chain to resolve this issue. + fprintf(fp, "-I INPUT -i %s -j lan2wan_pc_site \n", lan_ifname); } +#endif } } } diff --git a/source/firewall/firewall.h b/source/firewall/firewall.h index a89ec934..8e28cc43 100644 --- a/source/firewall/firewall.h +++ b/source/firewall/firewall.h @@ -115,6 +115,7 @@ extern int sysevent_fd; extern char sysevent_ip[19]; extern unsigned short sysevent_port; #define PSM_VALUE_GET_STRING(name, str) PSM_Get_Record_Value2(bus_handle, CCSP_SUBSYS, name, NULL, &(str)) +#define PSM_HOTSPOT_WAN_IFNAME "dmsb.wanmanager.if.3.Name" int get_ip6address (char * ifname, char ipArry[][40], int * p_num, unsigned int scope_in); @@ -347,6 +348,8 @@ extern char dev_type[20]; extern char mesh_wan_ifname[32]; #endif +void applyHotspotPostRoutingRules(FILE *fp, bool isIpv4); +extern char hotspot_wan_ifname[50]; extern int current_wan_ipv6_num; extern char default_wan_ifname[50]; // name of the regular wan interface extern char current_wan_ipv6[IF_IPV6ADDR_MAX][40]; diff --git a/source/firewall/firewall_ipv6.c b/source/firewall/firewall_ipv6.c index be0e81d6..fb1f7907 100644 --- a/source/firewall/firewall_ipv6.c +++ b/source/firewall/firewall_ipv6.c @@ -1959,6 +1959,10 @@ void do_ipv6_sn_filter(FILE* fp) { fprintf(fp, "-A PREROUTING -i %s -d %s -p ipv6-icmp -m icmp6 --icmpv6-type 135 -m limit --limit 20/sec -j ACCEPT\n", ifnames[i], mcastAddrStr); /* NS Throttling rules for WAN and LAN */ fprintf(fp, "-A PREROUTING -i %s -p ipv6-icmp -m icmp6 --icmpv6-type 135 -m limit --limit 20/sec -j ACCEPT\n", ifnames[i]); + if(strncmp(current_wan_ifname, hotspot_wan_ifname, strlen(current_wan_ifname) ) == 0) + { + fprintf(fp, "-A INPUT -s %s -i %s -p ipv6-icmp -m icmp6 --icmpv6-type 133 -m limit --limit 100/sec -j ACCEPT\n" , current_wan_ip6_addr , current_wan_ifname); + } fprintf(fp, "-A PREROUTING -i %s -p ipv6-icmp -m icmp6 --icmpv6-type 135 -j DROP\n", ifnames[i]); } @@ -2108,22 +2112,24 @@ int checkIfULAEnabled() void applyIpv6ULARules(FILE* fp) { - #ifdef RDKB_EXTENDER_ENABLED + #if defined (RDKB_EXTENDER_ENABLED) if(strlen(current_wan_ipv6[0]) > 0) { - FIREWALL_DEBUG("Source natting all traffic on %s interface to %s address\n" COMMA current_wan_ifname COMMA current_wan_ipv6); - - fprintf(fp, "-A POSTROUTING -o %s -j MASQUERADE\n",current_wan_ifname); + FIREWALL_DEBUG("Source natting all traffic on %s interface to %s address\n" COMMA current_wan_ifname COMMA current_wan_ipv6); + fprintf(fp, "-A POSTROUTING -o %s -j MASQUERADE\n",current_wan_ifname); } #else + FIREWALL_DEBUG("Applying applyIpv6ULARules \n"); applyRoutingRules(fp,GLOBAL_IPV6); applyRoutingRules(fp,ULA_IPV6); #endif } + #endif void do_ipv6_nat_table(FILE* fp) { + FIREWALL_DEBUG("Entering do_ipv6_nat_table \n"); char IPv6[INET6_ADDRSTRLEN] = "0"; fprintf(fp, "*nat\n"); fprintf(fp, ":%s - [0:0]\n", "prerouting_devices"); @@ -2217,7 +2223,19 @@ void do_ipv6_nat_table(FILE* fp) } } #ifdef _PLATFORM_RASPBERRYPI_ - fprintf(fp, "-A POSTROUTING -o %s -j MASQUERADE\n", current_wan_ifname); + if(strncmp(current_wan_ifname, hotspot_wan_ifname, strlen(current_wan_ifname) ) == 0) + { + #if defined (WAN_FAILOVER_SUPPORTED) + if (0 == checkIfULAEnabled()) + { + applyHotspotPostRoutingRules(fp, false); + } + #endif + } + else + { + fprintf(fp, "-A POSTROUTING -o %s -j MASQUERADE\n", current_wan_ifname); + } #endif #ifdef _PLATFORM_BANANAPI_R4_ diff --git a/source/igd/src/inc/igd_platform_dependent_inf.h b/source/igd/src/inc/igd_platform_dependent_inf.h index f580163e..2f291581 100644 --- a/source/igd/src/inc/igd_platform_dependent_inf.h +++ b/source/igd/src/inc/igd_platform_dependent_inf.h @@ -90,6 +90,9 @@ #elif defined(_XER5_PRODUCT_REQ_) #undef CONFIG_VENDOR_MODEL #define CONFIG_VENDOR_MODEL "VTER11QEL" +#elif defined(_XB9_PRODUCT_REQ_) + #undef CONFIG_VENDOR_MODEL + #define CONFIG_VENDOR_MODEL "CWA438TCOM" #elif defined(_XB10_PRODUCT_REQ_) #undef CONFIG_VENDOR_MODEL #if defined (IGD_SERCOMMXB10_INFO) diff --git a/source/scripts/init/defaults/system_defaults_arm b/source/scripts/init/defaults/system_defaults_arm index a3a7ad25..ace916f5 100755 --- a/source/scripts/init/defaults/system_defaults_arm +++ b/source/scripts/init/defaults/system_defaults_arm @@ -1429,6 +1429,8 @@ $DscpSleepInterval_2=0 #Ccsp CMagent Docsis linkdown timeout default value is 900sec $DocsisLinkDownTimeOut=900 +#Ccsp Ethagent EWAN linkdown timeout default value is 900sec +$EWanLinkDownTimeout=900 #LLDEnable default value is false $LldEnable=false diff --git a/source/scripts/init/service.d/pmon.sh b/source/scripts/init/service.d/pmon.sh index 8f8852f5..6674c713 100755 --- a/source/scripts/init/service.d/pmon.sh +++ b/source/scripts/init/service.d/pmon.sh @@ -93,8 +93,8 @@ do_check_process() { LOCAL_CONF_FILE=/tmp/pmon.conf$$ - # Add static pmon entries - echo "syseventd /var/run/syseventd.pid /etc/utopia/service.d/syseventd_restart.sh" > $LOCAL_CONF_FILE + # Add static pmon entries - commented-out below line - selfheal takes care of it. + # echo "syseventd /var/run/syseventd.pid /etc/utopia/service.d/syseventd_restart.sh" > $LOCAL_CONF_FILE # Add dynamic pmon entries stashed in sysevent # by various modules diff --git a/source/scripts/init/service.d/service_crond.sh b/source/scripts/init/service.d/service_crond.sh index 9bf96344..2ad282d2 100755 --- a/source/scripts/init/service.d/service_crond.sh +++ b/source/scripts/init/service.d/service_crond.sh @@ -190,7 +190,7 @@ service_start () addCron "48 * * * * sh /etc/sky/monitor_dhd_dump.sh &" fi - if [ "$BOX_TYPE" != "SR300" ] && [ "$BOX_TYPE" != "SE501" ] && [ "$BOX_TYPE" != "SR213" ] && [ "$BOX_TYPE" != "WNXL11BWL" ] && [ "$BOX_TYPE" != "SCER11BEL" ] && [ "$BOX_TYPE" != "SCXF11BFL" ]; then + if [ "$BOX_TYPE" != "SR300" ] && [ "$BOX_TYPE" != "SE501" ] && [ "$BOX_TYPE" != "WNXL11BWL" ] && [ "$BOX_TYPE" != "SCER11BEL" ] && [ "$BOX_TYPE" != "SCXF11BFL" ]; then #RDKB-43895 log the firmware bank informations in selfheal log echo "5 */12 * * * /usr/bin/FwBankInfo" >> $CRONTAB_FILE fi diff --git a/source/scripts/init/service.d/service_dhcp_server/dhcp_server_functions.sh b/source/scripts/init/service.d/service_dhcp_server/dhcp_server_functions.sh index 1a05bbf0..cd10fa2b 100755 --- a/source/scripts/init/service.d/service_dhcp_server/dhcp_server_functions.sh +++ b/source/scripts/init/service.d/service_dhcp_server/dhcp_server_functions.sh @@ -1202,7 +1202,7 @@ fi echo "${PREFIX}""dhcp-option=l2sd0.4090,6,$WAN_DHCP_NS" >> $LOCAL_DHCP_CONF fi - elif [ "$MODEL_NUM" = "CGM4331COM" ] || [ "$MODEL_NUM" = "CGM4981COM" ] || [ "$MODEL_NUM" = "CGM601TCOM" ] || [ "$MODEL_NUM" = "SG417DBCT" ] || [ "$MODEL_NUM" = "TG4482A" ] || [ "$BOX_TYPE" = "WNXL11BWL" ] || [ "$MODEL_NUM" = "CGA4332COM" ] || [ "$BOX_TYPE" = "SCER11BEL" ] || [ "$BOX_TYPE" = "SCXF11BFL" ] || [ "$BOX_TYPE" = "VNTXER5" ]; then + elif [ "$MODEL_NUM" = "CGM4331COM" ] || [ "$MODEL_NUM" = "CGM4981COM" ] || [ "$MODEL_NUM" = "CGM601TCOM" ] || [ "$MODEL_NUM" = "CWA438TCOM" ] || [ "$MODEL_NUM" = "SG417DBCT" ] || [ "$MODEL_NUM" = "TG4482A" ] || [ "$BOX_TYPE" = "WNXL11BWL" ] || [ "$MODEL_NUM" = "CGA4332COM" ] || [ "$BOX_TYPE" = "SCER11BEL" ] || [ "$BOX_TYPE" = "SCXF11BFL" ] || [ "$BOX_TYPE" = "VNTXER5" ]; then echo "interface=brlan112" >> $LOCAL_DHCP_CONF if [ "$BOX_TYPE" = "WNXL11BWL" ]; then echo "dhcp-range=169.254.70.5,169.254.70.253,255.255.255.0,infinite" >> $LOCAL_DHCP_CONF diff --git a/source/scripts/init/service.d/service_ntpd.sh b/source/scripts/init/service.d/service_ntpd.sh index 68167f87..6e68b819 100644 --- a/source/scripts/init/service.d/service_ntpd.sh +++ b/source/scripts/init/service.d/service_ntpd.sh @@ -550,7 +550,7 @@ service_start () fi #if [ -n "$QUICK_SYNC_WAN_IP" ]; then if [ -n "$PEER_INTERFACE_IP" ]; then - if [ "$BOX_TYPE" != "HUB4" ] && [ "$BOX_TYPE" != "SR300" ] && [ "$BOX_TYPE" != "SE501" ] && [ "$BOX_TYPE" != "SR213" ] && [ "$BOX_TYPE" != "WNXL11BWL" ] && [ "$NTPD_IMMED_PEER_SYNC" != "true" ] && [ "$BOX_TYPE" != "SCER11BEL" ] || && [ "$BOX_TYPE" != "SCXF11BFL" ]; then + if [ "$BOX_TYPE" != "HUB4" ] && [ "$BOX_TYPE" != "SR300" ] && [ "$BOX_TYPE" != "SE501" ] && [ "$BOX_TYPE" != "SR213" ] && [ "$BOX_TYPE" != "WNXL11BWL" ] && [ "$NTPD_IMMED_PEER_SYNC" != "true" ] && [ "$BOX_TYPE" != "SCER11BEL" ] && [ "$BOX_TYPE" != "SCXF11BFL" ]; then if [ -z "$SOURCE_PING_INTF" ]; then MASK="255.255.255.0" else diff --git a/source/scripts/init/system/utopia_init_xb6.sh b/source/scripts/init/system/utopia_init_xb6.sh index d899a82c..f21e3c78 100755 --- a/source/scripts/init/system/utopia_init_xb6.sh +++ b/source/scripts/init/system/utopia_init_xb6.sh @@ -771,7 +771,7 @@ if [ "$FACTORY_RESET_REASON" = "true" ]; then fi syscfg set X_RDKCENTRAL-COM_LastRebootReason "factory-reset" syscfg set X_RDKCENTRAL-COM_LastRebootCounter "1" - if [ "$MODEL_NUM" = "CGM4331COM" ] || [ "$MODEL_NUM" = "CGM4981COM" ] || [ "${MODEL_NUM}" = "CGM601TCOM" ] || [ "${MODEL_NUM}" = "SG417DBCT" ] || [ "$MODEL_NUM" = "CGM4140COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ] || [ "$MODEL_NUM" = "TG4482A" ] || [ "$MODEL_NUM" = "INTEL_PUMA" ]; then + if [ "$MODEL_NUM" = "CGM4331COM" ] || [ "$MODEL_NUM" = "CGM4981COM" ] || [ "${MODEL_NUM}" = "CGM601TCOM" ] || [ "${MODEL_NUM}" = "SG417DBCT" ] || [ "${MODEL_NUM}" = "CWA438TCOM" ] || [ "$MODEL_NUM" = "CGM4140COM" ] || [ "$MODEL_NUM" = "CGA4332COM" ] || [ "$MODEL_NUM" = "TG4482A" ] || [ "$MODEL_NUM" = "INTEL_PUMA" ]; then # Enable AUTOWAN by default for XB7, change is made here so that it will take effect only after FR syscfg set selected_wan_mode "0" fi @@ -783,7 +783,7 @@ if [ "$FACTORY_RESET_REASON" = "true" ]; then #syscfg set X_RDKCENTRAL-COM_LastRebootReason "WPS-Factory-Reset" #syscfg set X_RDKCENTRAL-COM_LastRebootCounter "1" rm -f /nvram/WPS_Factory_Reset - elif ([ "${MODEL_NUM}" = "CGM601TCOM" ] || [ "${MODEL_NUM}" = "SG417DBCT" ] || [ "${MODEL_NUM}" = "CVA601ZCOM" ]) && [ -f /nvram/.image_upgrade_and_FR_done ]; then + elif ([ "${MODEL_NUM}" = "CGM601TCOM" ] || [ "${MODEL_NUM}" = "SG417DBCT" ] || [ "${MODEL_NUM}" = "CWA438TCOM" ] || [ "${MODEL_NUM}" = "CVA601ZCOM" ]) && [ -f /nvram/.image_upgrade_and_FR_done ]; then echo "[utopia][init] Detected last reboot reason as FirmwareDownloadAndFactoryReset" if [ -e "/usr/bin/onboarding_log" ]; then /usr/bin/onboarding_log "[utopia][init] Detected last reboot reason as FirmwareDownloadAndFactoryReset" diff --git a/source/sysevent/lib/sysevent.h b/source/sysevent/lib/sysevent.h index 87d1aa43..56feea9f 100644 --- a/source/sysevent/lib/sysevent.h +++ b/source/sysevent/lib/sysevent.h @@ -93,11 +93,7 @@ extern "C" { * as is commonly done for reading from an fd into a buffer * and then using that buffer as a structure */ -#ifdef _64BIT_ARCH_SUPPORT_ -typedef char se_buffer[SE_MAX_MSG_SIZE+1] __attribute__ ((aligned(8))); -#else -typedef char se_buffer[SE_MAX_MSG_SIZE+1] __attribute__ ((aligned(4))); -#endif +typedef char se_buffer[SE_MAX_MSG_SIZE+1] __attribute__ ((aligned(sizeof(void*)))); /* * Errors diff --git a/source/sysevent/server/syseventd.h b/source/sysevent/server/syseventd.h index 1c68469c..8c126dab 100644 --- a/source/sysevent/server/syseventd.h +++ b/source/sysevent/server/syseventd.h @@ -96,11 +96,8 @@ extern sem_t worker_sem; // e.g Multinet process is taking more time to finish in some of the field units. #define MAX_ACTIVATION_BLOCKING_SECS 300 -#if defined (_64BIT_ARCH_SUPPORT_) -#define WORKER_THREAD_STACK_SIZE 8192*1024 /* the default stack size per process is 8MB */ -#else -#define WORKER_THREAD_STACK_SIZE 65536 -#endif +/* Scale stack size based on pointer size - larger for 64-bit architectures */ +#define WORKER_THREAD_STACK_SIZE (sizeof(void*) == 8 ? 8192*1024 : 65536) #define SANITY_THREAD_STACK_SIZE 65536 diff --git a/source/sysevent/server/syseventd_main.c b/source/sysevent/server/syseventd_main.c index 4cc1c071..08e2fabf 100644 --- a/source/sysevent/server/syseventd_main.c +++ b/source/sysevent/server/syseventd_main.c @@ -1388,6 +1388,8 @@ int main (int argc, char **argv) clilen = sizeof(cli_addr); int rc = select(maxfd, &rd_set, NULL, NULL, NULL); if (-1 == rc) { + // stop hogging processor in case of error + sleep(1); continue; } diff --git a/source/sysevent/server/worker_threads.c b/source/sysevent/server/worker_threads.c index c5b58094..d3165ef1 100644 --- a/source/sysevent/server/worker_threads.c +++ b/source/sysevent/server/worker_threads.c @@ -2950,6 +2950,10 @@ static int handle_message_from_trigger_thread(int fd) return(rc); } +static int is_valid_fd(int fd) +{ + return fd >= 0 && fcntl(fd, F_GETFD) != -1; +} /* * Procedure : worker_thread_main * Purpose : Thread start routine for worker @@ -3021,9 +3025,9 @@ void *worker_thread_main(void *arg) if ((global_clients.clients)[i].used) { int cur_fd; cur_fd = (global_clients.clients)[i].fd; - if (-1 == cur_fd) { + if (0 == is_valid_fd(cur_fd)) { SE_INC_LOG(ERROR, - printf("main select got used client with a bad fd. Ignoring\n"); + printf("Thread id %d line %d main select got used client with a bad fd. Ignoring cur_fd = %d\n",thread_get_id(worker_data_key), __LINE__, cur_fd); ) incr_stat_info(STAT_WORKER_MAIN_SELECT_BAD_FD); } else {