You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After trying a bunch more pcap files, the following lame fix to packet.go seems to work:
func layerString(...)
. . .
case reflect.Struct:
. . .
if ftype.Anonymous {
// the old line that panics:
// anonStr := layerString(f.Interface(), true, writeSpace)
. . .
// this seems to only affect output like:
// "Contents=[..20..] Payload=[..1389..]"
// which appears to be "type BaseLayer struct", so
// just using an empty string when it's anonymous seems
// to work ... and that's not a lot of info to lose
anonStr := layerString("", true, writeSpace)
. . .
go version go1.6 darwin/amd64
using gopacket/examples/pcapdump/main.go:
go run pcapdump.go -r test_ethernet.pcap
... tried with many pcap files... output is lots of these:
%!v(PANIC=reflect.Value.Interface: cannot return value obtained from unexported field or method)
.layerString()
?... maybe it's related to this:
https://groups.google.com/forum/#!topic/golang-nuts/iHJcOWmWAag
http://tip.golang.org/doc/go1.6#reflect
other programs work fine ... like:
httpassembly.go
andbidirectional.go
The text was updated successfully, but these errors were encountered: