Allow IPv6 allocation post endpoint create via network option#741
Allow IPv6 allocation post endpoint create via network option#741mrjana merged 1 commit intomoby:masterfrom aboch:b6
Conversation
There was a problem hiding this comment.
With this option, the IPAM doesn't even know about this range. What happens if the same range is used by some other network and IPAM gives out the same IP address as what was generated here using MAC address.
Would it be better to allocate this generated IP address from IPAM during the SetIPAddress call?
There was a problem hiding this comment.
That would be the ideal solution. But we do not have the ipam options for Endpoints.
Second option is that libnetwork does it, but I'd refrain for adding bridge driver specific code into libnetwork.
There was a problem hiding this comment.
What I am suggesting is create the pool in IPAM from the caller of libnetwork(docker), have some way of not allocating the IP address for IPv6(in fact we can do it for all networks if mask <= 80) and then allocate the IP address during SetIPAddress when driver calls. WDYT?
There was a problem hiding this comment.
That would work, but decision whether to operate that way (allocating the address pre or post CreateEndpoint) should not be taken by libnetwork alone and based on mask lengths. The address allocation strategy should be controlled at least by a network driver property.
Also we probably want this behavior (deterministic ipv6 address setting implicitly via --mac-address run option) be preserved only for default bridge network, not for all bridge networks.
|
@mrjana Reworked the diffs based on your input. PTAL when you get a chance. Thanks. |
There was a problem hiding this comment.
Can we change it to something like NetworkOptionIPv6DeferAlloc?
|
LGTM |
There was a problem hiding this comment.
ip6 is set only for the condition of ones <= 80. it is possible that it can be nil in cases when the config.AddressIPv6 doesnt fall under the condition. Should this be checked ?
There was a problem hiding this comment.
Thanks for catching this.
It cannot happen in the docker code, but this condition needs nevertheless to be covered in the libnetwork context.
Will update the diffs shortly.
- Controlled by network option Signed-off-by: Alessandro Boch <aboch@docker.com>
|
LGTM |
|
LGTM again |
Allow IPv6 allocation post endpoint create via network option
There was a problem hiding this comment.
This seems to be an unassigned network. I suggest you to use: 2001:db8::/32 as per RFC 3849
There was a problem hiding this comment.
Thanks. Please open a PR and we'll get it merged.
Related to moby/moby#17739
Signed-off-by: Alessandro Boch aboch@docker.com