MCPcopy
hub / github.com/safing/portmaster / StopNfqueueInterception

Function StopNfqueueInterception

service/firewall/interception/nfqueue_linux.go:433–460  ·  view source on GitHub ↗

StopNfqueueInterception stops the nfqueue interception.

()

Source from the content-addressed store, hash-verified

431
432// StopNfqueueInterception stops the nfqueue interception.
433func StopNfqueueInterception() error {
434 if !isRunning.CompareAndSwap(true, false) {
435 return nil // not running
436 }
437
438 // Signal shutdown to packet handler
439 defer close(shutdownSignal)
440
441 if out4Queue != nil {
442 out4Queue.Destroy()
443 }
444 if in4Queue != nil {
445 in4Queue.Destroy()
446 }
447 if out6Queue != nil {
448 out6Queue.Destroy()
449 }
450 if in6Queue != nil {
451 in6Queue.Destroy()
452 }
453
454 err := DeactivateNfqueueFirewall()
455 if err != nil {
456 return fmt.Errorf("interception: error while deactivating nfqueue: %w", err)
457 }
458
459 return nil
460}
461
462func handleInterception(packets chan<- packet.Packet) error {
463 for {

Callers 1

stopInterceptionFunction · 0.85

Calls 3

ErrorfMethod · 0.80
DestroyMethod · 0.65

Tested by

no test coverage detected