aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2019-03-06 11:59:57 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-03 16:11:41 +0000
commit35a265ceaef4af68e4d1d817447b0b895176a6ff (patch)
tree45884086bdf037a1c87adebc515a03d1ebcad101 /test
parent09c91fe62775817a143a491ed999ddec30b8042b (diff)
ip: respect buffer boundary when searching for ipv6 headers
Type: fix Change-Id: I5a5461652f8115fa1270e20f748178fb5f5450f2 Signed-off-by: Klement Sekera <ksekera@cisco.com> (cherry picked from commit 769145cdbc28324bd0b6304951199ec3d6e0e883)
Diffstat (limited to 'test')
-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 """