Fix UpdatePathAggregator4ByteAs() ignores 32bit value #2667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed that the
UpdatePathAggregator4ByteAs()
function is returning an error related to malformed attribute list error:A path that triggered this looked something like:
We can see in the above the
Aggregate.AS
was134911
which falls into 32-bit space, but we were only setting the aggregator in cases where the kind was a uint16 here:gobgp/internal/pkg/table/message.go
Lines 240 to 243 in 0cc8a98
And as a result we end up matching this condition and sending a notification:
gobgp/internal/pkg/table/message.go
Lines 253 to 255 in 0cc8a98
This change corrects this to validate the aggregator in cases where aggregator is a 32bit value.
Additionally as I was stepping through the FSM logic I noticed that
table.UpdatePathAttrs4ByteAs()
returns an error but we do not check the value of the error. So additionally I am adding a small fix to correct that.