mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix endpoint ip data-store sync issue
Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
parent
1e1eaf5937
commit
b40774bb02
1 changed files with 6 additions and 3 deletions
|
@ -84,13 +84,15 @@ func (epi *endpointInterface) UnmarshalJSON(b []byte) (err error) {
|
||||||
mac, _ := net.ParseMAC(epMap["mac"].(string))
|
mac, _ := net.ParseMAC(epMap["mac"].(string))
|
||||||
epi.mac = mac
|
epi.mac = mac
|
||||||
|
|
||||||
_, ipnet, _ := net.ParseCIDR(epMap["addr"].(string))
|
ip, ipnet, _ := net.ParseCIDR(epMap["addr"].(string))
|
||||||
if ipnet != nil {
|
if ipnet != nil {
|
||||||
|
ipnet.IP = ip
|
||||||
epi.addr = *ipnet
|
epi.addr = *ipnet
|
||||||
}
|
}
|
||||||
|
|
||||||
_, ipnet, _ = net.ParseCIDR(epMap["addrv6"].(string))
|
ip, ipnet, _ = net.ParseCIDR(epMap["addrv6"].(string))
|
||||||
if ipnet != nil {
|
if ipnet != nil {
|
||||||
|
ipnet.IP = ip
|
||||||
epi.addrv6 = *ipnet
|
epi.addrv6 = *ipnet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,8 +104,9 @@ func (epi *endpointInterface) UnmarshalJSON(b []byte) (err error) {
|
||||||
json.Unmarshal(rb, &routes)
|
json.Unmarshal(rb, &routes)
|
||||||
epi.routes = make([]*net.IPNet, 0)
|
epi.routes = make([]*net.IPNet, 0)
|
||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
_, ipr, err := net.ParseCIDR(route)
|
ip, ipr, err := net.ParseCIDR(route)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
ipr.IP = ip
|
||||||
epi.routes = append(epi.routes, ipr)
|
epi.routes = append(epi.routes, ipr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue