Skip to content

Commit

Permalink
Fix UpdatePathAggregator4ByteAs() ignores 32bit value
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremiah Millay <jmillay@fastly.com>
  • Loading branch information
floatingstatic committed Jun 12, 2023
1 parent 0cc8a98 commit 79d301f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/pkg/table/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ func UpdatePathAggregator4ByteAs(msg *bgp.BGPUpdate) error {
if attr.Value.Askind == reflect.Uint16 {
aggAttr = attr
aggAttr.Value.Askind = reflect.Uint32
} else if attr.Value.Askind == reflect.Uint32 {
aggAttr = attr
}
case *bgp.PathAttributeAs4Aggregator:
agg4Attr = agg
Expand Down
6 changes: 5 additions & 1 deletion pkg/server/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,11 @@ func (h *fsmHandler) recvMessageWithError() (*fsmMsg, error) {
}
}

table.UpdatePathAttrs4ByteAs(h.fsm.logger, body)
if err = table.UpdatePathAttrs4ByteAs(h.fsm.logger, body); err != nil {
fmsg.MsgData = err
return fmsg, err
}

if err = table.UpdatePathAggregator4ByteAs(body); err != nil {
fmsg.MsgData = err
return fmsg, err
Expand Down

0 comments on commit 79d301f

Please sign in to comment.