Merge "Skip logging state change of I/F not managed by SM"

This commit is contained in:
Zuul 2021-01-28 20:09:51 +00:00 committed by Gerrit Code Review
commit c5f753c3bb
1 changed files with 16 additions and 2 deletions

View File

@ -1200,6 +1200,8 @@ SmFailoverInterfaceStateT sm_failover_get_interface_info(SmInterfaceTypeT interf
static void sm_failover_interface_change_callback(
SmHwInterfaceChangeDataT* if_change )
{
SmFailoverInterfaceInfo* iter;
SmServiceDomainInterfaceT* interface;
switch ( if_change->interface_state )
{
case SM_INTERFACE_STATE_DISABLED:
@ -1209,8 +1211,20 @@ static void sm_failover_interface_change_callback(
sm_failover_interface_up(if_change->interface_name);
break;
default:
DPRINTFI("Interface %s state changed to %d",
if_change->interface_name, if_change->interface_state);
// skip logging the state change of interfaces that are not monitored
// by SM.
for(iter = _my_if_list; iter < _my_if_list + _total_interfaces; iter ++)
{
interface = iter->get_interface();
if(strncmp(interface->interface_name, if_change->interface_name,
sizeof(if_change->interface_name)) == 0)
{
DPRINTFI("Interface %s state changed to %d",
if_change->interface_name, if_change->interface_state);
break;
}
}
break;
}
}