From a983569c0cbe51c365e62a453d38f8ee11c31220 Mon Sep 17 00:00:00 2001 From: Jana Radhakrishnan Date: Tue, 5 May 2015 03:27:34 +0000 Subject: [PATCH] Added mac address to EndpointInfo Signed-off-by: Jana Radhakrishnan --- libnetwork/drivers/bridge/bridge.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libnetwork/drivers/bridge/bridge.go b/libnetwork/drivers/bridge/bridge.go index 0feedf8c3b..c901d819f6 100644 --- a/libnetwork/drivers/bridge/bridge.go +++ b/libnetwork/drivers/bridge/bridge.go @@ -61,6 +61,7 @@ type ContainerConfiguration struct { type bridgeEndpoint struct { id types.UUID intf *sandbox.Interface + macAddress net.HardwareAddr config *EndpointConfiguration // User specified parameters 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 { return nil, err } + endpoint.macAddress = mac // Add bridge inherited attributes to pipe interfaces if config.Mtu != 0 { @@ -614,6 +616,10 @@ func (d *driver) EndpointInfo(nid, eid types.UUID) (map[string]interface{}, erro m[options.PortMap] = pmc } + if len(ep.macAddress) != 0 { + m[options.MacAddress] = ep.macAddress + } + return m, nil }