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

Method SetNICAddress

pkg/tcpip/stack/stack.go:1127–1137  ·  view source on GitHub ↗

SetNICAddress sets the hardware address which is identified by the nic ID.

(id tcpip.NICID, addr tcpip.LinkAddress)

Source from the content-addressed store, hash-verified

1125
1126// SetNICAddress sets the hardware address which is identified by the nic ID.
1127func (s *Stack) SetNICAddress(id tcpip.NICID, addr tcpip.LinkAddress) tcpip.Error {
1128 s.mu.Lock()
1129 defer s.mu.Unlock()
1130
1131 nic, ok := s.nics[id]
1132 if !ok {
1133 return &tcpip.ErrUnknownNICID{}
1134 }
1135 nic.NetworkLinkEndpoint.SetLinkAddress(addr)
1136 return nil
1137}
1138
1139// SetNICName sets a NIC's name.
1140func (s *Stack) SetNICName(id tcpip.NICID, name string) tcpip.Error {

Callers 1

setLinkLockedMethod · 0.80

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
SetLinkAddressMethod · 0.65

Tested by

no test coverage detected