Skip to content

RDKCOM-5613: RDKBNETWOR-98 untagged vlan - #40

Open
sherik-sensin wants to merge 1 commit into
rdkcentral:mainfrom
sherik-sensin:RDKBNETWOR-98_untagged_vlan
Open

RDKCOM-5613: RDKBNETWOR-98 untagged vlan#40
sherik-sensin wants to merge 1 commit into
rdkcentral:mainfrom
sherik-sensin:RDKBNETWOR-98_untagged_vlan

Conversation

@sherik-sensin

Copy link
Copy Markdown

No description provided.

@sherik-sensin
sherik-sensin requested a review from a team as a code owner July 14, 2026 14:24
Copilot AI review requested due to automatic review settings July 14, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds special-case handling for VLAN entries using VLANId == -1 to represent a bridge-backed “untagged VLAN” by creating/deleting Linux bridges in the VLAN enable/disable paths.

Changes:

  • In Vlan_Enable(), create a bridge and add the base interface when VLANId == -1.
  • In Vlan_Disable(), bring down/delete the bridge and remove the base interface from it when VLANId == -1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/TR-181/middle_layer_src/vlan_apis.c
Comment on lines +684 to +686
v_secure_system("brctl addbr %s", pEntry->Name);
v_secure_system("brctl addif %s %s", pEntry->Name, pEntry->BaseInterface);
v_secure_system("ifconfig %s up", pEntry->Name);
@pradeeptakdas pradeeptakdas changed the title RDKBNETWOR-98 untagged vlan RDKCOM-5613: RDKBNETWOR-98 untagged vlan Jul 15, 2026
@tinaelizabeth84

Copy link
Copy Markdown

As per component owner, all copilot review comments have to be addressed, if they are not valid, please add a reason and resolve it

Copilot AI review requested due to automatic review settings July 22, 2026 07:05
@sherik-sensin
sherik-sensin force-pushed the RDKBNETWOR-98_untagged_vlan branch from a394175 to 3f9a830 Compare July 22, 2026 07:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

Comment on lines +408 to +413
if(strcmp(pEntry->BaseInterface, pEntry->Name))
{
v_secure_system("ifconfig %s down", pEntry->Name);
v_secure_system("brctl delif %s %s", pEntry->Name, pEntry->BaseInterface);
v_secure_system("brctl delbr %s", pEntry->Name);
}
Comment thread source/TR-181/middle_layer_src/vlan_apis.c
Comment on lines +676 to +681
if(strcmp(pEntry->BaseInterface, pEntry->Name))
{
v_secure_system("brctl addbr %s", pEntry->Name);
v_secure_system("brctl addif %s %s", pEntry->Name, pEntry->BaseInterface);
v_secure_system("ifconfig %s up", pEntry->Name);
}
Comment thread source/TR-181/middle_layer_src/vlan_apis.c
Copilot AI review requested due to automatic review settings July 22, 2026 07:20
@sherik-sensin
sherik-sensin force-pushed the RDKBNETWOR-98_untagged_vlan branch from 3f9a830 to 36047ab Compare July 22, 2026 07:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

source/TR-181/middle_layer_src/vlan_apis.c:709

  • pEntry->Status is set to VLAN_IF_UP unconditionally at the end of Vlan_Enable(), which can overwrite an earlier VLAN_IF_ERROR (e.g., when Vlan_CreateTaggedInterface() fails). This also means the new bridge enable branch will report UP even if the setup failed.
        long uptime = 0;
        get_uptime(&uptime);
        pEntry->LastChange  =  uptime;
    }

Comment thread source/TR-181/middle_layer_src/vlan_apis.c
Comment thread source/TR-181/middle_layer_src/vlan_apis.c
Copilot AI review requested due to automatic review settings July 22, 2026 07:31
@sherik-sensin
sherik-sensin force-pushed the RDKBNETWOR-98_untagged_vlan branch from 36047ab to d5eb54c Compare July 22, 2026 07:31
@sherik-sensin
sherik-sensin force-pushed the RDKBNETWOR-98_untagged_vlan branch from d5eb54c to 3305c41 Compare July 22, 2026 07:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

