Skip to content

Commit

Permalink
Fix PropExperimenter
Browse files Browse the repository at this point in the history
  • Loading branch information
jiho-jung committed Jan 11, 2025
1 parent 6245fcf commit df25eb5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openflow15/openflow15.go
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,9 @@ func (p *PropExperimenter) Len() uint16 {
l := uint16(len(p.Data) * 4)
n += l
//n += uint16((8 - (l % 8)) % 8) // pad to make multiple of 8
n += uint16(8 - (l % 8)) // pad to make multiple of 8
//n += uint16(8 - (l % 8)) // pad to make multiple of 8
n += uint16((8 - (n % 8)) % 8) // pad to make multiple of 8

return n
}

Expand Down Expand Up @@ -1547,7 +1549,7 @@ func (p *PropExperimenter) UnmarshalBinary(data []byte) (err error) {
p.ExpType = binary.BigEndian.Uint32(data[n:])
n += 4

for n < p.Header.Length+p.Header.Len() {
for n < p.Header.Length {
d := binary.BigEndian.Uint32(data[n:])
p.Data = append(p.Data, d)
n += 4
Expand Down

0 comments on commit df25eb5

Please sign in to comment.