Skip to content

packet/mrt: Add Family argument to NewRib #3069

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fujita
Copy link
Member

@fujita fujita commented Aug 2, 2025

Add Family argument to NewRib function in order to avoid getting Family from NLRI. The NLRI type and Family do not have a one-to-one correspondence, we can only obtain an incomplete value for Family.

Add Family argument to NewRib function in order to avoid getting
Family from NLRI. The NLRI type and Family do not have a one-to-one
correspondence, we can only obtain an incomplete value for Family.

Signed-off-by: FUJITA Tomonori <[email protected]>
@@ -187,7 +187,7 @@ func TestMrtRib(t *testing.T) {
e2 := NewRibEntry(2, uint32(time.Now().Unix()), 0, p, false)
e3 := NewRibEntry(3, uint32(time.Now().Unix()), 0, p, false)

r1 := NewRib(1, bgp.NewIPAddrPrefix(24, "192.168.0.0"), []*RibEntry{e1, e2, e3})
r1 := NewRib(1, bgp.RF_IPv4_UC, bgp.NewIPAddrPrefix(24, "192.168.0.0"), []*RibEntry{e1, e2, e3})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rib family should be addressed by prefix parsing as suggested here https://github.com/osrg/gobgp/pull/3070/files#r2251531518

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fujita here my proposal instead of this PR
we could remove addrlen from IpAddrDefaultPrefix
and handle multicast correctly

It's a 2 commits in this PR, we can split if needed
#3081

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.

2 participants