summaryrefslogtreecommitdiff
path: root/libpod/networking_linux.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-10-21 21:00:16 -0400
committerGitHub <noreply@github.com>2020-10-21 21:00:16 -0400
commit2cd2359a6d9ba4135495dc9be616bb1edebb170d (patch)
tree97fc6e19db7e79683b242958b038c528eb451533 /libpod/networking_linux.go
parent2bd920b00540280696d19dc95ab6e562aebd6b7d (diff)
parent33366a2cda518fafed0e72cf6e53b55abfa3c5e5 (diff)
downloadpodman-2cd2359a6d9ba4135495dc9be616bb1edebb170d.tar.gz
podman-2cd2359a6d9ba4135495dc9be616bb1edebb170d.tar.bz2
podman-2cd2359a6d9ba4135495dc9be616bb1edebb170d.zip
Merge pull request #7772 from TomSweeneyRedHat/dev/tsweeney/splitn
Convert Split() calls with an equal sign to SplitN()
Diffstat (limited to 'libpod/networking_linux.go')
-rw-r--r--libpod/networking_linux.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index df0ff6c32..9ff6e40b7 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -254,9 +254,11 @@ func (r *Runtime) setupSlirp4netns(ctr *Container) error {
if ctr.config.NetworkOptions != nil {
slirpOptions := ctr.config.NetworkOptions["slirp4netns"]
for _, o := range slirpOptions {
- parts := strings.Split(o, "=")
+ parts := strings.SplitN(o, "=", 2)
+ if len(parts) < 2 {
+ return errors.Errorf("unknown option for slirp4netns: %q", o)
+ }
option, value := parts[0], parts[1]
-
switch option {
case "cidr":
ipv4, _, err := net.ParseCIDR(value)