From 13b5cc71d7436b07f62886bb47f710cd7b8c65d1 Mon Sep 17 00:00:00 2001 From: xjasonlyu Date: Tue, 1 Feb 2022 17:19:51 +0800 Subject: [PATCH] Improve(stack): specify NIC options --- core/stack/nic.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/stack/nic.go b/core/stack/nic.go index 5c4ec73..f57844c 100644 --- a/core/stack/nic.go +++ b/core/stack/nic.go @@ -23,7 +23,14 @@ const ( // withCreatingNIC creates NIC for stack. func withCreatingNIC(ep stack.LinkEndpoint) Option { return func(s *Stack) error { - if err := s.CreateNIC(s.nicID, ep); err != nil { + if err := s.CreateNICWithOptions(s.nicID, ep, + stack.NICOptions{ + Disabled: false, + // If no queueing discipline was specified + // provide a stub implementation that just + // delegates to the lower link endpoint. + QDisc: nil, + }); err != nil { return fmt.Errorf("create NIC: %s", err) } return nil