Skip to content

Conversation

cholland1989
Copy link
Contributor

We recently switched to this version of gopacket and started seeing the following errors when building for linux-386 targets:

Error: /home/runner/go/pkg/mod/github.com/gopacket/gopacket@v1.1.0/pcapgo/capture.go:112:29: cannot use tstamp.Sec (variable of type int32) as int64 value in argument to time.Unix
Error: /home/runner/go/pkg/mod/github.com/gopacket/gopacket@v1.1.0/pcapgo/capture.go:112:41: cannot use tstamp.Nsec (variable of type int32) as int64 value in argument to time.Unix
Error: /home/runner/go/pkg/mod/github.com/gopacket/gopacket@v1.1.0/pcapgo/capture.go:115:29: cannot use tstamp.Sec (variable of type int32) as int64 value in argument to time.Unix

This PR fixes the issue by explicitly casting these values to int64 before use in the time.Unix call.

Copy link
Contributor

@mosajjal mosajjal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. was this making 386 to fail? interesting find!

@mosajjal mosajjal merged commit 44b8a6a into gopacket:master May 4, 2023
@wolveix wolveix mentioned this pull request Jun 29, 2023
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.

2 participants