StopNfqueueInterception stops the nfqueue interception.
()
| 431 | |
| 432 | // StopNfqueueInterception stops the nfqueue interception. |
| 433 | func 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 | |
| 462 | func handleInterception(packets chan<- packet.Packet) error { |
| 463 | for { |
no test coverage detected