summaryrefslogtreecommitdiffstats
path: root/test/test_reassembly.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2021-12-01 10:14:38 +0000
committerOle Tr�an <otroan@employees.org>2021-12-14 09:10:30 +0000
commit755042dec0fcc733d456adc2a74042c529eff039 (patch)
treeb5d51eb10f428964e2d4283bf66bda830748399a /test/test_reassembly.py
parentb97bec0ae58aa7e5a1aca48686143d7b89567ac7 (diff)
ip: reassembly: drop zero length fragments
Zero length fragments are invalid and should be dropped. This patch adds that. Type: improvement Change-Id: Ic6466c39ca8bf376efe06bb3b7f5d7f1ae812866 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/test_reassembly.py')
-rw-r--r--test/test_reassembly.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_reassembly.py b/test/test_reassembly.py
index bd622a94794..faec5f42c30 100644
--- a/test/test_reassembly.py
+++ b/test/test_reassembly.py
@@ -1392,6 +1392,15 @@ class TestIPv6Reassembly(VppTestCase):
self.assertIn(ICMPv6ParamProblem, icmp)
self.assert_equal(icmp[ICMPv6ParamProblem].code, 3, "ICMP code")
+ def test_truncated_fragment(self):
+ """ truncated fragment """
+ pkt = (Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac) /
+ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6,
+ nh=44, plen=2) /
+ IPv6ExtHdrFragment(nh=6))
+
+ self.send_and_assert_no_replies(self.pg0, [pkt], self.pg0)
+
def test_invalid_frag_size(self):
""" fragment size not a multiple of 8 """
p = (Ether(dst=self.src_if.local_mac, src=self.src_if.remote_mac) /
@@ -1917,6 +1926,15 @@ class TestIPv6SVReassembly(VppTestCase):
IPv6ExtHdrFragment(id=1)/ICMPv6EchoRequest())
rx = self.send_and_expect(self.src_if, [pkt], self.dst_if)
+ def test_truncated_fragment(self):
+ """ truncated fragment """
+ pkt = (Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac) /
+ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6,
+ nh=44, plen=2) /
+ IPv6ExtHdrFragment(nh=6))
+
+ self.send_and_assert_no_replies(self.pg0, [pkt], self.pg0)
+
class TestIPv4ReassemblyLocalNode(VppTestCase):
""" IPv4 Reassembly for packets coming to ip4-local node """