summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/stack.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-01-16 01:23:10 +0000
committergVisor bot <gvisor-bot@google.com>2020-01-16 01:23:10 +0000
commit8051a5e7c093b87ce9ccf650961768711958be03 (patch)
treeb3196839fa6455b232567f7ce492bc3b82935d44 /pkg/tcpip/stack/stack.go
parent6a9b381a93e88b8ecc681cc0f92a810dbcc58e7d (diff)
parent815df2959a76e4a19f5882e40402b9bbca9e70be (diff)
Merge release-20200115.0-3-g815df29 (automated)
Diffstat (limited to 'pkg/tcpip/stack/stack.go')
-rw-r--r--pkg/tcpip/stack/stack.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go
index 386eb6eec..fc56a6d79 100644
--- a/pkg/tcpip/stack/stack.go
+++ b/pkg/tcpip/stack/stack.go
@@ -750,7 +750,9 @@ func (s *Stack) Stats() tcpip.Stats {
// SetForwarding enables or disables the packet forwarding between NICs.
//
// When forwarding becomes enabled, any host-only state on all NICs will be
-// cleaned up.
+// cleaned up and if IPv6 is enabled, NDP Router Solicitations will be started.
+// When forwarding becomes disabled and if IPv6 is enabled, NDP Router
+// Solicitations will be stopped.
func (s *Stack) SetForwarding(enable bool) {
// TODO(igudger, bgeffon): Expose via /proc/sys/net/ipv4/ip_forward.
s.mu.Lock()
@@ -772,6 +774,10 @@ func (s *Stack) SetForwarding(enable bool) {
for _, nic := range s.nics {
nic.becomeIPv6Router()
}
+ } else {
+ for _, nic := range s.nics {
+ nic.becomeIPv6Host()
+ }
}
}