Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize UDP packet statistics collection and clear hashstring in Packet::onlySource() #283

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hy-n
Copy link

@hy-n hy-n commented Nov 12, 2024

Hi,

I'm using this in my program on ubuntu, and recently I found that it can not show the pid of udp packets sometimes, then I look up the code carefully, and found it may concerned about the conninode_udp which got from /proc/net/udp, the rem_address in this file is sometimes empty, so the hashstring saved in conninode_udp sometimes may not accurate(only have source address), and when use conninode_udp in getProcess, the value somethimes may could't found, cause the hash key here is the full(which has both source addr and dest addr extracted from the info captured from libpcap), so it was added to the unknownudp; I think its inapposite, maybe use onlySource as key is better here?
image

Also, I've found that in Packet::onlySource(), the hashstring of new packet is forgot to release.

Hope this helps. Best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant