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

Conflicting identifiers between cgo and gopacket #14

Open
irish-bug opened this issue Dec 31, 2019 · 2 comments
Open

Conflicting identifiers between cgo and gopacket #14

irish-bug opened this issue Dec 31, 2019 · 2 comments

Comments

@irish-bug
Copy link

irish-bug commented Dec 31, 2019

Cloning latest version of discovery with go version 1.12.1 gave the following errors.

$ ./all.bash
BUILD PACKAGES (linux)
annotate
collect
discovery
disctl
lddhcpdlogs
ldesnet
ldnmap
ldpcap
vendor/github.com/google/gopacket/pcap
../../vendor/github.com/google/gopacket/pcap/pcap.go:202:7: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:482:13: identifier "_Ctype_struct_pcap_stat" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:527:49: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:550:10: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:583:41: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:655:66: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:668:19: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:795:34: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:798:56: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
ldrouterconfig
minemiter
trim

TESTING
? pkg/commands [no test files]
goos: linux
goarch: amd64
pkg: pkg/minigraph
BenchmarkBigGraph-2 1000000 1964 ns/op
PASS
ok pkg/minigraph 2.011s
? pkg/latlon [no test files]
? pkg/discovery [no test files]
pkg/minilog
./minilog.go:268:2: missing ... in args forwarded to printf-like function
FAIL pkg/minilog [build failed]
PASS
ok pkg/p0f 0.009s
? cmds/collect [no test files]
? cmds/ldnmap [no test files]
? cmds/disctl [no test files]
? cmds/ldrouterconfig [no test files]
vendor/github.com/google/gopacket/pcap
../../vendor/github.com/google/gopacket/pcap/pcap.go:202:7: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:482:13: identifier "_Ctype_struct_pcap_stat" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:527:49: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:550:10: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:583:41: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:655:66: identifier "_Ctype_struct_bpf_program" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:668:19: identifier "_Ctype_struct_bpf_insn" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:795:34: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
../../vendor/github.com/google/gopacket/pcap/pcap.go:798:56: identifier "_Ctype_struct_pcap_addr" may conflict with identifiers generated by cgo
FAIL cmds/ldpcap [build failed]
? cmds/discovery [no test files]
? cmds/lddhcpdlogs [no test files]
cmds/trim
./main.go:292:5: Fatalln call has possible formatting directive %v
? cmds/annotate [no test files]
? cmds/ldesnet [no test files]
? cmds/minemiter [no test files]

Discovered this problem is already fixed in
google/gopacket#589

I removed the gopacket directory bundled with discovery and replaced by cloning latest version of gopacket from https://github.com/google/gopacket/

This removed the above errors, but one more error existed
./main.go:210:14: Error call has arguments but no formatting directives
added %v where missing from that line and ldpcap built successfully.

Was not able to push these changes myself.

@djfritz
Copy link
Contributor

djfritz commented Jan 13, 2020

Yep I'm seeing this now too - thanks for hunting this down. If you want, feel free to clone, patch, and submit a PR. Otherwise I'll roll your changes up this week.

@irish-bug
Copy link
Author

djfritz: I tried, but I get

remote: Permission to sandia-minimega/discovery.git denied to irish-bug.

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

No branches or pull requests

2 participants