diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-10-09 16:14:24 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-09 16:14:24 +0000 |
commit | 48606fbf85c7b5e9884a9a212e918283c16a1903 (patch) | |
tree | 623898f35a6bcad0ac77c79b34e91dfb226daddf /pkg/sentry/devices/tundev | |
parent | 13c73e720fabd96f6fa8778df197e7027e9cad2c (diff) | |
parent | 8566decab094008d5f873cb679c972d5d60cc49a (diff) |
Merge release-20200928.0-74-g8566decab (automated)
Diffstat (limited to 'pkg/sentry/devices/tundev')
-rw-r--r-- | pkg/sentry/devices/tundev/tundev.go | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/pkg/sentry/devices/tundev/tundev.go b/pkg/sentry/devices/tundev/tundev.go index 655ea549b..0b701a289 100644 --- a/pkg/sentry/devices/tundev/tundev.go +++ b/pkg/sentry/devices/tundev/tundev.go @@ -16,8 +16,6 @@ package tundev import ( - "fmt" - "gvisor.dev/gvisor/pkg/abi/linux" "gvisor.dev/gvisor/pkg/context" "gvisor.dev/gvisor/pkg/sentry/arch" @@ -28,7 +26,6 @@ import ( "gvisor.dev/gvisor/pkg/sentry/vfs" "gvisor.dev/gvisor/pkg/syserror" "gvisor.dev/gvisor/pkg/tcpip/link/tun" - "gvisor.dev/gvisor/pkg/tcpip/network/arp" "gvisor.dev/gvisor/pkg/usermem" "gvisor.dev/gvisor/pkg/waiter" ) @@ -87,16 +84,7 @@ func (fd *tunFD) Ioctl(ctx context.Context, uio usermem.IO, args arch.SyscallArg return 0, err } flags := usermem.ByteOrder.Uint16(req.Data[:]) - created, err := fd.device.SetIff(stack.Stack, req.Name(), flags) - if err == nil && created { - // Always start with an ARP address for interfaces so they can handle ARP - // packets. - nicID := fd.device.NICID() - if err := stack.Stack.AddAddress(nicID, arp.ProtocolNumber, arp.ProtocolAddress); err != nil { - panic(fmt.Sprintf("failed to add ARP address after creating new TUN/TAP interface with ID = %d", nicID)) - } - } - return 0, err + return 0, fd.device.SetIff(stack.Stack, req.Name(), flags) case linux.TUNGETIFF: var req linux.IFReq |