Skip to content

Commit

Permalink
fw: don't copy pit token
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Feb 3, 2025
1 parent 2e581c0 commit a818f6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
1 change: 0 additions & 1 deletion fw/defn/pkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type Pkt struct {

PitToken []byte
CongestionMark enc.Optional[uint64]
CachePolicy *uint64

IncomingFaceID uint64
NextHopFaceID enc.Optional[uint64]
Expand Down
14 changes: 3 additions & 11 deletions fw/face/ndnlp-link-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
defn "github.com/named-data/ndnd/fw/defn"
"github.com/named-data/ndnd/fw/dispatch"
enc "github.com/named-data/ndnd/std/encoding"
"github.com/named-data/ndnd/std/utils"
)

const lpPacketOverhead = 1 + 3 + 1 + 3 // LpPacket+Fragment
Expand Down Expand Up @@ -336,16 +335,9 @@ func (l *NDNLPLinkService) handleIncomingFrame(frame []byte) {
pkt.NextHopFaceID = LP.NextHopFaceId
}

// Local cache policy
if l.options.IsLocalCachePolicyEnabled && LP.CachePolicy != nil {
pkt.CachePolicy = utils.IdPtr(LP.CachePolicy.CachePolicyType)
}

// PIT Token
if len(LP.PitToken) > 0 {
pkt.PitToken = make([]byte, len(LP.PitToken))
copy(pkt.PitToken, LP.PitToken)
}
// No need to copy the pit token since it's already in its own buffer
// See the generated code for defn.FwLpPacket
pkt.PitToken = LP.PitToken

// Parse inner packet in place
L3, err := defn.ParseFwPacket(enc.NewWireView(fragment), false)
Expand Down

0 comments on commit a818f6a

Please sign in to comment.