diff --git a/source/TR-181/middle_layer_src/vlan_apis.c b/source/TR-181/middle_layer_src/vlan_apis.c index 96adcb5..314c6a1 100644 --- a/source/TR-181/middle_layer_src/vlan_apis.c +++ b/source/TR-181/middle_layer_src/vlan_apis.c @@ -402,6 +402,17 @@ void * Vlan_Disable(void *Arg) Vlan_DeleteInterface(pEntry); #endif } + else if (pEntry->VLANId == -1) + { + /* If the VLANID = -1, the VLAN is a bridge, delete the bridge and delete the interface from the bridge */ + 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); + } + } + pEntry->Status = VLAN_IF_DOWN; EthLink_SendVirtualIfaceVlanStatus(pEntry->Path, "Down"); CcspTraceInfo(("%s - %s:Successfully deleted VLAN interface %s\n", __FUNCTION__, VLAN_MARKER_VLAN_IF_CREATE, pEntry->Name)); @@ -665,6 +676,16 @@ void * Vlan_Enable(void *Arg) get_uptime(&uptime); pEntry->LastChange = uptime; } + else if (pEntry->VLANId == -1) + { + /* If the VLANID = -1, the VLAN is a bridge, create the bridge and add the interface to the bridge */ + 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); + } + } else { //Enable EthLink and it will take care Creation of UnTagged Vlan Interface.