Skip to content

Commit

Permalink
ipv6 next hop key
Browse files Browse the repository at this point in the history
Signed-off-by: Wenda Ni <wonda.ni@gmail.com>
  • Loading branch information
wendani committed Jul 9, 2021
1 parent 9744601 commit fef1dfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion orchagent/mirrororch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ void MirrorOrch::updateNextHop(const NextHopUpdate& update)
else
{
string alias = "";
session.nexthopInfo.nexthop = NextHopKey("0.0.0.0", alias);
session.nexthopInfo.nexthop = session.dstIp.isV6() ? NextHopKey("::", alias) : NextHopKey("0.0.0.0", alias);
}

// Update State DB Nexthop
Expand Down
5 changes: 5 additions & 0 deletions tests/test_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def _test_MirrorAddRemove(self, dvs, testlog, v6_encap=False):
# create mirror session
self.create_mirror_session(session, src_ip, dst_ip, "0x6558", "8", "100", "0")
assert self.get_mirror_session_state(session)["status"] == "inactive"
assert self.get_mirror_session_state(session)["next_hop_ip"] == ("0.0.0.0@" if v6_encap == False else "::@")
self.check_syslog(dvs, marker, "Attached next hop observer .* for destination IP {}".format(dst_ip), 1)

# bring up Ethernet16
Expand Down Expand Up @@ -268,6 +269,7 @@ def _test_MirrorToVlanAddRemove(self, dvs, testlog, v6_encap=False):
# create mirror session
self.create_mirror_session(session, src_ip, dst_ip, "0x6558", "8", "100", "0")
assert self.get_mirror_session_state(session)["status"] == "inactive"
assert self.get_mirror_session_state(session)["next_hop_ip"] == ("0.0.0.0@" if v6_encap == False else "::@")
self.check_syslog(dvs, marker, "Attached next hop observer .* for destination IP {}".format(dst_ip), 1)

# create vlan; create vlan member
Expand Down Expand Up @@ -419,6 +421,7 @@ def _test_MirrorToLagAddRemove(self, dvs, testlog, v6_encap=False):
# create mirror session
self.create_mirror_session(session, src_ip, dst_ip, "0x6558", "8", "100", "0")
assert self.get_mirror_session_state(session)["status"] == "inactive"
assert self.get_mirror_session_state(session)["next_hop_ip"] == ("0.0.0.0@" if v6_encap == False else "::@")
self.check_syslog(dvs, marker, "Attached next hop observer .* for destination IP {}".format(dst_ip), 1)

# create port channel; create port channel member
Expand Down Expand Up @@ -503,6 +506,7 @@ def _test_MirrorDestMoveVlan(self, dvs, testlog, v6_encap=False):
# create mirror session
self.create_mirror_session(session, src_ip, dst_ip, "0x6558", "8", "100", "0")
assert self.get_mirror_session_state(session)["status"] == "inactive"
assert self.get_mirror_session_state(session)["next_hop_ip"] == ("0.0.0.0@" if v6_encap == False else "::@")

# bring up port; add ip; add neighbor; add route
self.set_interface_status(dvs, "Ethernet32", "up")
Expand Down Expand Up @@ -643,6 +647,7 @@ def _test_MirrorDestMoveLag(self, dvs, testlog, v6_encap=False):
# create mirror session
self.create_mirror_session(session, src_ip, dst_ip, "0x6558", "8", "100", "0")
assert self.get_mirror_session_state(session)["status"] == "inactive"
assert self.get_mirror_session_state(session)["next_hop_ip"] == ("0.0.0.0@" if v6_encap == False else "::@")

# bring up port; add ip; add neighbor; add route
self.set_interface_status(dvs, "Ethernet64", "up")
Expand Down

0 comments on commit fef1dfa

Please sign in to comment.