pro-bing icon indicating copy to clipboard operation
pro-bing copied to clipboard

Not working on FreeBSD systems

Open ARPABoy opened this issue 2 years ago • 1 comments

My test steps are:

mkdir test
cd test
wget https://raw.githubusercontent.com/prometheus-community/pro-bing/main/cmd/ping/ping.go
go mod init test
go mod tidy

On my FreeBSD system, I get "protocol not supported" error:

root@FreeBSD # ~/test> go run ping.go 8.8.8.8
go run ping.go 8.8.8.8
PING 8.8.8.8 (8.8.8.8):
Failed to ping target host: socket: protocol not supported

The same steps on a Linux system:

root@ubuntu-cloud:~/test# go run ping.go 8.8.8.8
PING 8.8.8.8 (8.8.8.8):
32 bytes from 8.8.8.8: icmp_seq=0 time=15.968962ms ttl=118
32 bytes from 8.8.8.8: icmp_seq=1 time=16.025836ms ttl=118
32 bytes from 8.8.8.8: icmp_seq=2 time=16.281375ms ttl=118
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 3 packets received, 0 duplicates, 25% packet loss
round-trip min/avg/max/stddev = 15.968962ms/16.092057ms/16.281375ms/135.866µs

My FreeBSD system details are as follows:

freebsd-version -kru
13.2-RELEASE-p4
13.2-RELEASE-p4
13.2-RELEASE-p7
go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/kr0m/.cache/go-build"
GOENV="/home/kr0m/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOINSECURE=""
GOMODCACHE="/home/kr0m/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="freebsd"
GOPATH="/home/kr0m/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go120"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go120/pkg/tool/freebsd_amd64"
GOVCS=""
GOVERSION="go1.20.8"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="cc"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2645866918=/tmp/go-build -gno-record-gcc-switches"

If you require any further information feel free to contact me.

ARPABoy avatar Dec 10 '23 16:12 ARPABoy

On FreeBSD, only --privileged mode works (but it works then as root).

leahneukirchen avatar Jun 12 '24 15:06 leahneukirchen