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 <[email protected]>
(cherry picked from commit f4163ae)
  • Loading branch information
smira committed Jul 22, 2024
1 parent 745257f commit f686e71
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 @@ -305,6 +305,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 f686e71

Please sign in to comment.