scroot / gopacket

Automatically exported from code.google.com/p/gopacket
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Generic error from SetImmediateMode #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I calling SetImmediateMode (with true/false) I am getting a Generic Error,

This is my code:
https://gist.github.com/yosiat/84d4159e673442bcb91d

My operating system is Mac OS X 10.9.5 with go1.3.3 darwin/amd64

Why is this happening?

Original issue reported on code.google.com by yosy...@gmail.com on 14 Oct 2014 at 7:36

GoogleCodeExporter commented 9 years ago
My code is still running, just wandering why I am getting a generic error and 
what it means.

Original comment by yosy...@gmail.com on 14 Oct 2014 at 7:38

GoogleCodeExporter commented 9 years ago
Hmm, that's a good question.  Underneath, we call pcap_set_immediate_mode, and 
if we get an error we return it with pcap_statustostr.  Can you reproduce this 
in C code on your machine, or is this a Go-specific issue?

Original comment by gconnell@google.com on 16 Oct 2014 at 3:49

GoogleCodeExporter commented 9 years ago
The problem is that the pcap that ships with OSX (Mavericks) fails at setting 
the immediate mode.
I could reproduce the problem and fixed it by doing the following:

1. Installed libpcap 1.6.1 from homebrew:
  brew install libpcap

2. Updated pcap.go in gopacket to use the right CFLAGS and LDFLAGS:
  #cgo darwin CFLAGS: -I/usr/local/Cellar/libpcap/1.6.1/include                                                                                                                                        
  #cgo darwin LDFLAGS: -L/usr/local/Cellar/libpcap/1.6.1/lib -lpcap                                                                                                                                                                             

Then it works fine.

Original comment by fio...@gmail.com on 16 Oct 2014 at 5:46

GoogleCodeExporter commented 9 years ago
This problem will likely go away once Yosemite is release and hopefully ships 
with libpcap 1.6.1.

Original comment by fio...@gmail.com on 16 Oct 2014 at 5:47

GoogleCodeExporter commented 9 years ago
Thanks for checking this out.  I'm marking as WontFix for now, with hopes that 
this will go away in Yosemite.  Please feel free to reopen if you feel it 
should be handled differently, and thanks for the report!

Original comment by gconnell@google.com on 16 Oct 2014 at 5:48

GoogleCodeExporter commented 9 years ago
Thanks for the quick answers.

I have upgraded to OS X Yosemite today, and it have libpcap "version 1.5.3 - 
Apple version 47".

Original comment by yosy...@gmail.com on 17 Oct 2014 at 7:21