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 native endianness when encoding InetDiagMsg #2508

Merged
merged 2 commits into from Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion collector/tcpstat_linux_test.go
Expand Up @@ -19,13 +19,14 @@ import (
"syscall"
"testing"

"github.com/josharian/native"
"github.com/mdlayher/netlink"
)

func Test_parseTCPStats(t *testing.T) {
encode := func(m InetDiagMsg) []byte {
var buf bytes.Buffer
err := binary.Write(&buf, binary.LittleEndian, m)
err := binary.Write(&buf, native.Endian, m)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -12,6 +12,7 @@ require (
github.com/hashicorp/go-envparse v0.0.0-20200406174449-d9cfd743a15e
github.com/hodgesds/perf-utils v0.5.1
github.com/illumos/go-kstat v0.0.0-20210513183136-173c9b0a9973
github.com/josharian/native v1.0.0
github.com/jsimonetti/rtnetlink v1.2.2
github.com/lufia/iostat v1.2.1
github.com/mattn/go-xmlrpc v0.0.3
Expand Down Expand Up @@ -39,7 +40,6 @@ require (
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/josharian/native v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mdlayher/genetlink v1.2.0 // indirect
Expand Down