File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ import (
4444
4545const maxForwarders = 8
4646
47+ // disable log.wtf driven exit (it did not work the last time it was tested)
48+ const testwtf = false
49+
4750type fiveTuple struct {
4851 srcAddr , dstAddr []byte
4952 srcPort , dstPort uint16
@@ -164,7 +167,7 @@ func (p *processor) start(wg *sync.WaitGroup) {
164167func (p * processor ) deliverPackets () {
165168 testpanic := ! p .testcrash && settings .PanicAtRandom .Load () && rand10pc ()
166169 if testpanic {
167- defer core .Recover (core .DontExit , "ns.forwarder.deliverPackets" )
170+ defer core .Recover (core .Exit11 , "ns.forwarder.deliverPackets" )
168171 }
169172
170173 p .mu .Lock ()
@@ -183,7 +186,7 @@ func (p *processor) deliverPackets() {
183186
184187 if testpanic {
185188 panic ("ns: tun: forwarder: deliverPackets rand10pc" )
186- } else if ! p .testcrash && settings .FatalAtRandom .Load () && rand1pc () {
189+ } else if testwtf && ! p .testcrash && settings .PanicAtRandom .Load () && rand1pc () {
187190 p .testcrash = true
188191 core .RuntimeWtf ("ns: tun: forwarder: test fatal\n " )
189192 var mu sync.Mutex
Original file line number Diff line number Diff line change @@ -74,9 +74,5 @@ const IntraUa = "Intra"
7474// every once in a while (for testing).
7575var PanicAtRandom = atomic.Bool {}
7676
77- // FatalAtRandom is a global flag to fatally crash the network engine
78- // every once in a while (for testing).
79- var FatalAtRandom = atomic.Bool {}
80-
8177// OwnTunFd is a global flag to indicate that the TUN fd is fully owned by netstack.
8278var OwnTunFd = atomic.Bool {}
Original file line number Diff line number Diff line change @@ -254,13 +254,6 @@ func PanicAtRandom(y bool) {
254254 log .I ("tun: panic at random? %t" , y )
255255}
256256
257- // FatalAtRandom instructs portions under test to fatally crash the network engine.
258- // For testing only.
259- func FatalAtRandom (y bool ) {
260- settings .FatalAtRandom .Store (y )
261- log .I ("tun: fatal at random? %t" , y )
262- }
263-
264257func pipeCrashOutput (bdg Bridge ) (ok bool ) {
265258 r , w , err := os .Pipe ()
266259 if err != nil {
Original file line number Diff line number Diff line change @@ -490,7 +490,6 @@ func (t *rtunnel) stat() (*x.NetStat, error) {
490490 out .RDNSIn .PortForward = settings .PortForward .Load ()
491491 out .RDNSIn .Transparency = settings .EndpointIndependentFiltering .Load ()
492492 out .RDNSIn .PanicTest = settings .PanicAtRandom .Load ()
493- out .RDNSIn .FatalTest = settings .FatalAtRandom .Load ()
494493 out .RDNSIn .SetUserAgent = settings .SetUserAgent .Load ()
495494 out .RDNSIn .SystemDNSForUndelegated = settings .SystemDNSForUndelegatedDomains .Load ()
496495 out .RDNSIn .DefaultDNSAsFallback = settings .DefaultDNSAsFallback .Load ()
You can’t perform that action at this time.
0 commit comments