mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
libnetwork to honor explicit mac-address
- Currently endpoint interface mac address is not being set in network.go when user specified the mac address for the container. - Overlay driver expects to get the user defined mac-address from InterfaceInfo. Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
parent
0029d6c2ef
commit
ea14d68757
1 changed files with 6 additions and 0 deletions
|
@ -671,6 +671,12 @@ func (n *network) CreateEndpoint(name string, options ...EndpointOption) (Endpoi
|
||||||
|
|
||||||
ep.processOptions(options...)
|
ep.processOptions(options...)
|
||||||
|
|
||||||
|
if opt, ok := ep.generic[netlabel.MacAddress]; ok {
|
||||||
|
if mac, ok := opt.(net.HardwareAddr); ok {
|
||||||
|
ep.iface.mac = mac
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err = ep.assignAddress(true, !n.postIPv6); err != nil {
|
if err = ep.assignAddress(true, !n.postIPv6); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue