diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-04-10 04:15:39 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-10 04:15:39 +0000 |
commit | c3865938b55782b5c33f36e6e03b63971753cda1 (patch) | |
tree | 1bc48d528bc9046496d5c69057d270bca8ff389c /pkg/tcpip/stack/packet_buffer.go | |
parent | f3f5f4c1e5bdd6d9340b3349beaae668f970ab07 (diff) | |
parent | d1edabdca016b9d80295855a3ce6d2816486d65c (diff) |
Merge release-20210408.0-17-gd1edabdca (automated)
Diffstat (limited to 'pkg/tcpip/stack/packet_buffer.go')
-rw-r--r-- | pkg/tcpip/stack/packet_buffer.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/tcpip/stack/packet_buffer.go b/pkg/tcpip/stack/packet_buffer.go index 8f288675d..c10304d5f 100644 --- a/pkg/tcpip/stack/packet_buffer.go +++ b/pkg/tcpip/stack/packet_buffer.go @@ -299,9 +299,18 @@ func (pk *PacketBuffer) Network() header.Network { // See PacketBuffer.Data for details about how a packet buffer holds an inbound // packet. func (pk *PacketBuffer) CloneToInbound() *PacketBuffer { - return NewPacketBuffer(PacketBufferOptions{ + newPk := NewPacketBuffer(PacketBufferOptions{ Data: buffer.NewVectorisedView(pk.Size(), pk.Views()), }) + // TODO(gvisor.dev/issue/5696): reimplement conntrack so that no need to + // maintain this flag in the packet. Currently conntrack needs this flag to + // tell if a noop connection should be inserted at Input hook. Once conntrack + // redefines the manipulation field as mutable, we won't need the special noop + // connection. + if pk.NatDone { + newPk.NatDone = true + } + return newPk } // headerInfo stores metadata about a header in a packet. |