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>
  • Loading branch information
smira committed Apr 10, 2024
1 parent ba7cdc8 commit 81691cc
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 81691cc

Please sign in to comment.