diff --git a/example_test.go b/example_test.go index a866875..0c5c8e0 100644 --- a/example_test.go +++ b/example_test.go @@ -9,6 +9,7 @@ import ( "time" nfqueue "github.com/florianl/go-nfqueue" + "github.com/mdlayher/netlink" ) func ExampleNfqueue_RegisterWithErrorFunc() { @@ -31,6 +32,13 @@ func ExampleNfqueue_RegisterWithErrorFunc() { } defer nf.Close() + // Avoid receiving ENOBUFS errors. + if err := nf.SetOption(netlink.NoENOBUFS, true); err != nil { + fmt.Printf("failed to set netlink option %v: %v\n", + netlink.NoENOBUFS, err) + return + } + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel()