ping: limit ICMP read buffer size
This commit is contained in:
parent
bebc8d67f3
commit
1aa83a9f92
3 changed files with 6 additions and 3 deletions
|
|
@ -125,7 +125,7 @@ func (c *UnprivilegedConn) fetchResponse(conn *net.UDPConn, identifier uint16) {
|
|||
return
|
||||
}
|
||||
}
|
||||
buffer := buf.NewPacket()
|
||||
buffer := buf.NewSize(maxICMPPacketSize)
|
||||
cmsgBuffer := buf.NewSize(1024)
|
||||
n, oobN, _, addr, err := conn.ReadMsgUDPAddrPort(buffer.FreeBytes(), cmsgBuffer.FreeBytes())
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue