Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/packet/pcep/tlv.go
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ func (tlv *PathSetupTypeCapability) DecodeFromBytes(data []byte) error {
pstNum := int(value[PathSetupTypeCapabilityPSTCountOffset])

tlv.PathSetupTypes = make([]Pst, 0, pstNum)
for i := 0; i < pstNum; i++ {
for i := range pstNum {
offset := PathSetupTypeCapabilityFixedPartLength + i
if offset >= len(value) {
return fmt.Errorf("PathSetupTypeCapability: value too short for PathSetupTypes entries")
Expand Down Expand Up @@ -1090,7 +1090,7 @@ func (tlv *PathSetupTypeCapability) Serialize() []byte {
value := make([]byte, fixedPartLen)
value[PathSetupTypeCapabilityPSTCountOffset] = byte(pstCount)

for i := 0; i < pstCount; i++ {
for i := range pstCount {
value[PathSetupTypeCapabilityFixedPartLength+i] =
byte(tlv.PathSetupTypes[i])
}
Expand Down Expand Up @@ -1215,7 +1215,7 @@ func (tlv *AssocTypeList) DecodeFromBytes(data []byte) error {

assocNum := len(value) / 2
tlv.AssocTypes = make([]AssocType, assocNum)
for i := 0; i < assocNum; i++ {
for i := range assocNum {
tlv.AssocTypes[i] = AssocType(binary.BigEndian.Uint16(value[2*i : 2*i+2]))
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/packet/pcep/tlv_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func isIPv4Bytes(b []byte) bool {
if len(b) != IPv6AddrLen {
return false
}
for i := 0; i < IPv4InIPv6Offset; i++ {
for i := range IPv4InIPv6Offset {
if b[i] != 0 {
return false
}
Expand Down
Loading
Loading