Added mac address to EndpointInfo

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
This commit is contained in:
Jana Radhakrishnan 2015-05-05 03:27:34 +00:00
parent 560d156e36
commit a983569c0c
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,7 @@ type ContainerConfiguration struct {
type bridgeEndpoint struct { type bridgeEndpoint struct {
id types.UUID id types.UUID
intf *sandbox.Interface intf *sandbox.Interface
macAddress net.HardwareAddr
config *EndpointConfiguration // User specified parameters config *EndpointConfiguration // User specified parameters
portMapping []netutils.PortBinding // Operation port bindings portMapping []netutils.PortBinding // Operation port bindings
} }
@ -424,6 +425,7 @@ func (d *driver) CreateEndpoint(nid, eid types.UUID, epOptions map[string]interf
if err != nil { if err != nil {
return nil, err return nil, err
} }
endpoint.macAddress = mac
// Add bridge inherited attributes to pipe interfaces // Add bridge inherited attributes to pipe interfaces
if config.Mtu != 0 { if config.Mtu != 0 {
@ -614,6 +616,10 @@ func (d *driver) EndpointInfo(nid, eid types.UUID) (map[string]interface{}, erro
m[options.PortMap] = pmc m[options.PortMap] = pmc
} }
if len(ep.macAddress) != 0 {
m[options.MacAddress] = ep.macAddress
}
return m, nil return m, nil
} }