diff --git a/libpcap/libpcap.go b/libpcap/libpcap.go index 5f631d1..544f036 100644 --- a/libpcap/libpcap.go +++ b/libpcap/libpcap.go @@ -60,6 +60,7 @@ func NewCatchEth(eth string, sentence string) (*NetCatch, error) { nc := new(NetCatch) nc.eth = eth nc.sentence = sentence + nc.ctx, nc.stopFn = context.WithCancel(context.Background()) return nc, nil }