Skip to content

server: reject a next-hop action with more than one option - #4002

Open
martonra wants to merge 1 commit into
osrg:masterfrom
martonra:server-nexthop-action-exclusive
Open

martonra wants to merge 1 commit into
osrg:masterfrom
martonra:server-nexthop-action-exclusive

Conversation

@martonra

@martonra martonra commented Dec 2, 2026

Copy link
Copy Markdown

The API NexthopAction has four fields: address, self, unchanged and peer_address. table.NexthopAction holds only one of them, as the set-next-hop configuration (oc.BgpNextHopType) does. newNexthopActionFromApiStruct picks self, then unchanged, then peer-address, then the address, and drops the others without an error. A caller that sets more than one gets a next hop that it may not expect, and ListStatement returns only the one that is applied.

Return an error instead, as newPrefixFromApiStruct does for ip-prefix and rtc-prefix.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com

The API NexthopAction has four fields: address, self, unchanged and
peer_address. table.NexthopAction holds only one of them, as the
set-next-hop configuration (oc.BgpNextHopType) does.
newNexthopActionFromApiStruct picks self, then unchanged, then
peer-address, then the address, and drops the others without an error.
A caller that sets more than one gets a next hop that it may not expect,
and ListStatement returns only the one that is applied.

Return an error instead, as newPrefixFromApiStruct does for ip-prefix
and rtc-prefix.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Marton Rasek <mrasek@isovalent.com>

This branch has not been deployed

No deployments
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.

1 participant