packetcap / go-pcap

Packet capture library and tools in native go
Apache License 2.0
14 stars 4 forks source link

gopacket dependency update #52

Open amarcum opened 1 month ago

amarcum commented 1 month ago

Just a question. I came across go-pcap when I was trying to cross compile for arm64 (The Raspberry PI 5) and had issues with cgo linking correctly. I love that this project doesn't require cgo! Its been really nice to debug some of my IPC traffic between components without having to modify and change the behavior or the original ones!

Have you thought about using the github.com/gopacket/gopacket dependency instead of the github.com/google/gopacket one? It appears that fork is being maintained more regularly than the google one. I tried just doing a replace in my go.mod file, but looks like that wasn't enough 😔. It might fix some issues in the original one, The bug I am seeing right now is some packets are being added to a closed channel when shutting down if there is a lot of traffic going through the system, but not all the time.

Thank you again for a great library!

deitch commented 1 month ago

Hi Alex,

We had the same problem when I started this. I was working with a client (I am independent) on a project, they needed to compile for arm64 and amd64 (and maybe some others), and the one thing getting in the way was pcap, so I wrote it. "How hard could it be?" 😆

Have you thought about using the github.com/gopacket/gopacket dependency instead of the github.com/google/gopacket one? It appears that fork is being maintained more regularly than the google one.

I haven't tried it. Go for it. If you can get it to work, I would be happy to.

amarcum commented 1 month ago

Awesome! I will make a branch, update to the gopacket/gopacket version, and maybe add a unit test.

amarcum commented 1 month ago

Ok, hopefully this commit is a step forward. The "How hard could it be?" comment is how I start so many of my projects as well... Its like I never learn 😁 Oh, it might be nice to add a first tag/version to the repo as well. maybe v0.1.0? https://github.com/packetcap/go-pcap/pull/53