aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_reassembly.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2019-03-06 11:59:57 +0100
committerOle Trøan <otroan@employees.org>2019-09-25 16:10:09 +0000
commit769145cdbc28324bd0b6304951199ec3d6e0e883 (patch)
treec424eb8d61ad1fdfea7f2b4bf5253ea6b92fadf4 /test/test_reassembly.py
parent8fadb658a1b91a92f174fcf29a3620b644d8fe21 (diff)
ip: respect buffer boundary when searching for ipv6 headers
Type: fix Change-Id: I5a5461652f8115fa1270e20f748178fb5f5450f2 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/test_reassembly.py')
-rw-r--r--test/test_reassembly.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/test_reassembly.py b/test/test_reassembly.py
index 0b7073cae40..407b626e1d2 100644
--- a/test/test_reassembly.py
+++ b/test/test_reassembly.py
@@ -10,8 +10,8 @@ import scapy.compat
from scapy.packet import Raw
from scapy.layers.l2 import Ether, GRE
from scapy.layers.inet import IP, UDP, ICMP
-from scapy.layers.inet6 import IPv6, IPv6ExtHdrFragment, ICMPv6ParamProblem,\
- ICMPv6TimeExceeded
+from scapy.layers.inet6 import HBHOptUnknown, ICMPv6ParamProblem,\
+ ICMPv6TimeExceeded, IPv6, IPv6ExtHdrFragment, IPv6ExtHdrHopByHop
from framework import VppTestCase, VppTestRunner
from util import ppp, ppc, fragment_rfc791, fragment_rfc8200
from vpp_gre_interface import VppGreInterface
@@ -818,6 +818,23 @@ class TestIPv6Reassembly(VppTestCase):
self.verify_capture(packets)
self.src_if.assert_nothing_captured()
+ def test_buffer_boundary(self):
+ """ fragment header crossing buffer boundary """
+
+ p = (Ether(dst=self.src_if.local_mac, src=self.src_if.remote_mac) /
+ IPv6(src=self.src_if.remote_ip6,
+ dst=self.src_if.local_ip6) /
+ IPv6ExtHdrHopByHop(
+ options=[HBHOptUnknown(otype=0xff, optlen=0)] * 1000) /
+ IPv6ExtHdrFragment(m=1) /
+ UDP(sport=1234, dport=5678) /
+ Raw())
+ self.pg_enable_capture()
+ self.src_if.add_stream([p])
+ self.pg_start()
+ self.src_if.assert_nothing_captured()
+ self.dst_if.assert_nothing_captured()
+
def test_reversed(self):
""" reverse order reassembly """