ping: limit ICMP read buffer size
This commit is contained in:
parent
bebc8d67f3
commit
1aa83a9f92
3 changed files with 6 additions and 3 deletions
|
|
@ -93,7 +93,7 @@ func ConnectGVisor(
|
|||
func (d *GVisorDestination) loopRead() {
|
||||
defer d.endpoint.Close()
|
||||
for {
|
||||
buffer := buf.NewPacket()
|
||||
buffer := buf.NewSize(maxICMPPacketSize)
|
||||
err := d.conn.SetReadDeadline(time.Now().Add(d.timeout))
|
||||
if err != nil {
|
||||
d.logger.ErrorContext(d.ctx, E.Cause(err, "set read deadline for ICMP conn"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue