Skip to content

Fixes moby/moby#40388, produce an error with invalid address pool#2538

Merged
thaJeztah merged 1 commit into
moby:masterfrom
wangyumu:add-error-invalid-default-address-pools
Mar 31, 2020
Merged

Fixes moby/moby#40388, produce an error with invalid address pool#2538
thaJeztah merged 1 commit into
moby:masterfrom
wangyumu:add-error-invalid-default-address-pools

Conversation

@wangyumu

Copy link
Copy Markdown
Contributor

- What I did
from moby/moby#40388

Things to fix;

  • if base=10.123.0.0 is invalid, it should produce an error
  • if the given configuration file does not contain default-address-pools, it should not reset the value set on the command-line

Originally posted by @thaJeztah in moby/moby#40388 (comment)

This PR will produce an error if given an invalid address pool like base=10.123.0.0,size=24 (missing /16)

- How I did it
if the default address pool is invalid, ConfigLocalScopeDefaultNetworks will return an error, so just return the error rather than omit it and it's quite safe.

The output likes:

Mar 17 00:10:29 master dockerd[12069]: failed to start daemon: Error initializing network controller: error obtaining controller instance: invalid base pool "10.123.0.0": invalid CIDR address: 10.123.0.0
Signed-off-by: Wang Yumu <37442693@qq.com>
@arkodg arkodg requested a review from selansen March 17, 2020 17:11

@arkodg arkodg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks !

@arkodg

arkodg commented Mar 30, 2020

Copy link
Copy Markdown
Contributor

PTAL @thaJeztah

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@thaJeztah thaJeztah merged commit 6e14077 into moby:master Mar 31, 2020
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Apr 21, 2020
full diff: moby/libnetwork@ef149a9...1a17fb3

- moby/libnetwork#2538 produce an error with invalid address pool
    - addresses moby#40388 dockerd ignores the --default-address-pool option
- moby/libnetwork#2471 DOCKER-USER chain not created when IPTableEnable=false
- moby/libnetwork#2544 Fix NPE due to null value returned by ep.Iface()
    - carries moby/libnetwork#2239 Prevent NPE in addServiceInfoToCluster()
    - addresses moby#37506 Error initializing docker.server while starting daemon by systemd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Apr 25, 2020
full diff: moby/libnetwork@ef149a9...1a17fb3

- moby/libnetwork#2538 produce an error with invalid address pool
    - addresses moby/moby#40388 dockerd ignores the --default-address-pool option
- moby/libnetwork#2471 DOCKER-USER chain not created when IPTableEnable=false
- moby/libnetwork#2544 Fix NPE due to null value returned by ep.Iface()
    - carries moby/libnetwork#2239 Prevent NPE in addServiceInfoToCluster()
    - addresses moby/moby#37506 Error initializing docker.server while starting daemon by systemd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c3808634e7a44fc5b4fb8caacd9d079f7e0a0fee
Component: engine
@wangyumu wangyumu deleted the add-error-invalid-default-address-pools branch June 3, 2020 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants