[BGPCEP-947] BGP update message attributes parse failed, when message contains unrecognized attribute type Created: 04/Mar/21  Updated: 04/Mar/21

Status: Open
Project: bgpcep
Component/s: BGP
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: High
Reporter: Kirill Egorov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Unrecognized BGP attributes accumulated and propagated into next BGP update messages.

When BGP update messages contain unrecognized attributes, they are accumulated in the org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleAttributeRegistry and parsing process is failed with exception like following:

Could not parse BGP attributes. Caused by: java.lang.IllegalArgumentException: Multiple entries with same key: UnrecognizedAttributesKey{_type=32}=UnrecognizedAttributes{_type=32, _value=[*], _partial=true, _transitive=true, augmentation=[]} and UnrecognizedAttributesKey{_type=32}=UnrecognizedAttributes{_type=32, _value=[*], _partial=true, _transitive=true, augmentation=[]}. To index multiple values under a key, use Multimaps.index.

This happens due to org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleAttributeRegistry#unrecognizedAttributes list has to be local variable or flushed between messages parsing.

 

Also the library doesn't support duplicate attributes: unrecognized or recognized.

Unrecognized attributes can't be duplicated due to AttributesBuilder doesn't allow unrecognizedAttributes with same keys (doesn't use mulimap).

Recognized attributes can't be duplicated, due to SimpleAttributeRegistry doesn't ignore duplicate attributes correctly: attribute skipped, but bytes aren't. So next attribute is read from the incorrect byte buffer position.

 

org.opendaylight.bgpcep:bgp-parser-spi:0.14.1


Generated at Wed Feb 07 19:14:33 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.