summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-08-28 17:38:35 +0000
committergVisor bot <gvisor-bot@google.com>2020-08-28 17:38:35 +0000
commit13af2e0237db4e6d1752a6cbfbc0d6fff17cf920 (patch)
tree31f3cfaaea044920c139990682ea6dccfd575dac /pkg/tcpip
parent936e08d2cba395c819d4c4466051732760a37bf3 (diff)
parentb3ff31d041c9455614a2a9f2a7be10afb6613357 (diff)
Merge release-20200818.0-81-gb3ff31d04 (automated)
Diffstat (limited to 'pkg/tcpip')
-rw-r--r--pkg/tcpip/stack/iptables.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/iptables.go b/pkg/tcpip/stack/iptables.go
index 30aa41db2..0e33cbe92 100644
--- a/pkg/tcpip/stack/iptables.go
+++ b/pkg/tcpip/stack/iptables.go
@@ -427,5 +427,10 @@ func (it *IPTables) checkRule(hook Hook, pkt *PacketBuffer, table Table, ruleIdx
// OriginalDst returns the original destination of redirected connections. It
// returns an error if the connection doesn't exist or isn't redirected.
func (it *IPTables) OriginalDst(epID TransportEndpointID) (tcpip.Address, uint16, *tcpip.Error) {
+ it.mu.RLock()
+ defer it.mu.RUnlock()
+ if !it.modified {
+ return "", 0, tcpip.ErrNotConnected
+ }
return it.connections.originalDst(epID)
}