Skip to content

Commit 9e57ba2

Browse files
Sudharsan D.Gdgsudharsan
Sudharsan D.G
and
dgsudharsan
authored
Fixing hostif For Genetlink host interfaces (sonic-net#633)
Co-authored-by: dgsudharsan <[email protected]>
1 parent 449a092 commit 9e57ba2

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

vslib/src/SwitchStateBaseHostif.cpp

+22-1
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,31 @@ sai_status_t SwitchStateBase::vs_remove_hostif_tap_interface(
722722

723723
sai_attribute_t attr;
724724

725-
attr.id = SAI_HOSTIF_ATTR_NAME;
726725

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

729+
if (status != SAI_STATUS_SUCCESS)
730+
{
731+
SWSS_LOG_ERROR("failed to get attr type for hostif %s",
732+
sai_serialize_object_id(hostif_id).c_str());
733+
return status;
734+
}
735+
736+
737+
/* The genetlink host interface is created to associate trap group to genetlink family and multicast group
738+
* created by driver. It does not create any netdev interface. Hence skipping tap interface deletion
739+
*/
740+
if (attr.value.s32 == SAI_HOSTIF_TYPE_GENETLINK)
741+
{
742+
SWSS_LOG_DEBUG("Skipping tap delete for hostif type genetlink");
743+
return SAI_STATUS_SUCCESS;
744+
}
745+
746+
attr.id = SAI_HOSTIF_ATTR_NAME;
747+
748+
status = get(SAI_OBJECT_TYPE_HOSTIF, hostif_id, 1, &attr);
749+
729750
if (status != SAI_STATUS_SUCCESS)
730751
{
731752
SWSS_LOG_ERROR("failed to get attr name for hostif %s",

0 commit comments

Comments
 (0)