Compare commits

..

2 Commits

Author SHA1 Message Date
turekt 7c56ab800c
Merge 58e70206d0 into 38e481bfc4 2024-08-14 19:03:55 +00:00
turekt 58e70206d0 Implement cthelper object expr 2024-08-14 21:02:49 +02:00
1 changed files with 2 additions and 8 deletions

View File

@ -1401,7 +1401,6 @@ func TestCtHelper(t *testing.T) {
Obj: &expr.CtHelper{ Obj: &expr.CtHelper{
Name: "ftp", Name: "ftp",
L4Proto: unix.IPPROTO_TCP, L4Proto: unix.IPPROTO_TCP,
L3Proto: unix.NFPROTO_IPV4,
}, },
}) })
@ -1432,13 +1431,8 @@ func TestCtHelper(t *testing.T) {
t.Errorf("c.GetObject(cthelp1) failed: %v failed", err) t.Errorf("c.GetObject(cthelp1) failed: %v failed", err)
} }
help := obj1.(*nftables.NamedObj).Obj.(*expr.CtHelper) if help := obj1.(*nftables.NamedObj).Obj.(*expr.CtHelper); help.L4Proto != unix.IPPROTO_TCP {
if got, want := help.L4Proto, uint8(unix.IPPROTO_TCP); got != want { t.Errorf("unexpected proto number: got %d, want %d", help.L4Proto, unix.IPPROTO_TCP)
t.Errorf("unexpected l4proto number: got %d, want %d", got, want)
}
if got, want := help.L3Proto, uint16(unix.NFPROTO_IPV4); got != want {
t.Errorf("unexpected l3proto number: got %d, want %d", got, want)
} }
} }