summaryrefslogtreecommitdiffhomepage
path: root/runsc
diff options
context:
space:
mode:
authorBert Muthalaly <stijlist@google.com>2020-01-08 14:49:12 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-08 14:50:49 -0800
commite21c5840569155d39e8e11ac18cee99bc6d67469 (patch)
treef6a92aec3b9d8069ee02bf919cbab60bf25bbe4d /runsc
parenta271bccfc61390be64ca0175b8fc7d20e66d05b6 (diff)
Combine various Create*NIC methods into CreateNICWithOptions.
PiperOrigin-RevId: 288779416
Diffstat (limited to 'runsc')
-rw-r--r--runsc/boot/network.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/runsc/boot/network.go b/runsc/boot/network.go
index 0240fe323..6a8765ec8 100644
--- a/runsc/boot/network.go
+++ b/runsc/boot/network.go
@@ -219,8 +219,9 @@ func (n *Network) CreateLinksAndRoutes(args *CreateLinksAndRoutesArgs, _ *struct
// createNICWithAddrs creates a NIC in the network stack and adds the given
// addresses.
func (n *Network) createNICWithAddrs(id tcpip.NICID, name string, ep stack.LinkEndpoint, addrs []net.IP) error {
- if err := n.Stack.CreateNamedNIC(id, name, sniffer.New(ep)); err != nil {
- return fmt.Errorf("CreateNamedNIC(%v, %v, %v) failed: %v", id, name, ep, err)
+ opts := stack.NICOptions{Name: name}
+ if err := n.Stack.CreateNICWithOptions(id, sniffer.New(ep), opts); err != nil {
+ return fmt.Errorf("CreateNICWithOptions(%d, _, %+v) failed: %v", id, opts, err)
}
// Always start with an arp address for the NIC.