Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nexthop group AFI calculation #17049

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pguibert6WIND
Copy link
Member

Let us set up the AFI calculation at ZAPI level.

This small rework prepares next commit.

Signed-off-by: Philippe Guibert <[email protected]>
A protocol nexthop group with multiple nexthop may have
an undefined AFI value.

> ubuntu2204hwe(config)# nexthop-group A
> ubuntu2204hwe(config-nh-group)# nexthop 10.0.2.150 mgmt0
> ubuntu2204hwe(config-nh-group)# do show nexthop-group rib sharp
> ID: 181818168 (sharp)
>      RefCnt: 1
>      Uptime: 00:00:06
>      VRF: default(IPv4)
>      Valid, Installed
>      Depends: (13)
>            via 10.0.2.150, mgmt0 (vrf default), weight 1
> ID: 13 (sharp)
>      RefCnt: 2
>      Uptime: 00:00:06
>      VRF: default(IPv4)
>      Valid, Installed
>      Interface Index: 2
>            via 10.0.2.150, mgmt0 (vrf default), weight 1
>      Dependents: (181818168)
> ubuntu2204hwe(config-nh-group)# nexthop 10.0.2.155 mgmt0
> ubuntu2204hwe(config-nh-group)# do show nexthop-group rib sharp
> ID: 181818168 (sharp)
>      RefCnt: 1
>      Uptime: 00:00:02
>      VRF: default(bad-value)				<---- (AFI_UNSPEC)
>      Valid, Installed
>      Depends: (13) (14)
>            via 10.0.2.150, mgmt0 (vrf default), weight 1
>            via 10.0.2.155, mgmt0 (vrf default), weight 1
> ID: 13 (sharp)
>      RefCnt: 2
>      Uptime: 00:00:02
>      VRF: default(IPv4)
>      Valid, Installed
>      Interface Index: 2
>            via 10.0.2.150, mgmt0 (vrf default), weight 1
>      Dependents: (181818168)
> ID: 14 (sharp)
>      RefCnt: 2
>      Uptime: 00:00:02
>      VRF: default(IPv4)
>      Valid, Installed
>      Interface Index: 2
>            via 10.0.2.155, mgmt0 (vrf default), weight 1
>      Dependents: (181818168)

On the creation of a nexthop-group, check the afi value for
all the nexthops of that nexthop-group. Check that the value
is the same, cancel the nexthop-group add otherwise.

Signed-off-by: Mark Stapp <[email protected]>
Signed-off-by: Philippe Guibert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant