aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/map/test/test_map_br.py
diff options
context:
space:
mode:
authorVladimir Isaev <visaev@netgate.com>2020-02-26 14:41:46 +0300
committerDave Barach <openvpp@barachs.net>2020-03-04 15:57:20 +0000
commit92511311118ee1cffac646d10c1edae6e94d90d7 (patch)
tree117b08c5bb74a11ad4df4b1bbb6a34fff6dfb051 /src/plugins/map/test/test_map_br.py
parentf13830ce76873390e7d3080e66d5ddb5234754f0 (diff)
map: fix map port calculation for ICMP
type should be used to get ICMP type instead of code. Type: fix Signed-off-by: Vladimir Isaev <visaev@netgate.com> Change-Id: Iabf4ae38befde18309caff8efd9e1d956a2fde82
Diffstat (limited to 'src/plugins/map/test/test_map_br.py')
-rw-r--r--src/plugins/map/test/test_map_br.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/map/test/test_map_br.py b/src/plugins/map/test/test_map_br.py
index 3d30216b6db..db0a5fc00e3 100644
--- a/src/plugins/map/test/test_map_br.py
+++ b/src/plugins/map/test/test_map_br.py
@@ -504,6 +504,29 @@ class TestMAPBR(VppTestCase):
self.pg0.assert_nothing_captured("Should drop IPv6 spoof port PSID")
#
+ # Spoofed IPv6 ICMP ID PSID v6 -> v4 direction
+ # Send a packet with a wrong IPv6 IMCP ID PSID
+ # The BR should drop the packet.
+ #
+
+ def test_map_t_spoof_icmp_id_psid_ip6_to_ip4(self):
+ """ MAP-T spoof ICMP id psid IPv6 -> IPv4 """
+
+ eth = Ether(src=self.pg1.remote_mac,
+ dst=self.pg1.local_mac)
+ ip = IPv6(src=self.ipv6_cpe_address,
+ dst=self.ipv6_map_address)
+ icmp = ICMPv6EchoRequest()
+ icmp.id = self.ipv6_udp_or_tcp_spoof_port
+ payload = "H" * 10
+ tx_pkt = eth / ip / icmp / payload
+
+ self.pg_send(self.pg1, tx_pkt * 1)
+
+ self.pg0.get_capture(0, timeout=1)
+ self.pg0.assert_nothing_captured("Should drop IPv6 spoof port PSID")
+
+ #
# Map to Map - same rule, different address
#