Merged in gvaladon/scapy-fork/Issue #600 (pull request #13)

Issue #600: Fragmenting long IPv6 packet produces deprecation warnings
This commit is contained in:
pbi 2013-09-03 15:48:38 +02:00
commit d790240e94
1 changed files with 11 additions and 4 deletions

View File

@ -960,10 +960,6 @@ def fragment6(pkt, fragSize):
"""
pkt = pkt.copy()
s = str(pkt) # for instantiation to get upper layer checksum right
if len(s) <= fragSize:
return [pkt]
if not IPv6ExtHdrFragment in pkt:
# TODO : automatically add a fragment before upper Layer
@ -971,6 +967,17 @@ def fragment6(pkt, fragSize):
# as single element of a list
return [pkt]
# If the payload is bigger than 65535, a Jumbo payload must be used, as
# an IPv6 packet can't be bigger than 65535 bytes.
if len(str(pkt[IPv6ExtHdrFragment])) > 65535:
warning("An IPv6 packet can'be bigger than 65535, please use a Jumbo payload.")
return []
s = str(pkt) # for instantiation to get upper layer checksum right
if len(s) <= fragSize:
return [pkt]
# Fragmentable part : fake IPv6 for Fragmentable part length computation
fragPart = pkt[IPv6ExtHdrFragment].payload
tmp = str(IPv6(src="::1", dst="::1")/fragPart)