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

Merge pull request #11427 from LK4D4/fix_alloc_ip6

Fix IPv6 autoallocation from mac with --ipv6-cidr
This commit is contained in:
Jessie Frazelle 2015-03-16 16:38:46 -07:00
commit 213be9ee27

View file

@ -523,7 +523,8 @@ func Allocate(job *engine.Job) engine.Status {
// If globalIPv6Network Size is at least a /80 subnet generate IPv6 address from MAC address
netmask_ones, _ := globalIPv6Network.Mask.Size()
if requestedIPv6 == nil && netmask_ones <= 80 {
requestedIPv6 = globalIPv6Network.IP
requestedIPv6 = make(net.IP, len(globalIPv6Network.IP))
copy(requestedIPv6, globalIPv6Network.IP)
for i, h := range mac {
requestedIPv6[i+10] = h
}