Skip to content

Reject duplicate static routes in an add request#761

Open
MorganaFuture wants to merge 1 commit into
oxidecomputer:mainfrom
MorganaFuture:reject-dup-static-routes
Open

Reject duplicate static routes in an add request#761
MorganaFuture wants to merge 1 commit into
oxidecomputer:mainfrom
MorganaFuture:reject-dup-static-routes

Conversation

@MorganaFuture
Copy link
Copy Markdown

The static routing API accepted multiple routes that share a (prefix, nexthop, vlan_id) but differ only in rib_priority, returned OK, then kept only one - rib_priority is not part of a path's RIB identity, so the entries collapse to a single path.

This validates an add request and returns HTTP 400 when two routes share a prefix and RIB path identity within the request, keying the check on the same Path identity the RIB uses. It covers duplicates within a single request; the deeper data-model change (a map keyed by the triple, enforced at deserialize) is left for a follow-up.

Tested with unit tests for the validator and the add path; ran the mgd suite.

Closes #739

The static routing API accepted multiple routes that share a
(prefix, nexthop, vlan_id) but differ only in rib_priority, returned
OK, then kept just one: rib_priority is not part of a path's RIB
identity, so the entries collapse to a single path.

Validate an add request and return HTTP 400 when two routes share a
prefix and RIB path identity within the request. The dedup keys on
the Path identity the RIB itself uses, so it stays in lockstep.

This covers duplicates within a single request; the deeper data-model
change (a map keyed by the triple, enforced at deserialize) is left
for a follow-up.

Closes oxidecomputer#739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mgd static routing API: restructure to reject nonsense path combinations?

1 participant