-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Description
packet.set_nfq_data(nfqueue, nfa)
try:
user_callback(packet)
finally:
packet.drop_refs()
return 1the drop_refs call is setting a pointer to null, but doesnt touch the actual memory allocated by libnetfilter_queue. the pointer will also be garbage collected once it Packet is no longer referenced. I feel this should be removed, but if it needs to be there for something i am not seeing, then it can be moved to a dealloc method and done automatically. (both of these get messy though if python kills it before you get to it)
self.payload_len = nfq_get_payload(nfa, &self.payload)
if self.payload_len < 0:
# Probably using a mode that doesn't provide the payload
self.payload = NULL
self.payload_len = 0this has a similar issue. i would expect this code would never be reached , but if so it doesnt need to reset the payload pointer. nfq_get_payload returning -1 is due to an error, so it would probably be more fitting to raise that up or exit since it is likely a fatal condition.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels