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

Use gopacket/gopacket instead of google/gopacket #336

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

philrz
Copy link
Contributor

@philrz philrz commented Feb 12, 2024

tl;dr

#19 (comment) has a repro of a community user's inability to open slices if they came from a pcap with cooked-mode/SLL link layer protocol. The version of google/gopacket that Brimcap has been pointing to lacks support for this, but it looks like ongoing gopacket work has moved to another fork and that includes support for this. This PR points Brimcap at that fork.

Fixes #19

Details

I learned of the fork after finding mention of cooked mode support in google/gopacket#933 and that the enhancement actually got merged at a different fork via gopacket/gopacket#1. Indeed, google/gopacket has not seen a commit since August, 2022 and has not tagged a release since October, 2020. Meanwhile, it looks like google/gopacket#1016 is the best narrative that summarizes the semi-abandoned nature of https://github.com/google/gopacket and pointing everyone at https://github.com/gopacket/gopacket.

As usual, I don't claim Go expertise so all I've done here is a 1-for-1 swap of gopacket/gopacket references in place of google/gopacket and ran go mod tidy. If that should have been done differently, guidance would be appreciated!

But FWIW, this alone seems to have the desired effect. Compared to what's shown in the closing remark of #19 (comment), using a Brimcap based on this branch, now it shows the link type as supported.

$ ./brimcap -version
Version: v1.6.0-13-g764d457

$ ./brimcap info traf2.pcap 
Pcap type:         pcap
Pcap version:      2.4
Link type:         Linux SLL2
Packet size limit: 262144
Number of packets: 95431

And pointing my Zui at this Brimcap commit, the pcap slice can now be successfully extracted.

Fix.mp4

Questions for reviewers

  1. Assuming this passes CI, are there additional audits we should perform before depending on the fork? The licensing looks similar, FWIW.

  2. I noticed the multiple comments where we say we copied and modified some code based on stuff from google/gopacket. Since we're not changing any of that code here I assume there's no action needed related to that. But I figured I'd point it out just in case.

@philrz philrz requested review from mattnibs and nwt February 12, 2024 19:43
@philrz philrz self-assigned this Feb 12, 2024
@philrz philrz merged commit c74d4ff into main Feb 12, 2024
3 checks passed
@philrz philrz deleted the use-gopacket-gopacket branch February 12, 2024 20:47
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

Successfully merging this pull request may close these issues.

Linux cooked-mode capture (SLL) support
2 participants