Skip to content

Commit

Permalink
Use inbound policy in TestXfrmPolicyWithOptional
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tklauser authored and aboch committed Oct 24, 2023
1 parent 586148b commit d18d70b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xfrm_policy_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package netlink
Expand Down Expand Up @@ -195,6 +196,7 @@ func TestXfrmPolicyWithOptional(t *testing.T) {
defer setUpNetlinkTest(t)()

pol := getPolicy()
pol.Dir = XFRM_DIR_IN
pol.Tmpls[0].Optional = 1

if err := XfrmPolicyAdd(pol); err != nil {
Expand Down

0 comments on commit d18d70b

Please sign in to comment.