mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1131 from msabansal/staticip
Static ip support for windows
This commit is contained in:
commit
57a91d9153
1 changed files with 11 additions and 2 deletions
|
@ -417,6 +417,10 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo,
|
|||
}
|
||||
endpointStruct.Policies = append(endpointStruct.Policies, qosPolicies...)
|
||||
|
||||
if ifInfo.Address() != nil {
|
||||
endpointStruct.IPAddress = ifInfo.Address().IP
|
||||
}
|
||||
|
||||
configurationb, err := json.Marshal(endpointStruct)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -452,8 +456,13 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo,
|
|||
n.endpoints[eid] = endpoint
|
||||
n.Unlock()
|
||||
|
||||
ifInfo.SetIPAddress(endpoint.addr)
|
||||
ifInfo.SetMacAddress(endpoint.macAddress)
|
||||
if ifInfo.Address() == nil {
|
||||
ifInfo.SetIPAddress(endpoint.addr)
|
||||
}
|
||||
|
||||
if macAddress == nil {
|
||||
ifInfo.SetMacAddress(endpoint.macAddress)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue