-
Notifications
You must be signed in to change notification settings - Fork 21
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
runtime error: slice bounds out of range #6
Comments
Thanks for reporting! I made a new release v1.0.1 that fixes these issues and implements dumping as JSON in live mode. There are two versions of the library, one which uses the google/gopacket package and one that uses my fork, To build the new version from the google-gopacket branch you could do:
Let me know if it worked please, then I can close the ticket. |
I followed your guide
and then input like this
nothing output, even the title I'm sure the netflow is functional. |
Hmm weird. What version of go are you using ? Are you compiling within $GOPATH using go modules? Try forcing the use of go modules:
|
Sorry I'm not familiar with go and his compilling,the go version is and the $GOPATH is empty, and
I install it again with Did it works in your envirment? |
No problem! It works on my machine, so let's find out why it does not on yours.
If the build succeeded you should see the new -snaplen flag to set the buffer size for ethernet frames during live capture. 1500 Bytes Ethernet MTU + 14 Bytes Ethernet Header
|
I found where the problem is! the new release v1.0.1 is works fine for normal interface but when I check the -interface to Mirroring netflow,it didn't work,but it is worked on previous version. the Mirroring netflow interface like this
and the debug mode in new version in Mirroring netflow interface also output nothing and I think this is an another bug.... |
Interesting, might be related to gopacket, I bumped the dependency in v1.0.1. Just pushed a few more flags to master that allow you to adjust the parameters passed to the gopacket.OpenLive call,
If no output is printed in debug mode, I assume opening the interface handle failed and therefore no traffic is received. The timeout was set to -1 which means never timeout, maybe thats what lead to not receiving anything. You can recompile by doing:
If attaching to the interface times out, you should get an error after 30 seconds. Could you describe how you've setup the mirroring in detail so that I can try to reproduce it? |
the normal interface : some times get error immediately,some times get error a few seconds
before get error ,it could get output
and mirror interface get error after 30s
the mirror interface not made by my hand, and it probably made through switch ,you can see lots of RX packets and few TX packets
|
I read into the docs for the timeout value (https://godoc.org/github.com/google/gopacket/pcap#hdr-PCAP_Timeouts), It's actually the time the kernel can wait to batch packets and avoid excessive syscalls. There is a sane default pcap.BlockForever, which I've set as a default now. I've pushed the changes to master, you can update your build with:
Please try again and share the results. |
I will try that this weekend |
when I run this
/root/go/bin/goja3 -ja3s=false -json -iface eth1
the result
The text was updated successfully, but these errors were encountered: