Skip to content

Commit

Permalink
Merge pull request moby#1807 from msabansal/transparentfix
Browse files Browse the repository at this point in the history
Fixes docker daemon not starting after endpoint leak
  • Loading branch information
Santhosh Manohar authored Jun 16, 2017
2 parents ca1d612 + 2d278de commit eca6a26
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libnetwork/drivers/windows/windows_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,12 @@ func (ep *hnsEndpoint) MarshalJSON() ([]byte, error) {
epMap["Type"] = ep.Type
epMap["profileID"] = ep.profileID
epMap["MacAddress"] = ep.macAddress.String()
epMap["Addr"] = ep.addr.String()
epMap["gateway"] = ep.gateway.String()

if ep.addr.IP != nil {
epMap["Addr"] = ep.addr.String()
}
if ep.gateway != nil {
epMap["gateway"] = ep.gateway.String()
}
epMap["epOption"] = ep.epOption
epMap["epConnectivity"] = ep.epConnectivity
epMap["PortMapping"] = ep.portMapping
Expand All @@ -251,7 +254,6 @@ func (ep *hnsEndpoint) UnmarshalJSON(b []byte) error {
if err = json.Unmarshal(b, &epMap); err != nil {
return fmt.Errorf("Failed to unmarshal to endpoint: %v", err)
}

if v, ok := epMap["MacAddress"]; ok {
if ep.macAddress, err = net.ParseMAC(v.(string)); err != nil {
return types.InternalErrorf("failed to decode endpoint MAC address (%s) after json unmarshal: %v", v.(string), err)
Expand All @@ -262,7 +264,9 @@ func (ep *hnsEndpoint) UnmarshalJSON(b []byte) error {
return types.InternalErrorf("failed to decode endpoint IPv4 address (%s) after json unmarshal: %v", v.(string), err)
}
}

if v, ok := epMap["gateway"]; ok {
ep.gateway = net.ParseIP(v.(string))
}
ep.id = epMap["id"].(string)
ep.Type = epMap["Type"].(string)
ep.nid = epMap["nid"].(string)
Expand Down

0 comments on commit eca6a26

Please sign in to comment.