WireGuard / wgctrl-go

Package wgctrl enables control of WireGuard interfaces on multiple platforms.
https://godoc.org/golang.zx2c4.com/wireguard/wgctrl
MIT License
730 stars 85 forks source link

Add support for ARM #18

Closed khia closed 5 years ago

khia commented 5 years ago

I am trying to cross-compile wireguardctrl for my NAS device. It has very old kernel so I cannot use kernel based wireguard. The wireguard-go implementation doesn't include configuration command. So I decided that wireguardctrl could be a good option since as it seems to support userspace implementations. However I have a problem to compile it with go1.11.4. Here is the list of commands I use:

(master)$ go version
go version go1.11.4 linux/amd64

(master)$ GOARM=7 GOOS=linux GOARCH=arm go get -ldflags "-R 65536" -u github.com/mdlayher/wireguardctrl
# github.com/mdlayher/wireguardctrl/internal/wgnl
tools/go/go1.11.4/lib/src/github.com/mdlayher/wireguardctrl/internal/wgnl/parse_linux.go:265:20: cannot use ts.Sec (type int32) as type int64 in argument to time.Unix
tools/go/go1.11.4/lib/src/github.com/mdlayher/wireguardctrl/internal/wgnl/parse_linux.go:265:28: cannot use ts.Nsec (type int32) as type int64 in argument to time.Unix
mdlayher commented 5 years ago

Ah yep, I've seen this before with my github.com/mdlayher/raw package. Happy to accept a PR similar to how that repo does it, or otherwise I can try to take a look at this in the next couple of days.

mdlayher commented 5 years ago

Fixed in https://github.com/mdlayher/wireguardctrl/commit/c1897438e5e63d08f55ab4fd6285354bf1ec885a.