RDKBACCL-1878: Create bridge interface for BPI target from VlanManager#35
Open
manigandanj wants to merge 1 commit into
Open
RDKBACCL-1878: Create bridge interface for BPI target from VlanManager#35manigandanj wants to merge 1 commit into
manigandanj wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds BananaPi R4 platform-specific handling for untagged Ethernet interfaces by creating a Linux bridge instead of a MACVLAN, and hardens MAC retrieval by failing on empty MAC values.
Changes:
- Add
_PLATFORM_BANANAPI_R4_conditional path to create a bridge and enslave the base interface. - Keep existing MACVLAN behavior for other platforms.
- Treat empty MAC parameter values as a failure in
EthLink_GetMacAddr.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| #if defined (_PLATFORM_BANANAPI_R4_) | ||
| v_secure_system("ip link add name %s type bridge", pEntry->Name); | ||
| v_secure_system("ip link set address %s dev %s", pEntry->MACAddress, pEntry->Name); |
Comment on lines
+887
to
+888
| v_secure_system("ip link add name %s type bridge", pEntry->Name); | ||
| v_secure_system("ip link set dev %s master %s", pEntry->BaseInterface, pEntry->Name); |
Comment on lines
+902
to
+904
| v_secure_system("ip link add name %s type bridge", pEntry->Name); | ||
| v_secure_system("ip link set address %s dev %s", pEntry->MACAddress, pEntry->Name); | ||
| v_secure_system("ip link set dev %s master %s", pEntry->BaseInterface, pEntry->Name); |
Comment on lines
+886
to
+889
| #if defined (_PLATFORM_BANANAPI_R4_) | ||
| v_secure_system("ip link add name %s type bridge", pEntry->Name); | ||
| v_secure_system("ip link set dev %s master %s", pEntry->BaseInterface, pEntry->Name); | ||
| #else |
Comment on lines
+901
to
+905
| #if defined (_PLATFORM_BANANAPI_R4_) | ||
| v_secure_system("ip link add name %s type bridge", pEntry->Name); | ||
| v_secure_system("ip link set address %s dev %s", pEntry->MACAddress, pEntry->Name); | ||
| v_secure_system("ip link set dev %s master %s", pEntry->BaseInterface, pEntry->Name); | ||
| #else |
|
|
||
| if(strlen(acTmpReturnValue) == 0) | ||
| { | ||
| CcspTraceError(("[%s][%d]Received empty param value\n", __FUNCTION__, __LINE__)); |
|
Looks okay to me |
fc09b25 to
d8ef67c
Compare
Reason for change: BPI is having lan0 as EthWan interface which is already under DSA master Test procedure: Able to ping outside IPv4 address. Checked WAN Plug-out and Plug-in. Risks: None Signed-off-by: Manigandan Gopalakrishnan <Manigandan_Gopalakrishnan@comcast.com>
d8ef67c to
e08d359
Compare
|
|
||
| #if defined (_PLATFORM_BANANAPI_R4_) | ||
| v_secure_system("ip link add name %s type bridge", pEntry->Name); | ||
| v_secure_system("ip link set address %s dev %s", pEntry->MACAddress, pEntry->Name); |
Comment on lines
+886
to
+894
| #if defined (_PLATFORM_BANANAPI_R4_) | ||
| v_secure_system("ip link add name %s type bridge", pEntry->Name); | ||
| v_secure_system("ip link set dev %s master %s", pEntry->BaseInterface, pEntry->Name); | ||
| #else | ||
| CcspTraceError(("%s-%d: Failed to get MAC address, creating MACVLAN without custom MAC\n", __FUNCTION__, __LINE__)); | ||
| // Create MACVLAN without setting custom MAC - kernel will assign one | ||
| v_secure_system("ip link add link %s name %s type macvlan mode private", | ||
| pEntry->BaseInterface, pEntry->Name); | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for change: BPI is having lan0 as EthWan interface which is already under DSA master
Test procedure: Able to ping outside IPv4 address. Checked WAN Plug-out and Plug-in.
Risks: None