Skip to content

Commit

Permalink
core/ping: incr min payload size to 32b
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Nov 23, 2024
1 parent bcf6123 commit 237b4f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions intra/core/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import (
var errNotICMPEchoReply = errors.New("icmp: expecting echo reply")

const (
padlen = 0
payloadSize = 32 // bytes
padlen = 16 // bytes
ttl = 64
timeout = 3 * time.Second
protocolICMP = 1
Expand Down Expand Up @@ -195,7 +196,7 @@ func cleardeadline(c MinConn) {
}

func payload() (t []byte, tslen int, err error) {
randomPayload := make([]byte, 16)
randomPayload := make([]byte, payloadSize)
_, err = rand.Read(randomPayload[:])
if err != nil {
return
Expand Down

0 comments on commit 237b4f4

Please sign in to comment.