RDKB-61824 : VLAN Discovery Mode#162
Conversation
S-Parthiban-Selvaraj
commented
Nov 4, 2025
wanmgr(dhcp): guard MAP-T field in DHCPv6 lease debug print Wrap the maptAssigned field and its printf argument in copyDhcpv6Data() with #ifdef FEATURE_MAPT, and adjust the format/argument list accordingly. This prevents a format/argument mismatch and allows successful compilation when FEATURE_MAPT is not enabled. Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
…ent name (#153) T2 component initialising Signed-off-by: kavya.shivalingaiah@sky.uk <kavya.shivalingaiah@sky.uk> --------- Signed-off-by: kavya.shivalingaiah@sky.uk <kavya.shivalingaiah@sky.uk>
* RDKB-61835 : Update Ipv6 sysevents when Ipv6 configured. Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk> * Changing buffer size --------- Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
- Added VLAN discovery mode (ALWAYS/ONCE) to allow configurable VLAN discovery behavior. - Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse. - Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions. - Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan. - Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found. - Updated structure initializations and state machine transitions to support new VLAN fields and logic. - Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan). - Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode. Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces configurable VLAN discovery behavior by adding a discovery mode (ALWAYS/ONCE) and refactors VLAN tracking to use CurrentVlan for active operations while preserving VLANInUse for persistence. The changes ensure VLAN discovery logic respects the configured mode and prevents redundant discovery attempts when a VLAN has already been found.
Key changes:
- Added VLAN_DISCOVERY_MODE enum and DiscoveryMode field to support ALWAYS/ONCE discovery modes
- Introduced CurrentVlan field to track the actively used/tried VLAN during state transitions, separate from persisted VLANInUse
- Refactored VLAN logic throughout the state machine to use CurrentVlan and conditionally persist to VLANInUse
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| source/WanManager/wanmgr_main.c | Moved t2_init call earlier in initialization sequence |
| source/WanManager/wanmgr_interface_sm.c | Updated VLAN state machine logic to use CurrentVlan, implemented discovery mode checks, and refactored IPv6 setup sysevent calls |
| source/WanManager/wanmgr_dhcp_event_handler.c | Added conditional compilation for FEATURE_MAPT in logging |
| source/WanManager/wanmgr_data.c | Initialized new CurrentVlan and VlanDiscoveryMode fields in virtual interface structure |
| source/TR-181/middle_layer_src/wanmgr_rdkbus_utils.c | Updated RDKBus API calls to use CurrentVlan instead of VLANInUse |
| source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.h | Renamed function and added documentation for UpdateAndPersisteVLANInUse |
| source/TR-181/middle_layer_src/wanmgr_rdkbus_apis.c | Implemented conditional persistence logic in UpdateAndPersisteVLANInUse and added PSM retrieval for DiscoveryMode |
| source/TR-181/include/wanmgr_dml.h | Added VLAN_DISCOVERY_MODE enum, CurrentVlan field, and DiscoveryMode field to VLAN structure |
| source/TR-181/include/dmsb_tr181_psm_definitions.h | Added PSM definition for VLAN discovery mode parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
…al/wan-manager into feature/vlanDiscoveryMode
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if(strlen(p_VirtIf->VLAN.VlanInUse) > 0) | ||
| { | ||
| CcspTraceInfo(("%s %d - interface %s : using previously found VLAN %s\n", __FUNCTION__, __LINE__, p_VirtIf->Name, p_VirtIf->VLAN.VlanInUse)); | ||
| strncpy(p_VirtIf->VLAN.CurrentVlan, p_VirtIf->VLAN.VlanInUse, sizeof(p_VirtIf->VLAN.CurrentVlan)); |
There was a problem hiding this comment.
strncpy does not guarantee null-termination if the source string length equals or exceeds the destination buffer size. Use snprintf or explicitly null-terminate after strncpy to prevent potential buffer overrun issues.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…discovery behavior. - Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse. - Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions. - Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan. - Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found. - Updated structure initializations and state machine transitions to support new VLAN fields and logic. - Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan). - Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode. Signed-off-by: LakshminarayananShenbagaraj <lakshminarayanan.shenbagaraj2@sky.uk>
…discovery behavior. - Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse. - Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions. - Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan. - Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found. - Updated structure initializations and state machine transitions to support new VLAN fields and logic. - Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan). - Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode. Signed-off-by: LakshminarayananShenbagaraj <lakshminarayanan.shenbagaraj2@sky.uk>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
Signed-off-by: Parthiban Selvaraj <parthiban.selvaraj@sky.uk>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…discovery behavior. - Introduced CurrentVlan field to track the currently used/tried VLAN, separate from persisted VLANInUse. - Updated logic throughout WAN Manager to use CurrentVlan for configuration and status queries, ensuring correct VLAN is used during interface state transitions. - Modified PSM and RDKBus API interactions to persist VLANInUse only when it differs from CurrentVlan. - Adjusted VLAN discovery checks to respect discovery mode, skipping redundant discovery when mode is ONCE and a VLAN has already been found. - Updated structure initializations and state machine transitions to support new VLAN fields and logic. - Refactored code comments and variable names for clarity (ActiveVlan → CurrentVlan). - Improved VLAN discovery and selection logic in wanmgr_interface_sm.c to use CurrentVlan and DiscoveryMode. Signed-off-by: LakshminarayananShenbagaraj <lakshminarayanan.shenbagaraj2@sky.uk>