summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/network
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2020-09-29 13:44:03 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-29 13:45:36 -0700
commit1d88bce55e0c8ef77e31863d264b896493dce90f (patch)
treeb063630e5349849367a11acf55509e29777e63b3 /pkg/tcpip/network
parent994c90e2d2dc3806350f1635839f601e2fac5bb6 (diff)
Don't generate link-local IPv6 for loopback
Linux doesn't generate a link-local address for the loopback interface. Test: integration_test.TestInitialLoopbackAddresses PiperOrigin-RevId: 334453182
Diffstat (limited to 'pkg/tcpip/network')
-rw-r--r--pkg/tcpip/network/ipv6/ipv6.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/tcpip/network/ipv6/ipv6.go b/pkg/tcpip/network/ipv6/ipv6.go
index 990e67210..e74160aa8 100644
--- a/pkg/tcpip/network/ipv6/ipv6.go
+++ b/pkg/tcpip/network/ipv6/ipv6.go
@@ -258,7 +258,7 @@ func (e *endpoint) Enable() *tcpip.Error {
}
// Do not auto-generate an IPv6 link-local address for loopback devices.
- if e.protocol.autoGenIPv6LinkLocal {
+ if e.protocol.autoGenIPv6LinkLocal && !e.nic.IsLoopback() {
// The valid and preferred lifetime is infinite for the auto-generated
// link-local address.
e.mu.ndp.doSLAAC(header.IPv6LinkLocalPrefix.Subnet(), header.NDPInfiniteLifetime, header.NDPInfiniteLifetime)