From bbe3d59fe747814cb44454a4e417bc45c15a3a1c Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Wed, 15 Apr 2026 12:31:57 -0400 Subject: [PATCH 01/13] RDKB-64484: Allow psid offset value 0 for MAPT config RDKB-64484: Allow psid offset value 0 for MAPT configuration Reason for change: Remove setting defalut value for PSID Offset to allow using psid offset 0 from the backend Test Procedure: Verify the psid offset 0 is configured for MAPT when CE receives it from DHCPV6 Option95 (suboption 93) response Risks: Low Priority:P1 --- .../DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index 51865edf..137749dd 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -216,8 +216,7 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); g_stMaptData.Ratio = 1 << (g_stMaptData.EaLen - (BUFLEN_32 - g_stMaptData.RuleIPv4PrefixLen)); - /* RFC default */ - g_stMaptData.PsidOffset = 6; + MAPT_LOG_INFO("<<>> g_stMaptData.Ratio : %u", g_stMaptData.Ratio); MAPT_LOG_INFO("<<>> bytesLeftOut : %u", bytesLeftOut); if ( bytesLeftOut > 0 ) @@ -235,11 +234,17 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); if ( uiSubOption == MAPT_OPTION_S46_PORT_PARAMS && uiSubOptionLen == 4 ) { - g_stMaptData.PsidOffset = (*(pCurOption += uiSubOptionLen))? - *pCurOption:6; + pCurOption += uiSubOptionLen; + g_stMaptData.PsidOffset = *pCurOption; g_stMaptData.PsidLen = *++pCurOption; - if ( !g_stMaptData.EaLen ) + // allowed PsidOffset values are 0 to 15 + if (g_stMaptData.PsidOffset > 15) + { + MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidOffset :%d"); + return STATUS_FAILURE; + } + if ( !g_stMaptData.EaLen ) { g_stMaptData.Ratio = 1 << g_stMaptData.PsidLen; } From 7e54d14ff11e88bb4f25b42f338bfbb7f96b08d0 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Wed, 15 Apr 2026 14:50:33 -0400 Subject: [PATCH 02/13] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index 137749dd..1e82ec00 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -241,7 +241,7 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); // allowed PsidOffset values are 0 to 15 if (g_stMaptData.PsidOffset > 15) { - MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidOffset :%d"); + MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidOffset :%u", g_stMaptData.PsidOffset); return STATUS_FAILURE; } if ( !g_stMaptData.EaLen ) From ddf62f1dbcfc469b15c087182c3de11481cd0ad5 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Wed, 15 Apr 2026 14:51:16 -0400 Subject: [PATCH 03/13] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index 1e82ec00..a38eed4b 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -240,11 +240,11 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); // allowed PsidOffset values are 0 to 15 if (g_stMaptData.PsidOffset > 15) - { - MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidOffset :%u", g_stMaptData.PsidOffset); + { + MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidOffset :%d"); return STATUS_FAILURE; - } - if ( !g_stMaptData.EaLen ) + } + if ( !g_stMaptData.EaLen ) { g_stMaptData.Ratio = 1 << g_stMaptData.PsidLen; } From 72019596b11ed8c4fa2fa564cb941eadfb5ce58d Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Wed, 15 Apr 2026 15:31:39 -0400 Subject: [PATCH 04/13] RDKB-64484: Allow psid offset value 0 for MAPT config RDKB-64484: Allow psid offset value 0 for MAPT configuration Reason for change: Remove setting defalut value for PSID Offset to allow using psid offset 0 from the backend Test Procedure: Verify the psid offset 0 is configured for MAPT when CE receives it from DHCPV6 Option95 (suboption 93) response Risks: Low Priority:P1 --- .../DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index a38eed4b..ce26a9d2 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -259,6 +259,42 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); MAPT_LOG_INFO("<<>> g_stMaptData.PsidLen : %u", g_stMaptData.PsidLen); MAPT_LOG_INFO("<<>> g_stMaptData.PsidOffset : %u", g_stMaptData.PsidOffset); MAPT_LOG_INFO("<<>> g_stMaptData.Ratio : %u", g_stMaptData.Ratio); + + /* ------------------------------------------------------------------ */ + /* Reserved Port Range Validation (0–1023) */ + /* ------------------------------------------------------------------ */ + { + UINT8 psidoffset = g_stMaptData.PsidOffset; + UINT8 psidLen = g_stMaptData.PsidLen; + UINT16 psid = g_stMaptData.Psid; + + /* Validate MAP-T bit allocation: psidLen + offset must fit within 16-bit port space + * to avoid negative shifts (m = 16 - (psidLen + offset)) and undefined behavior. + */ + if (psidLen <= 16 && (psidLen + psidoffset) <= 16) + { + UINT8 m = 16 - (psidLen + psidoffset); + + /* Lowest possible port for this CE */ + UINT32 min_port = (psid << m); + + /* Highest port in first block */ + UINT32 max_first_block = min_port + ((1 << m) - 1); + + if (min_port < 1024 || max_first_block < 1024) + { + MAPT_LOG_ERROR( + "MAP-T WARNING: Reserved port usage detected! psid=%u psidLen=%u offset=%u min_port=%u max_port=%u", + psid, psidLen, psidoffset, min_port, max_first_block + ); + } + } + else + { + MAPT_LOG_WARNING("MAP-T WARNING: Invalid MAP parameters! psidLen=%u offset=%u", psidLen, offset); + } + } + /* ------------------------------------------------------------------ */ MAPT_LOG_INFO("Parsing OPTION_S46_PORT_PARAM Successful."); } else From 5b703a63cdf21579a3ff6aa015ff0e69bea43080 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Wed, 15 Apr 2026 15:33:47 -0400 Subject: [PATCH 05/13] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index ce26a9d2..4e1f684b 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -234,7 +234,7 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); if ( uiSubOption == MAPT_OPTION_S46_PORT_PARAMS && uiSubOptionLen == 4 ) { - pCurOption += uiSubOptionLen; + pCurOption += sizeof(COSA_DML_MAPT_OPTION); g_stMaptData.PsidOffset = *pCurOption; g_stMaptData.PsidLen = *++pCurOption; From e2c281968f235c0b77deabe0896729f4a0433bd0 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Wed, 15 Apr 2026 15:44:57 -0400 Subject: [PATCH 06/13] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index 4e1f684b..50cf6ddb 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -291,7 +291,7 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); } else { - MAPT_LOG_WARNING("MAP-T WARNING: Invalid MAP parameters! psidLen=%u offset=%u", psidLen, offset); + MAPT_LOG_WARNING("MAP-T WARNING: Invalid MAP parameters! psidLen=%u offset=%u", psidLen, psidoffset); } } /* ------------------------------------------------------------------ */ From aa34186d33c34d3784fb6dd816e972e4891d1b54 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Thu, 16 Apr 2026 15:49:25 -0400 Subject: [PATCH 07/13] Update dhcpv6c_msg_apis.c --- .../WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index 50cf6ddb..17d54357 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -274,18 +274,17 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); if (psidLen <= 16 && (psidLen + psidoffset) <= 16) { UINT8 m = 16 - (psidLen + psidoffset); + UINT8 block_shift = 16 - offset; + UINT32 min_i = (offset == 0) ? 0 : 1; /* Lowest possible port for this CE */ - UINT32 min_port = (psid << m); + UINT32 min_port = (min_i << block_shift) + (psid << m); - /* Highest port in first block */ - UINT32 max_first_block = min_port + ((1 << m) - 1); - - if (min_port < 1024 || max_first_block < 1024) + if (min_port < 1024) { MAPT_LOG_ERROR( - "MAP-T WARNING: Reserved port usage detected! psid=%u psidLen=%u offset=%u min_port=%u max_port=%u", - psid, psidLen, psidoffset, min_port, max_first_block + "MAP-T WARNING: Reserved port usage detected! psid=%u psidLen=%u offset=%u min_port=%u", + psid, psidLen, psidoffset, min_port ); } } From 1dd3eaff51d27c1da504e3849ea1e14e207406f4 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Thu, 16 Apr 2026 16:42:58 -0400 Subject: [PATCH 08/13] Update dhcpv6c_msg_apis.c --- source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index 17d54357..d5d4ef7c 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -274,8 +274,8 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); if (psidLen <= 16 && (psidLen + psidoffset) <= 16) { UINT8 m = 16 - (psidLen + psidoffset); - UINT8 block_shift = 16 - offset; - UINT32 min_i = (offset == 0) ? 0 : 1; + UINT8 block_shift = 16 - psidoffset; + UINT32 min_i = (psidoffset == 0) ? 0 : 1; /* Lowest possible port for this CE */ UINT32 min_port = (min_i << block_shift) + (psid << m); From 6c60ec5e176bfbb5a2b0ca6988ae8f85b6a3925c Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Fri, 17 Apr 2026 09:23:07 -0400 Subject: [PATCH 09/13] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index d5d4ef7c..d65f8415 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -217,6 +217,13 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); g_stMaptData.Ratio = 1 << (g_stMaptData.EaLen - (BUFLEN_32 - g_stMaptData.RuleIPv4PrefixLen)); + /* + * RFC default for PSID offset applies when the optional + * S46 Port Params suboption is not present. Keep the default + * here and let the suboption parser overwrite it with the + * received value, including 0 when that is explicitly encoded. + */ + g_stMaptData.PsidOffset = 6; MAPT_LOG_INFO("<<>> g_stMaptData.Ratio : %u", g_stMaptData.Ratio); MAPT_LOG_INFO("<<>> bytesLeftOut : %u", bytesLeftOut); if ( bytesLeftOut > 0 ) From 13050d8c5b1286f678e3a310bd7fc3b8e20abfa1 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Fri, 17 Apr 2026 09:27:48 -0400 Subject: [PATCH 10/13] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index d65f8415..17113b38 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -248,7 +248,7 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); // allowed PsidOffset values are 0 to 15 if (g_stMaptData.PsidOffset > 15) { - MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidOffset :%d"); + MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidOffset :%u", g_stMaptData.PsidOffset); return STATUS_FAILURE; } if ( !g_stMaptData.EaLen ) From c0b180851747c76076bd7e67a740993b6ae21f54 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Fri, 17 Apr 2026 11:17:50 -0400 Subject: [PATCH 11/13] review comments incorporated Added psid len validation. Updated log type / log message --- .../DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index 17113b38..a53b478b 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -251,6 +251,14 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidOffset :%u", g_stMaptData.PsidOffset); return STATUS_FAILURE; } + + // allowed PsidOffset values are 0 to 16 + if (g_stMaptData.PsidLen > 16) + { + MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidLen :%u", g_stMaptData.PsidLen); + return STATUS_FAILURE; + } + if ( !g_stMaptData.EaLen ) { g_stMaptData.Ratio = 1 << g_stMaptData.PsidLen; @@ -277,8 +285,12 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); /* Validate MAP-T bit allocation: psidLen + offset must fit within 16-bit port space * to avoid negative shifts (m = 16 - (psidLen + offset)) and undefined behavior. + * Ideally the check should be + * "if (psidoffset < 16 && psidLen <= 16 && (psidoffset + psidLen)<= 16)" + * but since we are already rejecting invalid psidLen / psidOffset earlier, + * we don't need to validate here. */ - if (psidLen <= 16 && (psidLen + psidoffset) <= 16) + if ((psidLen + psidoffset) <= 16) { UINT8 m = 16 - (psidLen + psidoffset); UINT8 block_shift = 16 - psidoffset; @@ -289,8 +301,8 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); if (min_port < 1024) { - MAPT_LOG_ERROR( - "MAP-T WARNING: Reserved port usage detected! psid=%u psidLen=%u offset=%u min_port=%u", + MAPT_LOG_WARNING( + "MAP-T WARNING: Privileged port usage detected! psid=%u psidLen=%u offset=%u min_port=%u", psid, psidLen, psidoffset, min_port ); } From 2b75944ce60461a212a728640f5d38d7dd30f9e7 Mon Sep 17 00:00:00 2001 From: Sivaraj Sivalingam Date: Fri, 17 Apr 2026 11:22:09 -0400 Subject: [PATCH 12/13] Update dhcpv6c_msg_apis.c --- source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c index a53b478b..75e5e2ac 100644 --- a/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c +++ b/source/WanManager/DHCPv6cMsgHandler/dhcpv6c_msg_apis.c @@ -252,7 +252,7 @@ MAPT_LOG_INFO("<<>> Start : %p | End : %p", pStartBuf,pEndBuf); return STATUS_FAILURE; } - // allowed PsidOffset values are 0 to 16 + // allowed PsidLen values are 0 to 16 if (g_stMaptData.PsidLen > 16) { MAPT_LOG_ERROR("Parsing OPTION_S46_PORT_PARAM: Received invalid PsidLen :%u", g_stMaptData.PsidLen); From 9e7b18ddc7a8739e3802cf63fbba3ba506cb5147 Mon Sep 17 00:00:00 2001 From: "Sivalingam, Sivaraj (Contractor)" Date: Tue, 4 Aug 2026 15:37:32 -0400 Subject: [PATCH 13/13] RDKB-65989: Move MAP-T ratio calculation to WanManager from DHCPManager Reason for change: DHCPManager now sends ratio=0 in the rbus event, since ratio computation is removed from DHCPManager; WanManager derives ratio from psidLen as the single authoritative owner. Test Procedure: Verify "sysevent get mapt_ratio" and Device.MAP.Domain.1.Rule.1.X_RDKCENTRAL-COM_Ratio / Device.DHCPv6.Client.1.X_RDKCENTRAL-COM_RcvOption.MapRatio is correctly set by WanManager after MAPT is configured. Risks: Low Priority: P1 Signed-off-by: Sivaraj_Sivalingam@comcast.com --- source/WanManager/wanmgr_net_utils.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/WanManager/wanmgr_net_utils.c b/source/WanManager/wanmgr_net_utils.c index c655c11f..cdadbce1 100644 --- a/source/WanManager/wanmgr_net_utils.c +++ b/source/WanManager/wanmgr_net_utils.c @@ -852,10 +852,6 @@ ANSC_STATUS WanManager_VerifyMAPTConfiguration(ipc_map_data_t *dhcp6cMAPTMsgBody return ANSC_STATUS_FAILURE; } - //The sharing ratio cannot be zero, a value of zero means the sharing ratio is 1 - if (dhcp6cMAPTMsgBody->ratio == 0) - dhcp6cMAPTMsgBody->ratio = 1; - #ifdef FEATURE_MAPT_DEBUG WanManager_UpdateMaptLogFile(dhcp6cMAPTMsgBody); #endif @@ -895,6 +891,9 @@ ANSC_STATUS WanManager_VerifyMAPTConfiguration(ipc_map_data_t *dhcp6cMAPTMsgBody MaptConfig->isPSIDComputed = TRUE; } + /* Ownership moved from DHCPManager: Compute ratio after psidLen is resolved */ + dhcp6cMAPTMsgBody->ratio = (MaptConfig->psidLen > 0) ? (1 << MaptConfig->psidLen) : 1; + inet_pton(AF_INET, dhcp6cMAPTMsgBody->ruleIPv4Prefix, &(result)); ipValue = htonl(result.s_addr) + ipv4IndexValue;