Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ please see "cmd/ping/ping.go".
This package implements ICMP ping using both raw socket and UDP. If your program
uses this package in raw socket mode, it needs to be run as a root user.

If you are using the UDP socket on Linux, you may also need to allow UDP pings (even root is not allowed by default on debian for example):
```
sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"
```

## License
go-fastping is under MIT License. See the [LICENSE][license] file for details.

Expand Down
6 changes: 3 additions & 3 deletions fastping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func TestRun(t *testing.T) {
t.Fatalf("AddIP failed: %v", err)
}

if err := p.AddIP("127.0.0.100"); err != nil {
if err := p.AddIP("198.51.100.100"); err != nil {
t.Fatalf("AddIP failed: %v", err)
}

Expand All @@ -179,7 +179,7 @@ func TestRun(t *testing.T) {
called = true
if ip.String() == "127.0.0.1" {
found1 = true
} else if ip.String() == "127.0.0.100" {
} else if ip.String() == "198.51.100.100" {
found100 = true
} else if ip.String() == "::1" {
foundv6 = true
Expand All @@ -204,7 +204,7 @@ func TestRun(t *testing.T) {
t.Fatalf("Pinger `127.0.0.1` didn't respond")
}
if found100 {
t.Fatalf("Pinger `127.0.0.100` responded")
t.Fatalf("Pinger `198.51.100.100` responded")
}
if !foundv6 {
t.Fatalf("Pinger `::1` didn't responded")
Expand Down