MCPcopy
hub / github.com/google/gvisor / SetNICName

Method SetNICName

pkg/tcpip/stack/stack.go:1140–1150  ·  view source on GitHub ↗

SetNICName sets a NIC's name.

(id tcpip.NICID, name string)

Source from the content-addressed store, hash-verified

1138
1139// SetNICName sets a NIC's name.
1140func (s *Stack) SetNICName(id tcpip.NICID, name string) tcpip.Error {
1141 s.mu.Lock()
1142 defer s.mu.Unlock()
1143
1144 nic, ok := s.nics[id]
1145 if !ok {
1146 return &tcpip.ErrUnknownNICID{}
1147 }
1148 nic.name = name
1149 return nil
1150}
1151
1152// SetNICMTU sets a NIC's MTU.
1153func (s *Stack) SetNICMTU(id tcpip.NICID, mtu uint32) tcpip.Error {

Callers 1

setLinkLockedMethod · 0.80

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected