feat: rules hot reload via SIGHUP (#44)

This commit is contained in:
Toby
2024-02-03 10:55:20 -08:00
committed by GitHub
parent 8d94400855
commit f8f0153664
5 changed files with 39 additions and 4 deletions

View File

@@ -127,7 +127,10 @@ func (w *worker) Run(ctx context.Context) {
}
func (w *worker) UpdateRuleset(r ruleset.Ruleset) error {
return w.tcpStreamFactory.UpdateRuleset(r)
if err := w.tcpStreamFactory.UpdateRuleset(r); err != nil {
return err
}
return w.udpStreamFactory.UpdateRuleset(r)
}
func (w *worker) handle(streamID uint32, p gopacket.Packet) (io.Verdict, []byte) {