Browse Source

Merge pull request #755 from aboch/mc

libnetwork to honor explicit mac-address for all drivers
Madhu Venugopal 9 năm trước cách đây
mục cha
commit
e7b0344efe
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      libnetwork/network.go

+ 6 - 0
libnetwork/network.go

@@ -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
 	}
 	}