Skip to content

address_lot_block_id in BgpAnnouncement set to announce set ID instead of address lot block ID #9642

@sudomateo

Description

@sudomateo

While looking how to expand an IP pool on an Oxide rack I noticed that both the bgp_create_announce_set and bgp_update_announce_set functions set address_lot_block_id to bas.identity.id, which is the announce set's ID instead of the address lot block ID.

let an = BgpAnnouncement {
announce_set_id: db_as.id(),
address_lot_block_id: bas.identity.id,
network: a.network.into(),
};

The external API expects the user to pass address_lot_block, which confused me since I was looking to do a read, modify, write cycle on an announce set to update it with a new network and leave the existing networks alone.

/// A BGP announcement tied to a particular address lot block.
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
pub struct BgpAnnouncementCreate {
/// Address lot this announcement is drawn from.
pub address_lot_block: NameOrId,
/// The network being announced.
pub network: IpNet,
}

From what I could tell this address lot block ID is ignored entirely. Is this a bug that should instead be resolving the actual address block ID?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions