diff --git a/source/TR-181/include/wanmgr_dml.h b/source/TR-181/include/wanmgr_dml.h index b52f6db1..8db55694 100644 --- a/source/TR-181/include/wanmgr_dml.h +++ b/source/TR-181/include/wanmgr_dml.h @@ -441,6 +441,7 @@ typedef struct BOOL mapeAssigned; /**< Have we been assigned mape config ? */ BOOL maptAssigned; /**< Have we been assigned mapt config ? */ BOOL isFMR; + BOOL isPSIDComputed; }MaptData_t; typedef struct _WANMGR_MAPT_CONFIG_DATA_ diff --git a/source/TR-181/middle_layer_src/wanmgr_map_apis.c b/source/TR-181/middle_layer_src/wanmgr_map_apis.c index 35a0ac07..c0f65aad 100644 --- a/source/TR-181/middle_layer_src/wanmgr_map_apis.c +++ b/source/TR-181/middle_layer_src/wanmgr_map_apis.c @@ -767,6 +767,13 @@ WanDmlMapDomGetRule_Data pMapRule->PSIDOffset = pVirtIf->MAP.dhcp6cMAPparameters.psidOffset; pMapRule->PSIDLength = pVirtIf->MAP.dhcp6cMAPparameters.psidLen; pMapRule->PSID = pVirtIf->MAP.dhcp6cMAPparameters.psid; +#ifdef FEATURE_MAPT + if (pVirtIf->MAP.MaptConfig.isPSIDComputed) + { + pMapRule->PSIDLength = pVirtIf->MAP.MaptConfig.psidLen; + pMapRule->PSID = pVirtIf->MAP.MaptConfig.psid; + } +#endif pMapRule->Ratio = pVirtIf->MAP.dhcp6cMAPparameters.ratio; pMapRule->IncludeSystemPorts = FALSE; } diff --git a/source/WanManager/wanmgr_net_utils.c b/source/WanManager/wanmgr_net_utils.c index 4ce7cb06..6ecb66d0 100644 --- a/source/WanManager/wanmgr_net_utils.c +++ b/source/WanManager/wanmgr_net_utils.c @@ -913,27 +913,29 @@ ANSC_STATUS WanManager_VerifyMAPTConfiguration(ipc_map_data_t *dhcp6cMAPTMsgBody MaptInfo("Using psidLen value from dhcp6c options : %d", MaptConfig->psidLen); MaptInfo("Using psidOffset value from dhcp6c options : %d", dhcp6cMAPTMsgBody->psidOffset); #endif + MaptConfig->isPSIDComputed = FALSE; } else { ret = WanManager_CalculatePsidAndV4Index(dhcp6cMAPTMsgBody->pdIPv6Prefix, dhcp6cMAPTMsgBody->v6Len, dhcp6cMAPTMsgBody->iapdPrefixLen, dhcp6cMAPTMsgBody->v4Len, &(MaptConfig->psidValue), &ipv4IndexValue, &(MaptConfig->psidLen)); - } - if (ret != RETURN_OK) - { - CcspTraceError(("Error in calculating MAPT PSID value \n")); + if (ret != RETURN_OK) + { + CcspTraceError(("Error in calculating MAPT PSID value \n")); #ifdef FEATURE_MAPT_DEBUG - MaptInfo("Exiting MAPT configuration, MAPT will not be configured, error found in getting PSID value"); + MaptInfo("Exiting MAPT configuration, MAPT will not be configured, error found in getting PSID value"); #endif - CcspTraceNotice(("FEATURE_MAPT: MAP-T configuration failed\n")); - return ANSC_STATUS_FAILURE; - } + CcspTraceNotice(("FEATURE_MAPT: MAP-T configuration failed\n")); + return ANSC_STATUS_FAILURE; + } #ifdef FEATURE_MAPT_DEBUG - MaptInfo("--- MAP-T Computed Values - START ---"); - MaptInfo("mapt: PSID Value: %d, ipv4IndexValue: %d", MaptConfig->psidValue, ipv4IndexValue); - MaptInfo("mapt: PSID Length: %d", MaptConfig->psidLen); + MaptInfo("--- MAP-T Computed Values - START ---"); + MaptInfo("mapt: PSID Value: %d, ipv4IndexValue: %d", MaptConfig->psidValue, ipv4IndexValue); + MaptInfo("mapt: PSID Length: %d", MaptConfig->psidLen); #endif + MaptConfig->isPSIDComputed = TRUE; + } inet_pton(AF_INET, dhcp6cMAPTMsgBody->ruleIPv4Prefix, &(result));