diff options
author | Alexander Chernavin <achernavin@netgate.com> | 2020-01-23 08:09:40 -0500 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2020-01-30 11:03:31 +0000 |
commit | 56817e2c486a26167783676774b0dea9c103b200 (patch) | |
tree | b88a51c9bdfcdb4ca0859e9b2ae4a4a9315c6f2d /src/plugins/map/test/test_map.py | |
parent | 78b58f65f1c94d7a5efbf191b4a6e8b6cc12ae66 (diff) |
map: handle ip4 ttl=1 packets in map-t
With this commit, ICMP Time Exceeded is sent to sender when TTL
expires at MAP BR.
Type: fix
Change-Id: I8effe163beab32596883127b819308cc355512c3
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'src/plugins/map/test/test_map.py')
-rw-r--r-- | src/plugins/map/test/test_map.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/map/test/test_map.py b/src/plugins/map/test/test_map.py index 03913ce1466..845d1d34bef 100644 --- a/src/plugins/map/test/test_map.py +++ b/src/plugins/map/test/test_map.py @@ -543,7 +543,7 @@ class TestMAP(VppTestCase): for p in rx: self.validate(p[1], p4_translated) - # IPv4 TTL + # IPv4 TTL=0 ip4_ttl_expired = IP(src=self.pg0.remote_ip4, dst='192.168.0.1', ttl=0) p4 = (p_ether / ip4_ttl_expired / payload) @@ -557,20 +557,19 @@ class TestMAP(VppTestCase): for p in rx: self.validate(p[1], icmp4_reply) - ''' - This one is broken, cause it would require hairpinning... - # IPv4 TTL TTL1 + # IPv4 TTL=1 ip4_ttl_expired = IP(src=self.pg0.remote_ip4, dst='192.168.0.1', ttl=1) p4 = (p_ether / ip4_ttl_expired / payload) - icmp4_reply = IP(id=0, ttl=254, src=self.pg0.local_ip4, - dst=self.pg0.remote_ip4) / \ - ICMP(type='time-exceeded', code='ttl-zero-during-transit' ) / \ - IP(src=self.pg0.remote_ip4, dst='192.168.0.1', ttl=0) / payload + icmp4_reply = (IP(id=0, ttl=254, src=self.pg0.local_ip4, + dst=self.pg0.remote_ip4) / + ICMP(type='time-exceeded', + code='ttl-zero-during-transit') / + IP(src=self.pg0.remote_ip4, + dst='192.168.0.1', ttl=1) / payload) rx = self.send_and_expect(self.pg0, p4*1, self.pg0) for p in rx: self.validate(p[1], icmp4_reply) - ''' # IPv6 Hop limit ip6_hlim_expired = IPv6(hlim=0, src='2001:db8:1ab::c0a8:1:ab', |