Skip to content

Commit

Permalink
fix: assign different priority to IPv6 default gateway on OpenStack
Browse files Browse the repository at this point in the history
Fixes #8558

Similar fix is done for other platforms, but not OpenStack.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
(cherry picked from commit bfbd02a)
  • Loading branch information
smira committed Apr 12, 2024
1 parent d5932a3 commit eea41cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ func (o *Openstack) ParseMetadata(
return nil, fmt.Errorf("failed to parse gateway ip: %w", err)
}

priority := uint32(network.DefaultRouteMetric)

if family == nethelpers.FamilyInet6 {
priority *= 2
}

route := network.RouteSpecSpec{
ConfigLayer: network.ConfigPlatform,
Gateway: gw,
Expand All @@ -283,7 +289,7 @@ func (o *Openstack) ParseMetadata(
Protocol: nethelpers.ProtocolStatic,
Type: nethelpers.TypeUnicast,
Family: family,
Priority: network.DefaultRouteMetric,
Priority: priority,
}

route.Normalize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ routes:
gateway: 2000:0:100:2fff:ff:ff:ff:ff
outLinkName: eth0
table: main
priority: 1024
priority: 2048
scope: global
type: unicast
flags: ""
Expand Down

0 comments on commit eea41cd

Please sign in to comment.