Skip to content

BgpPeer::communities - use a set instead of a vec? #10138

@jgallagher

Description

@jgallagher

BgpPeer::communities is currently a Vec<u32>:

/// Include the provided communities in updates sent to the peer.
pub communities: Vec<u32>,

However, I think it would be more accurate to make this a BTreeSet<u32>:

  • Inserting and then reading back from the db does not preserve order
  • We don't expect duplicate values - if the Vec has duplicates in it, insertion will fail with an ObjectAlreadyExists error

(Like #10121, this came up while extending tests in support of the #9832 work.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions