Skip to content

Commit

Permalink
Added exception handler to core.py for when IPv6 packets are processe…
Browse files Browse the repository at this point in the history
…d that do not have fragmentation flags set in their headers.
  • Loading branch information
dev195 authored May 1, 2024
1 parent f7dd262 commit d7b9f0b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dshell/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,13 @@ def __init__(self, pktlen, packet: pypacker.Packet, timestamp: int, frame=0):
ieee80211_p = layer
elif ip_p is None and isinstance(layer, (ip.IP, ip6.IP6)):
ip_p = layer
if ip_p.flags & 0x1 and ip_p.offset > 0:
# IP fragmentation, break all further layer processing
break
try:
if ip_p.flags & 0x1 and ip_p.offset > 0:
# IP fragmentation, break all further layer processing
break
except AttributeError:
# IPv6 does not always have flags header field set
pass
elif tcp_p is None and isinstance(layer, tcp.TCP):
tcp_p = layer
elif udp_p is None and isinstance(layer, udp.UDP):
Expand Down

0 comments on commit d7b9f0b

Please sign in to comment.