diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-21 05:46:58 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-21 16:00:45 -0400 |
commit | f7fe424e19c6d95da6366be966457640bbcfd2e6 (patch) | |
tree | 2b7c1f7473692c5ebef594cef65ef8648331e38f /cmd/podman | |
parent | 2ed4a0e35f6182b79976979ecf3f3ab9010417bd (diff) | |
download | podman-f7fe424e19c6d95da6366be966457640bbcfd2e6.tar.gz podman-f7fe424e19c6d95da6366be966457640bbcfd2e6.tar.bz2 podman-f7fe424e19c6d95da6366be966457640bbcfd2e6.zip |
Throw error on IPv6 ip addresses
Podman does not currently support IPv6 addresses.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/common/netflags.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/common/netflags.go b/cmd/podman/common/netflags.go index 1a47733e7..a63605909 100644 --- a/cmd/podman/common/netflags.go +++ b/cmd/podman/common/netflags.go @@ -4,6 +4,7 @@ import ( "net" "github.com/containers/libpod/cmd/podman/parse" + "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/domain/entities" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -148,6 +149,9 @@ func NetFlagsToNetOptions(cmd *cobra.Command) (*entities.NetOptions, error) { if staticIP == nil { return nil, errors.Errorf("%s is not an ip address", ip) } + if staticIP.To4() == nil { + return nil, errors.Wrapf(define.ErrInvalidArg, "%s is not an IPv4 address", ip) + } opts.StaticIP = &staticIP } |