Skip to content

Commit bfbd02a

Browse files
committed
fix: assign different priority to IPv6 default gateway on OpenStack
Fixes #8558 Similar fix is done for other platforms, but not OpenStack. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent c8f674b commit bfbd02a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/openstack.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,12 @@ func (o *Openstack) ParseMetadata(
275275
return nil, fmt.Errorf("failed to parse gateway ip: %w", err)
276276
}
277277

278+
priority := uint32(network.DefaultRouteMetric)
279+
280+
if family == nethelpers.FamilyInet6 {
281+
priority *= 2
282+
}
283+
278284
route := network.RouteSpecSpec{
279285
ConfigLayer: network.ConfigPlatform,
280286
Gateway: gw,
@@ -283,7 +289,7 @@ func (o *Openstack) ParseMetadata(
283289
Protocol: nethelpers.ProtocolStatic,
284290
Type: nethelpers.TypeUnicast,
285291
Family: family,
286-
Priority: network.DefaultRouteMetric,
292+
Priority: priority,
287293
}
288294

289295
route.Normalize()

internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/testdata/expected.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ routes:
9999
gateway: 2000:0:100:2fff:ff:ff:ff:ff
100100
outLinkName: eth0
101101
table: main
102-
priority: 1024
102+
priority: 2048
103103
scope: global
104104
type: unicast
105105
flags: ""

0 commit comments

Comments
 (0)