diff options
author | Ghanan Gowripalan <ghanan@google.com> | 2021-10-01 14:56:29 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-01 14:58:57 -0700 |
commit | 51c4fbb840b98380b4016bac030f0adbd5725d70 (patch) | |
tree | 3188ef03c5d1fbc0686c0ac77a3230cec8dc8724 /pkg/tcpip/stack/conntrack.go | |
parent | 6e83c4b751c60652247d0ebbe559261352b2131f (diff) |
Drop ConnTrack.handlePacket
Move the hook specific logic to the IPTables hook functions.
This lets us avoid having to perform checks on the hook to determine
what action to take.
Later changes will drop the need for handlePacket's return value,
reducing the value of this function that all hooks call into.
PiperOrigin-RevId: 400298023
Diffstat (limited to 'pkg/tcpip/stack/conntrack.go')
-rw-r--r-- | pkg/tcpip/stack/conntrack.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/pkg/tcpip/stack/conntrack.go b/pkg/tcpip/stack/conntrack.go index bd47f734f..79bc001c7 100644 --- a/pkg/tcpip/stack/conntrack.go +++ b/pkg/tcpip/stack/conntrack.go @@ -403,29 +403,6 @@ func insertConn(tupleBkt *bucket, replyBkt *bucket, conn *conn) { } } -// handlePacket will manipulate the port and address of the packet if the -// connection exists. Returns whether, after the packet traverses the tables, -// it should create a new entry in the table. -func (ct *ConnTrack) handlePacket(pkt *PacketBuffer, hook Hook, r *Route) bool { - switch hook { - case Prerouting, Input, Output, Postrouting: - default: - return false - } - - if conn, dir := ct.connFor(pkt); conn != nil { - conn.handlePacket(pkt, hook, dir, r) - return false - } - - // Connection not found for the packet. - // - // If this is the last hook in the data path for this packet (Input if - // incoming, Postrouting if outgoing), indicate that a connection should be - // inserted by the end of this hook. - return hook == Input || hook == Postrouting -} - func (cn *conn) handlePacket(pkt *PacketBuffer, hook Hook, dir direction, r *Route) { if pkt.NatDone { return |