diff --git a/monitor_test.go b/monitor_test.go index d690432..5640e13 100644 --- a/monitor_test.go +++ b/monitor_test.go @@ -156,6 +156,9 @@ func TestMonitor(t *testing.T) { *gotChain.Hooknum != *postrouting.Hooknum { t.Fatal("no want chain", gotChain.Type, gotChain.Name, gotChain.Hooknum) } + if gotRule.Table.Family != nat.Family { + t.Fatal("rule wrong family", gotRule.Table.Family, gotRule.Table.Name) + } if len(gotRule.Exprs) != len(rule.Exprs) { t.Fatal("no want rule") } diff --git a/util.go b/util.go index 4f03dc0..b040ae4 100644 --- a/util.go +++ b/util.go @@ -38,7 +38,7 @@ type NFGenMsg struct { } func (genmsg *NFGenMsg) Decode(b []byte) { - if len(b) < 16 { + if len(b) < 4 { return } genmsg.NFGenFamily = b[0]