diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-07-15 21:19:41 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-15 21:19:41 +0000 |
commit | bb4615b663db81e5bd035c50661080d6645ac717 (patch) | |
tree | 4618e56ef3e5411174428c0dce3cf729ec888ebe /pkg/tcpip/link/tun | |
parent | f7dca07b3a30d251c0b187ce3e600b7b3cda14e4 (diff) | |
parent | fef90c61c6186c113cfdb0bbcf53f4ca70f9741a (diff) |
Merge release-20200622.1-162-gfef90c61c (automated)
Diffstat (limited to 'pkg/tcpip/link/tun')
-rw-r--r-- | pkg/tcpip/link/tun/device.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/tcpip/link/tun/device.go b/pkg/tcpip/link/tun/device.go index 6bc9033d0..47446efec 100644 --- a/pkg/tcpip/link/tun/device.go +++ b/pkg/tcpip/link/tun/device.go @@ -139,6 +139,7 @@ func attachOrCreateNIC(s *stack.Stack, name, prefix string, linkCaps stack.LinkE stack: s, nicID: id, name: name, + isTap: prefix == "tap", } endpoint.Endpoint.LinkEPCapabilities = linkCaps if endpoint.name == "" { @@ -348,6 +349,7 @@ type tunEndpoint struct { stack *stack.Stack nicID tcpip.NICID name string + isTap bool } // DecRef decrements refcount of e, removes NIC if refcount goes to 0. @@ -356,3 +358,11 @@ func (e *tunEndpoint) DecRef() { e.stack.RemoveNIC(e.nicID) }) } + +// ARPHardwareType implements stack.LinkEndpoint.ARPHardwareType. +func (e *tunEndpoint) ARPHardwareType() header.ARPHardwareType { + if e.isTap { + return header.ARPHardwareEther + } + return header.ARPHardwareNone +} |