Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions source/TR-181/middle_layer_src/ethernet_apis.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,19 +883,30 @@ static ANSC_STATUS EthLink_CreateUnTaggedInterface(PDML_ETHERNET pEntry)
// Get MAC address with offset applied
if (ANSC_STATUS_SUCCESS != EthLink_GetMacAddr(pEntry))
{
#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);
Comment on lines +887 to +888
#else
Comment on lines +886 to +889
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
}
else
{
CcspTraceInfo(("%s-%d: Using MAC address: %s (offset: %ld)\n",
__FUNCTION__, __LINE__, pEntry->MACAddress, pEntry->MACAddrOffSet));

#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);
Comment on lines +902 to +904
#else
Comment on lines +901 to +905
// Create MACVLAN interface with custom MAC
v_secure_system("ip link add link %s name %s address %s type macvlan mode private",
pEntry->BaseInterface, pEntry->Name, pEntry->MACAddress);
#endif
}

// Set the allmulticast and multicast on for MACVLAN interface
Expand Down Expand Up @@ -1257,6 +1268,12 @@ ANSC_STATUS EthLink_GetMacAddr( PDML_ETHERNET pEntry )
return ANSC_STATUS_FAILURE;
}

if(strlen(acTmpReturnValue) == 0)
{
CcspTraceError(("[%s][%d]Received empty param value\n", __FUNCTION__, __LINE__));
return ANSC_STATUS_FAILURE;
}

for(i = 0; acTmpReturnValue[i] != '\0'; i++)
{
if(acTmpReturnValue[i] != ':')
Expand Down