Skip to content

Commit

Permalink
Handle error case when fixed-cidr-ipv6 is empty
Browse files Browse the repository at this point in the history
When IPv6 is enabled, make sure fixed-cidr-ipv6 is set
by the user since there is no default IPv6 local subnet
in the IPAM

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
  • Loading branch information
Arko Dasgupta committed Jan 13, 2020
1 parent a9507c6 commit bdad16b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daemon/daemon_unix.go
Expand Up @@ -1018,7 +1018,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
Expand Down

0 comments on commit bdad16b

Please sign in to comment.