diff options
author | Matt Layher <mlayher@fastly.com> | 2021-08-25 10:54:26 -0400 |
---|---|---|
committer | Matt Layher <mlayher@fastly.com> | 2021-08-25 10:54:26 -0400 |
commit | fc1a1899870a7a700782a08f1087f41fc645297c (patch) | |
tree | 25b68230cc0d93a98af80fbe9898663a1ce04275 | |
parent | 14b7bebfde4505b00701451427d6271cc266163b (diff) |
pkg/packet/bgp: avoid copying PrefixDefault lock in Test_CompareFlowSpecNLRI
Signed-off-by: Matt Layher <mlayher@fastly.com>
-rw-r--r-- | pkg/packet/bgp/bgp_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/packet/bgp/bgp_test.go b/pkg/packet/bgp/bgp_test.go index fd14aff7..720a80e8 100644 --- a/pkg/packet/bgp/bgp_test.go +++ b/pkg/packet/bgp/bgp_test.go @@ -771,20 +771,20 @@ func Test_CompareFlowSpecNLRI(t *testing.T) { cmp, err := ParseFlowSpecComponents(RF_FS_IPv4_UC, "destination 10.0.0.2/32 source 10.0.0.1/32 destination-port ==3128 protocol tcp") assert.Nil(err) // Note: Use NewFlowSpecIPv4Unicast() for the consistent ordered rules. - n1 := NewFlowSpecIPv4Unicast(cmp).FlowSpecNLRI + n1 := &NewFlowSpecIPv4Unicast(cmp).FlowSpecNLRI cmp, err = ParseFlowSpecComponents(RF_FS_IPv4_UC, "source 10.0.0.0/24 destination-port ==3128 protocol tcp") assert.Nil(err) - n2 := NewFlowSpecIPv4Unicast(cmp).FlowSpecNLRI - r, err := CompareFlowSpecNLRI(&n1, &n2) + n2 := &NewFlowSpecIPv4Unicast(cmp).FlowSpecNLRI + r, err := CompareFlowSpecNLRI(n1, n2) assert.Nil(err) assert.True(r > 0) cmp, err = ParseFlowSpecComponents(RF_FS_IPv4_UC, "source 10.0.0.9/32 port ==80 ==8080 destination-port >8080&<8080 ==3128 source-port >1024 protocol ==udp ==tcp") - n3 := NewFlowSpecIPv4Unicast(cmp).FlowSpecNLRI + n3 := &NewFlowSpecIPv4Unicast(cmp).FlowSpecNLRI assert.Nil(err) cmp, err = ParseFlowSpecComponents(RF_FS_IPv4_UC, "destination 192.168.0.2/32") - n4 := NewFlowSpecIPv4Unicast(cmp).FlowSpecNLRI + n4 := &NewFlowSpecIPv4Unicast(cmp).FlowSpecNLRI assert.Nil(err) - r, err = CompareFlowSpecNLRI(&n3, &n4) + r, err = CompareFlowSpecNLRI(n3, n4) assert.Nil(err) assert.True(r < 0) } |