RDKCOM-5602: RDKBDEV-3460, RDKBACCL-1878 Create bridge interface for BPI target from VlanManager#35
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); |
| 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); |
| 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); |
| #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 |
| #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
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); |
| #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 |
…rom VlanManager 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>
e08d359 to
6b53917
Compare
|
As per Augusto input |
Since lan0 is already under DSA master(eth1), we can't create macvtype type interface linking to lan0, we did not find other options. Please provide direction. |
|
Suggested to have this PR change #40 instead. |
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