mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Throw error on IPv6 ip addresses
Podman does not currently support IPv6 addresses. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/containers/libpod/cmd/podman/parse"
|
"github.com/containers/libpod/cmd/podman/parse"
|
||||||
|
"github.com/containers/libpod/libpod/define"
|
||||||
"github.com/containers/libpod/pkg/domain/entities"
|
"github.com/containers/libpod/pkg/domain/entities"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -148,6 +149,9 @@ func NetFlagsToNetOptions(cmd *cobra.Command) (*entities.NetOptions, error) {
|
|||||||
if staticIP == nil {
|
if staticIP == nil {
|
||||||
return nil, errors.Errorf("%s is not an ip address", ip)
|
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
|
opts.StaticIP = &staticIP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user