summaryrefslogtreecommitdiff
path: root/cloudinit/net
diff options
context:
space:
mode:
authorJames Falcon <TheRealFalcon@users.noreply.github.com>2021-03-29 10:24:58 -0500
committerGitHub <noreply@github.com>2021-03-29 11:24:58 -0400
commit3b7e2e82310d417c0d59b268a6f47bc8f7996cab (patch)
tree56988ba156db603d847e1bb529b12d60b8e1e1fa /cloudinit/net
parent13606a12054f4fcf1494ea3068db0640ae6cc3a3 (diff)
downloadvyos-cloud-init-3b7e2e82310d417c0d59b268a6f47bc8f7996cab.tar.gz
vyos-cloud-init-3b7e2e82310d417c0d59b268a6f47bc8f7996cab.zip
Fix mis-detecting network configuration in initramfs cmdline (#844)
klibc initramfs in debian allows the 'iscsi_target_ip=' cmdline parameter to specify an iscsi device attachment. This can cause cloud-init to mis-detect the cmdline paramter as a networking config. LP: #1919188
Diffstat (limited to 'cloudinit/net')
-rwxr-xr-xcloudinit/net/cmdline.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py
index cc8dc17b..7cdd428d 100755
--- a/cloudinit/net/cmdline.py
+++ b/cloudinit/net/cmdline.py
@@ -12,6 +12,7 @@ import gzip
import io
import logging
import os
+import shlex
from cloudinit import util
@@ -72,8 +73,9 @@ class KlibcNetworkConfigSource(InitramfsNetworkConfigSource):
(ii) an open-iscsi interface file is present in the system
"""
if self._files:
- if 'ip=' in self._cmdline or 'ip6=' in self._cmdline:
- return True
+ for item in shlex.split(self._cmdline):
+ if item.startswith('ip=') or item.startswith('ip6='):
+ return True
if os.path.exists(_OPEN_ISCSI_INTERFACE_FILE):
# iBft can configure networking without ip=
return True