diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-03-16 19:06:24 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-16 19:06:24 +0000 |
commit | 0f83bce9c35d05bdd6ef82a771a999c3deab62ca (patch) | |
tree | 94e35938f757410d04dfb26175edbc6e82e792ad /pkg/tcpip/link/tun | |
parent | f364c384715dba6d78df15b7d5229d7d6772ab34 (diff) | |
parent | 69da42885aff9371fd53227583a546df914de02b (diff) |
Merge release-20200219.0-182-g69da428 (automated)
Diffstat (limited to 'pkg/tcpip/link/tun')
-rwxr-xr-x | pkg/tcpip/link/tun/device.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/tcpip/link/tun/device.go b/pkg/tcpip/link/tun/device.go index 6ff47a742..f6e301304 100755 --- a/pkg/tcpip/link/tun/device.go +++ b/pkg/tcpip/link/tun/device.go @@ -98,7 +98,12 @@ func (d *Device) SetIff(s *stack.Stack, name string, flags uint16) error { prefix = "tap" } - endpoint, err := attachOrCreateNIC(s, name, prefix) + linkCaps := stack.CapabilityNone + if isTap { + linkCaps |= stack.CapabilityResolutionRequired + } + + endpoint, err := attachOrCreateNIC(s, name, prefix, linkCaps) if err != nil { return syserror.EINVAL } @@ -109,7 +114,7 @@ func (d *Device) SetIff(s *stack.Stack, name string, flags uint16) error { return nil } -func attachOrCreateNIC(s *stack.Stack, name, prefix string) (*tunEndpoint, error) { +func attachOrCreateNIC(s *stack.Stack, name, prefix string, linkCaps stack.LinkEndpointCapabilities) (*tunEndpoint, error) { for { // 1. Try to attach to an existing NIC. if name != "" { @@ -135,6 +140,7 @@ func attachOrCreateNIC(s *stack.Stack, name, prefix string) (*tunEndpoint, error nicID: id, name: name, } + endpoint.Endpoint.LinkEPCapabilities = linkCaps if endpoint.name == "" { endpoint.name = fmt.Sprintf("%s%d", prefix, id) } |