Skip to content

Commit

Permalink
fix: bump priority of OpenStack routes if IPv6 and default gateway
Browse files Browse the repository at this point in the history
IT looks like gateway is sometimes reported as a 'route' skipping a
'gateway' field.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
(cherry picked from commit f4163ae)
  • Loading branch information
smira committed May 1, 2024
1 parent bd41fee commit 41024e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ func (o *Openstack) ParseMetadata(

route.Normalize()

// double the priority of the route if it is actually the default gateway and IPv6
if route.Destination == (netip.Prefix{}) && family == nethelpers.FamilyInet6 {
route.Priority *= 2
}

networkConfig.Routes = append(networkConfig.Routes, route)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ routes:
gateway: fd00::1
outLinkName: eth1
table: main
priority: 1024
priority: 2048
scope: global
type: unicast
flags: ""
Expand Down

0 comments on commit 41024e1

Please sign in to comment.