MCPcopy Index your code
hub / github.com/google/gvisor / SetNICMTU

Method SetNICMTU

pkg/tcpip/stack/stack.go:1153–1163  ·  view source on GitHub ↗

SetNICMTU sets a NIC's MTU.

(id tcpip.NICID, mtu uint32)

Source from the content-addressed store, hash-verified

1151
1152// SetNICMTU sets a NIC's MTU.
1153func (s *Stack) SetNICMTU(id tcpip.NICID, mtu uint32) tcpip.Error {
1154 s.mu.Lock()
1155 defer s.mu.Unlock()
1156
1157 nic, ok := s.nics[id]
1158 if !ok {
1159 return &tcpip.ErrUnknownNICID{}
1160 }
1161 nic.NetworkLinkEndpoint.SetMTU(mtu)
1162 return nil
1163}
1164
1165// NICInfo captures the name and addresses assigned to a NIC.
1166type NICInfo struct {

Callers 1

setLinkLockedMethod · 0.80

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
SetMTUMethod · 0.65

Tested by

no test coverage detected