Skip to content

Add multi-path support to netlink client#185

Open
maxmoehl wants to merge 3 commits into
masterfrom
maxmoehl/multi-path
Open

Add multi-path support to netlink client#185
maxmoehl wants to merge 3 commits into
masterfrom
maxmoehl/multi-path

Conversation

@maxmoehl

Copy link
Copy Markdown
Member

Resolves: #16

Resolves: #16
Signed-off-by: Maximilian Moehl <maximilian@moehl.eu>

@byteocean byteocean left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

Comment thread netlink.go Outdated
err := c.installRoute(dest, hop, table)
next := append(slices.Clone(current), hop)

// Ensure deterministic order to make comparing route tables across machines

@byteocean byteocean Jun 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a nuance point: I didn't understand the comment at the beginning, but realised that it is about using ip command during debugging. maybe saying '...printing and comparing routing tables across routers...'.

Comment thread netlink.go Outdated
delete(c.routes, key)
} else {
if err := c.replaceRoute(dest.Prefix, next, table); err != nil {
return fmt.Errorf("cannot install replacement route for %s: %v", dest, err)

@peanball peanball Jun 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Errors should be wrapped via %w. I will add a fixup commit.

Comment thread netlink.go
Comment thread netlink.go Outdated
}

err := c.installRoute(dest, hop, table)
next := append(slices.Clone(current), hop)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The semantics changed slightly here I think. Where previously if there were some hops we added the hop, we might now not call it if our route cache (not necessarily the kernel's state) has the hop already.

By always writing via Replace (add or update), we could ensure that this will always converge to the desired state, even if the kernel's table changes.

I will add a fixup for this, but not sure if this is a relevant issue.

peanball added 2 commits June 12, 2026 10:46
Wrap errors instead of just taking their message

Signed-off-by: Alexander Lais <alexander.lais@sap.com>
Ensure that RouteReplace is always run, as it will add or update.
This keeps the kernel's routing table in sync with our cache.

Retains the old behavior of adding the route unconditionally and
ensuring it exists. That matters for refill paths like
MetalBond.AddRoutesForVni after peer reconnect.

Signed-off-by: Alexander Lais <alexander.lais@sap.com>

@peanball peanball left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do with the fixup commits as you'd like, either accept or rewrite in your name. Let me know if this style of review proposals is good at all or ```suggestion``` would have been better...

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multipath support for netlink client

3 participants