1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #40366 from arkodg/check-cidr-ipv6

Handle the error case when fixed-cidr-ipv6 is empty and ipv6 is enabled
This commit is contained in:
Sebastiaan van Stijn 2020-01-14 13:53:45 +01:00 committed by GitHub
commit be095a1859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1023,7 +1023,9 @@ func initBridgeDriver(controller libnetwork.NetworkController, config *config.Co
ipamV6Conf *libnetwork.IpamConf
)
if config.BridgeConfig.FixedCIDRv6 != "" {
if config.BridgeConfig.EnableIPv6 && config.BridgeConfig.FixedCIDRv6 == "" {
return errdefs.InvalidParameter(errors.New("IPv6 is enabled for the default bridge, but no subnet is configured. Specify an IPv6 subnet using --fixed-cidr-v6"))
} else if config.BridgeConfig.FixedCIDRv6 != "" {
_, fCIDRv6, err := net.ParseCIDR(config.BridgeConfig.FixedCIDRv6)
if err != nil {
return err