mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Emit more information on panic
PiperOrigin-RevId: 374464969
This commit is contained in:
committed by
gVisor bot
parent
32b66bb2be
commit
5d04e0ae33
@@ -245,10 +245,10 @@ func (pk *PacketBuffer) dataOffset() int {
|
||||
func (pk *PacketBuffer) push(typ headerType, size int) tcpipbuffer.View {
|
||||
h := &pk.headers[typ]
|
||||
if h.length > 0 {
|
||||
panic(fmt.Sprintf("push must not be called twice: type %s", typ))
|
||||
panic(fmt.Sprintf("push(%s, %d) called after previous push", typ, size))
|
||||
}
|
||||
if pk.pushed+size > pk.reserved {
|
||||
panic("not enough headroom reserved")
|
||||
panic(fmt.Sprintf("push(%s, %d) overflows; pushed=%d reserved=%d", typ, size, pk.pushed, pk.reserved))
|
||||
}
|
||||
pk.pushed += size
|
||||
h.offset = -pk.pushed
|
||||
|
||||
Reference in New Issue
Block a user