Skip to content

Commit

Permalink
Fix default gateway parsing issue on CURRENT
Browse files Browse the repository at this point in the history
Fixes #60
  • Loading branch information
grembo committed Jan 27, 2025
1 parent c55e05a commit 2aa168d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iocage_lib/ioc_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,8 @@ def parse_package_name(pkg):


def get_host_gateways():
dest_default_gw = {'ipv4': ['default', '0.0.0.0'],
'ipv6': ['default', '::/0']}
gateways = {'ipv4': {'gateway': None, 'interface': None},
'ipv6': {'gateway': None, 'interface': None}}
af_mapping = {
Expand All @@ -1116,7 +1118,7 @@ def get_host_gateways():
pass
else:
default_route = list(filter(
lambda x: x['destination'] == 'default', route_entries)
lambda x: x['destination'] in dest_default_gw[af_mapping[af]], route_entries)
)
if default_route and 'gateway' in default_route[0]:
gateways[af_mapping[af]]['gateway'] = \
Expand Down

0 comments on commit 2aa168d

Please sign in to comment.