mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Use tcpip.NICID when get/set-ing GRO timeout
PiperOrigin-RevId: 529535113
This commit is contained in:
committed by
gVisor bot
parent
0f2cdb3d9f
commit
8b0c4c6408
@@ -511,12 +511,12 @@ func (s *Stack) SetPortRange(start uint16, end uint16) error {
|
||||
}
|
||||
|
||||
// GROTimeout implements inet.Stack.GROTimeout.
|
||||
func (s *Stack) GROTimeout(NICID int32) (time.Duration, error) {
|
||||
timeout, err := s.Stack.GROTimeout(NICID)
|
||||
func (s *Stack) GROTimeout(nicID int32) (time.Duration, error) {
|
||||
timeout, err := s.Stack.GROTimeout(tcpip.NICID(nicID))
|
||||
return timeout, syserr.TranslateNetstackError(err).ToError()
|
||||
}
|
||||
|
||||
// SetGROTimeout implements inet.Stack.SetGROTimeout.
|
||||
func (s *Stack) SetGROTimeout(NICID int32, timeout time.Duration) error {
|
||||
return syserr.TranslateNetstackError(s.Stack.SetGROTimeout(NICID, timeout)).ToError()
|
||||
func (s *Stack) SetGROTimeout(nicID int32, timeout time.Duration) error {
|
||||
return syserr.TranslateNetstackError(s.Stack.SetGROTimeout(tcpip.NICID(nicID), timeout)).ToError()
|
||||
}
|
||||
|
||||
@@ -710,11 +710,11 @@ func (s *Stack) SetPortRange(start uint16, end uint16) tcpip.Error {
|
||||
}
|
||||
|
||||
// GROTimeout returns the GRO timeout.
|
||||
func (s *Stack) GROTimeout(NICID int32) (time.Duration, tcpip.Error) {
|
||||
func (s *Stack) GROTimeout(nicID tcpip.NICID) (time.Duration, tcpip.Error) {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
|
||||
nic, ok := s.nics[tcpip.NICID(NICID)]
|
||||
nic, ok := s.nics[nicID]
|
||||
if !ok {
|
||||
return 0, &tcpip.ErrUnknownNICID{}
|
||||
}
|
||||
@@ -723,11 +723,11 @@ func (s *Stack) GROTimeout(NICID int32) (time.Duration, tcpip.Error) {
|
||||
}
|
||||
|
||||
// SetGROTimeout sets the GRO timeout.
|
||||
func (s *Stack) SetGROTimeout(NICID int32, timeout time.Duration) tcpip.Error {
|
||||
func (s *Stack) SetGROTimeout(nicID tcpip.NICID, timeout time.Duration) tcpip.Error {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
|
||||
nic, ok := s.nics[tcpip.NICID(NICID)]
|
||||
nic, ok := s.nics[nicID]
|
||||
if !ok {
|
||||
return &tcpip.ErrUnknownNICID{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user