summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/iptables_targets.go
diff options
context:
space:
mode:
authorGhanan Gowripalan <ghanan@google.com>2021-10-01 11:02:02 -0700
committergVisor bot <gvisor-bot@google.com>2021-10-01 11:05:14 -0700
commit8073370009aeccaffa7885ab073e630f644fafe6 (patch)
treef6f533af4517d61d3d06d3796d276ebbc995bb06 /pkg/tcpip/stack/iptables_targets.go
parent9d2d2f7592d180d79b8ec2dc7780522afb4c2361 (diff)
Let connection handle tracked packets
...to save a call to `ConnTrack.connFor` when callers already have a reference to the ConnTrack entry. PiperOrigin-RevId: 400244955
Diffstat (limited to 'pkg/tcpip/stack/iptables_targets.go')
-rw-r--r--pkg/tcpip/stack/iptables_targets.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/tcpip/stack/iptables_targets.go b/pkg/tcpip/stack/iptables_targets.go
index 8310645bf..949c44c9b 100644
--- a/pkg/tcpip/stack/iptables_targets.go
+++ b/pkg/tcpip/stack/iptables_targets.go
@@ -162,7 +162,7 @@ func (rt *RedirectTarget) Action(pkt *PacketBuffer, ct *ConnTrack, hook Hook, r
// packet of the connection comes here. Other packets will be
// manipulated in connection tracking.
if conn := ct.insertRedirectConn(pkt, hook, rt.Port, address); conn != nil {
- ct.handlePacket(pkt, hook, r)
+ conn.handlePacket(pkt, hook, dirOriginal, r)
}
default:
return RuleDrop, 0
@@ -213,7 +213,7 @@ func snatAction(pkt *PacketBuffer, ct *ConnTrack, hook Hook, r *Route, port uint
//
// Does nothing if the protocol does not support connection tracking.
if conn := ct.insertSNATConn(pkt, hook, port, address); conn != nil {
- ct.handlePacket(pkt, hook, r)
+ conn.handlePacket(pkt, hook, dirOriginal, r)
}
return RuleAccept, 0