Skip to content

Commit 9aede95

Browse files
committed
netstack/forwarders: fatal on test
1 parent cc9295a commit 9aede95

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

intra/netstack/forwarders.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ func (p *processor) start(wg *sync.WaitGroup) {
161161
// deliverPackets delivers packets to the endpoint; thread-safe.
162162
func (p *processor) deliverPackets() {
163163
testpanic := settings.PanicAtRandom.Load() && rand10pc()
164-
testfatal := settings.FatalAtRandom.Load() && rand10pc()
165164
if testpanic {
166165
defer core.Recover(core.DontExit, "ns.forwarder.deliverPackets")
167166
}
@@ -183,8 +182,12 @@ func (p *processor) deliverPackets() {
183182
if testpanic {
184183
panic("ns: tun: forwarder: deliverPackets rand10pc")
185184
}
186-
if testfatal {
185+
if settings.FatalAtRandom.Load() {
187186
core.RuntimeWtf("ns: tun: forwarder: test fatal")
187+
if rand10pc() {
188+
var mu sync.Mutex
189+
mu.Unlock() // ka-boom
190+
}
188191
}
189192
}
190193

0 commit comments

Comments
 (0)