Skip to content

Commit

Permalink
Fixing hostif For Genetlink host interfaces (#633)
Browse files Browse the repository at this point in the history
Co-authored-by: dgsudharsan <[email protected]>
  • Loading branch information
Sudharsan D.G and dgsudharsan authored Jul 2, 2020
1 parent 449a092 commit 9e57ba2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion vslib/src/SwitchStateBaseHostif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,31 @@ sai_status_t SwitchStateBase::vs_remove_hostif_tap_interface(

sai_attribute_t attr;

attr.id = SAI_HOSTIF_ATTR_NAME;

attr.id = SAI_HOSTIF_ATTR_TYPE;
sai_status_t status = get(SAI_OBJECT_TYPE_HOSTIF, hostif_id, 1, &attr);

if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("failed to get attr type for hostif %s",
sai_serialize_object_id(hostif_id).c_str());
return status;
}


/* The genetlink host interface is created to associate trap group to genetlink family and multicast group
* created by driver. It does not create any netdev interface. Hence skipping tap interface deletion
*/
if (attr.value.s32 == SAI_HOSTIF_TYPE_GENETLINK)
{
SWSS_LOG_DEBUG("Skipping tap delete for hostif type genetlink");
return SAI_STATUS_SUCCESS;
}

attr.id = SAI_HOSTIF_ATTR_NAME;

status = get(SAI_OBJECT_TYPE_HOSTIF, hostif_id, 1, &attr);

if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("failed to get attr name for hostif %s",
Expand Down

0 comments on commit 9e57ba2

Please sign in to comment.