Skip to content
Snippets Groups Projects
Unverified Commit 3c309824 authored by Daniel Czerwonk's avatar Daniel Czerwonk Committed by GitHub
Browse files

Update path_attributes.go

parent efaf0b28
No related branches found
No related tags found
No related merge requests found
...@@ -252,16 +252,11 @@ func (pa *PathAttribute) decodeCommunities(buf *bytes.Buffer) error { ...@@ -252,16 +252,11 @@ func (pa *PathAttribute) decodeCommunities(buf *bytes.Buffer) error {
coms := make([]uint32, count) coms := make([]uint32, count)
for i := uint16(0); i < count; i++ { for i := uint16(0); i < count; i++ {
c := [CommunityLen]byte{} v, err = read4BytesAsUin32(buf)
n, err := buf.Read(c[:]) + if err != nil {
if err != nil { + return err
return err + }
} coms[i] = v
if n != 4 {
return fmt.Errorf("Unable to read next hop: buf.Read read %d bytes", n)
}
coms[i] = fourBytesToUint32(c)
} }
pa.Value = coms pa.Value = coms
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment