-
Notifications
You must be signed in to change notification settings - Fork 338
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
network_monitor broken in linux #39
Comments
Hrm, that's odd. How much memory do you have on your box? Is it a server or a desktop? I've never seen that issue myself, but changing that shouldn't break anything, just sets a static allocation buffer to capture packets in on. My only concern is capturing larger requests, so what happens if you set it to say 65535 (so large it doesn't matter)? |
I am on a 32-bit system with 4GB of mem. |
setting it to 65535 seems to work also. |
That's quite odd, I'll mess with it tonight and make sure it doesn't break anything before merging into master. I assume you're using the most up-to-date everything? |
yep, cloned on Oct 11. |
my pcapy is from the ubuntu repository and is version 0.10.8-1build1. |
It also only seemed to happen on Linux for me. @tbearden correctly identified that the second argument to From pcapy docs:
After some digging I found this bug report: the-tcpdump-group/libpcap#99 where someone says:
TL;DRgiving -1 to SolutionChange the -1 to some large positive integer. The maximum 32 bit integer (2,147,483,647) value should do what -1 was doing before, but lots of people online seem to use 65,535. 2 gigs seems like a lot for a packet anyway. I'm out of time tonight but maybe I can do this soon. The fix is simple anyway. |
When I use network monitor on my kubuntu precise machine, the network_monitor starts and waits for a connection and then exits immediately when it gets one. Traced this back to line 181 of the script "self.pcap = pcapy.open_live(self.device, -1, 1, 100)". Trying this just in a shell I get an error "pcapy.PcapError: eth0: can't allocate oneshot buffer: Cannot allocate memory". Changing line 181 to "self.pcap = pcapy.open_live(self.device, 1518, 1, 100)" fixes this, but I haven't tested on windows, so I don't know if it breaks anything there.
The text was updated successfully, but these errors were encountered: