Skip to content

Commit 49eaf70

Browse files
dupondjealmusil
authored andcommitted
Fix default route with libnl3.8+
Since libnl3.8, the nl_addr_parse function does not return 'none' anymore for 'default', but it returns a 0.0.0.0/0 addr. thom311/libnl@0c0aee8 But since we depend on that value in vdsm, it never reports a default gateway anymore, causing networks to be out of sync. So next to 'none' we also check for '0.0.0.0/0' or '::/0'. Signed-off-by: Jean-Louis Dupond <[email protected]>
1 parent 0fc22ff commit 49eaf70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/vdsm/network/netinfo/routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def is_default_route(gateway, routes):
5353
and route['family'] == 'inet'
5454
and route['scope'] == 'global'
5555
and route['gateway'] == gateway
56-
and route['destination'] == 'none'
56+
and route['destination'] in ('none', '0.0.0.0/0', '::/0')
5757
):
5858
return True
5959
return False
@@ -83,7 +83,7 @@ def get_gateway(
8383
gateways = [
8484
r
8585
for r in routes
86-
if r['destination'] == 'none'
86+
if r['destination'] in ('none', '0.0.0.0/0', '::/0')
8787
and (r.get('table') == table or table == RtKnownTables.RT_TABLE_UNSPEC)
8888
and r['scope'] == 'global'
8989
and r['family'] == ('inet6' if family == 6 else 'inet')

0 commit comments

Comments
 (0)