summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/nic.go
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2020-01-07 10:07:59 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-07 10:09:39 -0800
commit2031cc4701d5bfd21b34d7b0f7dc86920a553385 (patch)
tree40da52ce2b5e35a24ac5c94a74422d7d7e5d3796 /pkg/tcpip/stack/nic.go
parented60bc326b7479995fee4a94d29cbc7d9dddef02 (diff)
Disable auto-generation of IPv6 link-local addresses for loopback NICs
Test: Test that an IPv6 link-local address is not auto-generated for loopback NICs, even when it is enabled for non-loopback NICS. PiperOrigin-RevId: 288519591
Diffstat (limited to 'pkg/tcpip/stack/nic.go')
-rw-r--r--pkg/tcpip/stack/nic.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/nic.go b/pkg/tcpip/stack/nic.go
index 044fe5298..523c2a699 100644
--- a/pkg/tcpip/stack/nic.go
+++ b/pkg/tcpip/stack/nic.go
@@ -174,7 +174,8 @@ func (n *NIC) enable() *tcpip.Error {
return err
}
- if !n.stack.autoGenIPv6LinkLocal {
+ // Do not auto-generate an IPv6 link-local address for loopback devices.
+ if !n.stack.autoGenIPv6LinkLocal || n.loopback {
return nil
}