mirror of
https://github.com/moby/moby.git
synced 2026-08-09 01:21:37 +00:00
If IPv6 is enabled for a bridge network, by the time configuration is applied, the bridge will always have an address. Assert that, by raising an error when the configuration is validated. Use that to simplify the logic used to calculate which addresses should be assigned to a bridge. Also remove a redundant check in setupGatewayIPv6() and the error associated with it. Fix unit tests that enabled IPv6, but didn't supply an IPv6 IPAM address/pool. Before this change, these tests passed but silently left the bridge without an IPv6 address. (The daemon already ensured there was an IPv6 address, this change does not add a new restriction on config at that level.) Signed-off-by: Rob Murray <rob.murray@docker.com>