@@ -60,7 +60,7 @@ MirrorEntry::MirrorEntry(const string& platform) :
60
60
}
61
61
62
62
nexthopInfo.prefix = IpPrefix (" 0.0.0.0/0" );
63
- nexthopInfo.nexthop = IpAddress (" 0.0.0.0" );
63
+ nexthopInfo.nexthop = NextHopKey (" 0.0.0.0" , " " );
64
64
}
65
65
66
66
MirrorOrch::MirrorOrch (TableConnector stateDbConnector, TableConnector confDbConnector,
@@ -456,7 +456,7 @@ bool MirrorOrch::getNeighborInfo(const string& name, MirrorEntry& session)
456
456
// 3) Otherwise, return false.
457
457
if (!m_neighOrch->getNeighborEntry (session.dstIp ,
458
458
session.neighborInfo .neighbor , session.neighborInfo .mac ) &&
459
- (session.nexthopInfo .nexthop .isZero () ||
459
+ (session.nexthopInfo .nexthop .ip_address . isZero () ||
460
460
!m_neighOrch->getNeighborEntry (session.nexthopInfo .nexthop ,
461
461
session.neighborInfo .neighbor , session.neighborInfo .mac )))
462
462
{
@@ -894,8 +894,8 @@ void MirrorOrch::updateNextHop(const NextHopUpdate& update)
894
894
895
895
// This is the ECMP scenario that the new next hop group contains the previous
896
896
// next hop. There is no need to update this session's monitor port.
897
- if (update.nexthopGroup != IpAddresses () &&
898
- update.nexthopGroup .getIpAddresses ().count (session.nexthopInfo .nexthop ))
897
+ if (update.nexthopGroup != NextHopGroupKey () &&
898
+ update.nexthopGroup .getNextHops ().count (session.nexthopInfo .nexthop ))
899
899
900
900
{
901
901
continue ;
@@ -904,18 +904,18 @@ void MirrorOrch::updateNextHop(const NextHopUpdate& update)
904
904
SWSS_LOG_NOTICE (" Updating mirror session %s with route %s" ,
905
905
name.c_str (), update.prefix .to_string ().c_str ());
906
906
907
- if (update.nexthopGroup != IpAddresses ())
907
+ if (update.nexthopGroup != NextHopGroupKey ())
908
908
{
909
909
SWSS_LOG_NOTICE (" next hop IPs: %s" , update.nexthopGroup .to_string ().c_str ());
910
910
911
911
// Recover the session based on the state database information
912
912
if (m_recoverySessionMap.find (name) != m_recoverySessionMap.end ())
913
913
{
914
- IpAddress nexthop = IpAddress (tokenize (m_recoverySessionMap[name],
914
+ NextHopKey nexthop = NextHopKey (tokenize (m_recoverySessionMap[name],
915
915
state_db_key_delimiter, 1 )[1 ]);
916
916
917
917
// Check if recovered next hop IP is within the update's next hop IPs
918
- if (update.nexthopGroup .getIpAddresses ().count (nexthop))
918
+ if (update.nexthopGroup .getNextHops ().count (nexthop))
919
919
{
920
920
SWSS_LOG_NOTICE (" Recover mirror session %s with next hop %s" ,
921
921
name.c_str (), nexthop.to_string ().c_str ());
@@ -927,18 +927,18 @@ void MirrorOrch::updateNextHop(const NextHopUpdate& update)
927
927
SWSS_LOG_NOTICE (" Correct mirror session %s next hop from %s to %s" ,
928
928
name.c_str (), session.nexthopInfo .nexthop .to_string ().c_str (),
929
929
nexthop.to_string ().c_str ());
930
- session.nexthopInfo .nexthop = *update.nexthopGroup .getIpAddresses ().begin ();
930
+ session.nexthopInfo .nexthop = *update.nexthopGroup .getNextHops ().begin ();
931
931
}
932
932
}
933
933
else
934
934
{
935
935
// Pick the first one from the next hop group
936
- session.nexthopInfo .nexthop = *update.nexthopGroup .getIpAddresses ().begin ();
936
+ session.nexthopInfo .nexthop = *update.nexthopGroup .getNextHops ().begin ();
937
937
}
938
938
}
939
939
else
940
940
{
941
- session.nexthopInfo .nexthop = IpAddress ( 0 );
941
+ session.nexthopInfo .nexthop = NextHopKey ( " 0.0.0.0 " , " " );
942
942
}
943
943
944
944
// Resolve the neighbor of the new next hop
@@ -960,7 +960,7 @@ void MirrorOrch::updateNeighbor(const NeighborUpdate& update)
960
960
// Check if the session's destination IP matches the neighbor's update IP
961
961
// or if the session's next hop IP matches the neighbor's update IP
962
962
if (session.dstIp != update.entry .ip_address &&
963
- session.nexthopInfo .nexthop != update.entry .ip_address )
963
+ session.nexthopInfo .nexthop . ip_address != update.entry .ip_address )
964
964
{
965
965
continue ;
966
966
}
0 commit comments