Static ip support for windows

Signed-off-by: msabansal <sabansal@microsoft.com>
This commit is contained in:
msabansal 2016-04-20 15:44:32 -07:00
parent 5108711b88
commit 43a2b083e8
1 changed files with 11 additions and 2 deletions

View File

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