summaryrefslogtreecommitdiff
path: root/cloudinit/net/__init__.py
diff options
context:
space:
mode:
authorPetr Fedchenkov <giggsoff@gmail.com>2021-04-07 19:16:30 +0300
committerGitHub <noreply@github.com>2021-04-07 11:16:30 -0500
commit15dd3601c484e189ea82917600322b7d0e25c088 (patch)
tree4f1e6f93d52de1f99df862d9fc7d020c4e6ba423 /cloudinit/net/__init__.py
parentfc5d541529d9f4a076998b7b4a3c90bb4be0000d (diff)
downloadvyos-cloud-init-15dd3601c484e189ea82917600322b7d0e25c088.tar.gz
vyos-cloud-init-15dd3601c484e189ea82917600322b7d0e25c088.zip
bringup_static_routes: fix gateway check (#850)
When bringing up DHCP-provided static routes, we check for "0.0.0.0/0" to indicate an unspecified gateway. However, when parsing the static route in `parse_static_routes`, the gateway is never specified with a net length, so the "/0" will never happen. This change updates the gateway check to check only for "0.0.0.0".
Diffstat (limited to 'cloudinit/net/__init__.py')
-rw-r--r--cloudinit/net/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index 385b7bcc..6b3b84f7 100644
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -1135,7 +1135,7 @@ class EphemeralIPv4Network(object):
# ("0.0.0.0/0", "130.56.240.1")]
for net_address, gateway in self.static_routes:
via_arg = []
- if gateway != "0.0.0.0/0":
+ if gateway != "0.0.0.0":
via_arg = ['via', gateway]
subp.subp(
['ip', '-4', 'route', 'add', net_address] + via_arg +