Skip to content

Commit

Permalink
Apply reviewers suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
jiceatscion committed Nov 29, 2024
1 parent dfe7a6a commit b12d2ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 255 deletions.
250 changes: 0 additions & 250 deletions router/#connector.go#

This file was deleted.

2 changes: 1 addition & 1 deletion router/dataplane.go
Original file line number Diff line number Diff line change
Expand Up @@ -2297,7 +2297,7 @@ func updateSCIONLayer(rawPkt []byte, s slayers.SCION) error {
payloadOffset := len(rawPkt) - len(s.LayerPayload())

// Prepends must go just before payload. (and any Append will wreck it)
serBuf := newSerializeProxyOffset(rawPkt, payloadOffset)
serBuf := newSerializeProxyStart(rawPkt, payloadOffset)
return s.SerializeTo(&serBuf, gopacket.SerializeOptions{})
}

Expand Down
8 changes: 4 additions & 4 deletions router/serialize_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
type serializeProxy struct {

// The slice's offset can't be changed as that is irreversible.
// So we keep track separately from the slice.
// So we keep track of the prepend point separately from the slice.

restart int // the value to reset start to during Clear().
start int // current start of the useful data in the buffer.
Expand All @@ -39,12 +39,12 @@ type serializeProxy struct {
// end of the buffer in anticipation of AppendBytes never being used. The prepend/append point can
// be changed when calling clear().
func newSerializeProxy(buf []byte) serializeProxy {
return newSerializeProxyOffset(buf, cap(buf))
return newSerializeProxyStart(buf, cap(buf))
}

// newSerializeProxyOffset returns a new serializeProxy. The initial prepend/append point is set to
// newSerializeProxyStart returns a new serializeProxy. The initial prepend/append point is set to
// the given start value. This has the same effect as calling clear(statr).
func newSerializeProxyOffset(buf []byte, start int) serializeProxy {
func newSerializeProxyStart(buf []byte, start int) serializeProxy {
serBuf := serializeProxy{
data: buf,
}
Expand Down

0 comments on commit b12d2ee

Please sign in to comment.