aboutsummaryrefslogtreecommitdiffstats
path: root/test/util.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-29 14:49:52 +0000
committerOle Trøan <otroan@employees.org>2019-07-31 10:12:14 +0000
commit1404698df397bc4d3007daea41f52ad75ed4486c (patch)
tree4c396973b37193def1bdb4c4a9f9e91f2e1b7274 /test/util.py
parent513582c96a6d58a3980b3e444446bc6e5c4e4764 (diff)
ip: Ensure reassembly runs before IPSec decrypt.
Type: fix Change-Id: I01eeedf8d5015b07b9422c65afe78bfe8177c22c Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/util.py')
-rw-r--r--test/util.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/util.py b/test/util.py
index d27b3fb25e6..96d3c6068ef 100644
--- a/test/util.py
+++ b/test/util.py
@@ -386,14 +386,19 @@ def fragment_rfc8200(packet, identification, fragsize, _logger=None):
fragment_ext_hdr = IPv6ExtHdrFragment()
logger.debug(ppp("Fragment header:", fragment_ext_hdr))
+ len_ext_and_upper_layer_payload = len(ext_and_upper_layer.payload)
+ if not len_ext_and_upper_layer_payload and \
+ hasattr(ext_and_upper_layer, "data"):
+ len_ext_and_upper_layer_payload = len(ext_and_upper_layer.data)
+
if len(per_fragment_headers) + len(fragment_ext_hdr) +\
- len(ext_and_upper_layer) - len(ext_and_upper_layer.payload)\
+ len(ext_and_upper_layer) - len_ext_and_upper_layer_payload\
> fragsize:
raise Exception("Cannot fragment this packet - MTU too small "
"(%s, %s, %s, %s, %s)" % (
len(per_fragment_headers), len(fragment_ext_hdr),
len(ext_and_upper_layer),
- len(ext_and_upper_layer.payload), fragsize))
+ len_ext_and_upper_layer_payload, fragsize))
orig_nh = packet[IPv6].nh
p = per_fragment_headers