Skip to content

Commit d7b9f0b

Browse files
authored
Added exception handler to core.py for when IPv6 packets are processed that do not have fragmentation flags set in their headers.
1 parent f7dd262 commit d7b9f0b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dshell/core.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,9 +902,13 @@ def __init__(self, pktlen, packet: pypacker.Packet, timestamp: int, frame=0):
902902
ieee80211_p = layer
903903
elif ip_p is None and isinstance(layer, (ip.IP, ip6.IP6)):
904904
ip_p = layer
905-
if ip_p.flags & 0x1 and ip_p.offset > 0:
906-
# IP fragmentation, break all further layer processing
907-
break
905+
try:
906+
if ip_p.flags & 0x1 and ip_p.offset > 0:
907+
# IP fragmentation, break all further layer processing
908+
break
909+
except AttributeError:
910+
# IPv6 does not always have flags header field set
911+
pass
908912
elif tcp_p is None and isinstance(layer, tcp.TCP):
909913
tcp_p = layer
910914
elif udp_p is None and isinstance(layer, udp.UDP):

0 commit comments

Comments
 (0)