source/TR-181/middle_layer_src/vlan_apis.c:687

  • Bridge enable path calls brctl addif even when BaseInterface is empty; this will invoke the command with a missing argument and can misconfigure the bridge. Mirror the disable path’s empty-string guard.
    }
    else if (pEntry->VLANId == -1)
    {

else if (pEntry->VLANId == -1)
{
/* If the VLANID = -1, the VLAN is a bridge, create the bridge and add the interface to the bridge */
iif (strcmp(pEntry->BaseInterface, pEntry->Name) != 0)
Comment thread source/TR-181/middle_layer_src/vlan_apis.c
Comment thread source/TR-181/middle_layer_src/vlan_apis.c
Copilot AI review requested due to automatic review settings July 22, 2026 07:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

source/TR-181/middle_layer_src/vlan_apis.c:689

  • iif is a typo and will not compile (should be if).
        iif (strcmp(pEntry->BaseInterface, pEntry->Name) != 0)

source/TR-181/middle_layer_src/vlan_apis.c:694

  • brctl addif is executed even when BaseInterface is an empty string; in the disable path this is guarded. Add the same guard here to avoid running an invalid command and relying on stderr redirection for control flow.
        {
            v_secure_system("ip link show %s > /dev/null 2>&1 || brctl addbr %s", pEntry->Name, pEntry->Name);
            v_secure_system("brctl addif %s %s 2>/dev/null", pEntry->Name, pEntry->BaseInterface);
            v_secure_system("ifconfig %s up", pEntry->Name);
        }

Copilot AI review requested due to automatic review settings July 22, 2026 07:38
@sherik-sensin
sherik-sensin force-pushed the RDKBNETWOR-98_untagged_vlan branch from 3305c41 to d3b9075 Compare July 22, 2026 07:38
Reason for change: CPE should be able to support IP connectivity(Static/PPPoE/IPoE) over native interface.

Test Procedure: Performed VlanManager Sanity test.
Risks: None.

Signed-off-by: Sherik Sensin A <sherik.a@telekom-digital.com>
@sherik-sensin
sherik-sensin force-pushed the RDKBNETWOR-98_untagged_vlan branch from d3b9075 to 16a2e81 Compare July 22, 2026 07:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

source/TR-181/middle_layer_src/vlan_apis.c:687

  • In the VLANId == -1 (bridge) enable path, brctl addif is executed even when BaseInterface is an empty string. Vlan_SetParamStringValue()/Vlan_Validate() do not enforce a non-empty BaseInterface, so this can generate an invalid command and fail the bridge setup unnecessarily.
    }
    else if (pEntry->VLANId == -1)
    {

source/TR-181/middle_layer_src/vlan_apis.c:716

  • In Vlan_Enable(), the function later forces pEntry->Status to VLAN_IF_UP unconditionally, which can contradict the actual status calculated in the VLANId>0 / VLANId==-1 paths (and can also overwrite VLAN_IF_ERROR when interface creation fails). This makes the datamodel status inconsistent with real interface state and with the WanManager notifications sent in the loops above.
            CcspTraceInfo(("%s-%d: Interface Status(%d), retry-count=%d \n", __FUNCTION__, __LINE__, status, iIterator));
        }
        long uptime = 0;

Copilot AI review requested due to automatic review settings July 22, 2026 07:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

source/TR-181/middle_layer_src/vlan_apis.c:693

  • In the VLANId == -1 (bridge) enable path, brctl addif is executed even when BaseInterface is an empty string. This can generate an invalid command (missing interface argument) and still proceed to bring the bridge up, potentially reporting an "Up" status incorrectly.
            v_secure_system("ip link show %s > /dev/null 2>&1 || brctl addbr %s", pEntry->Name, pEntry->Name);
            v_secure_system("brctl addif %s %s 2>/dev/null", pEntry->Name, pEntry->BaseInterface);
            v_secure_system("ifconfig %s up", pEntry->Name);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants