Use inbound policy in TestXfrmPolicyWithOptional

Since kernel commit
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3d776e31c841b
optional tunnel/BEET mode templates in outbound policies are rejected.

Use an inbound policy instead to fix the test failure on newer kernels.
This commit is contained in:
Tobias Klauser 2023-10-24 13:17:40 +02:00 committed by Alessandro Boch
parent 586148b818
commit d18d70b0d9

View File

@ -1,3 +1,4 @@
//go:build linux
// +build linux // +build linux
package netlink package netlink
@ -195,6 +196,7 @@ func TestXfrmPolicyWithOptional(t *testing.T) {
defer setUpNetlinkTest(t)() defer setUpNetlinkTest(t)()
pol := getPolicy() pol := getPolicy()
pol.Dir = XFRM_DIR_IN
pol.Tmpls[0].Optional = 1 pol.Tmpls[0].Optional = 1
if err := XfrmPolicyAdd(pol); err != nil { if err := XfrmPolicyAdd(pol); err != nil {