vflow icon indicating copy to clipboard operation
vflow copied to clipboard

Fix mirror unit test buffer panic.

Open hanlhe opened this issue 3 years ago • 0 comments

This PR fixes the panic when running the unit test TestMirrorIPFIX by setting the default value for IPFIXUDPSize.

=== RUN   TestMirrorIPFIX
panic: runtime error: slice bounds out of range [:20] with capacity 0

goroutine 20 [running]:
github.com/EdgeCast/vflow/vflow.mirrorIPFIX({0xc0000a0240, 0x10, 0x10}, 0x2728, 0x0)
        /vflow/vflow/ipfix_unix.go:112 +0x6b5
github.com/EdgeCast/vflow/vflow.TestMirrorIPFIX.func1()
        /vflow/vflow/ipfix_test.go:45 +0x45
created by github.com/EdgeCast/vflow/vflow.TestMirrorIPFIX
        /vflow/vflow/ipfix_test.go:44 +0x12f
FAIL    github.com/EdgeCast/vflow/vflow 2.039s
FAIL
make: *** [test] Error 1

hanlhe avatar May 31 '22 21:05 hanlhe