diff --git a/libnetwork/ipvs/netlink.go b/libnetwork/ipvs/netlink.go index 083909ae05..5ded7df18c 100644 --- a/libnetwork/ipvs/netlink.go +++ b/libnetwork/ipvs/netlink.go @@ -422,8 +422,11 @@ func assembleDestination(attrs []syscall.NetlinkRouteAttr) (*Destination, error) attrType := int(attr.Attr.Type) switch attrType { + + case ipvsDestAttrAddressFamily: + d.AddressFamily = native.Uint16(attr.Value) case ipvsDestAttrAddress: - ip, err := parseIP(attr.Value, syscall.AF_INET) + ip, err := parseIP(attr.Value, d.AddressFamily) if err != nil { return nil, err } @@ -438,8 +441,6 @@ func assembleDestination(attrs []syscall.NetlinkRouteAttr) (*Destination, error) d.UpperThreshold = native.Uint32(attr.Value) case ipvsDestAttrLowerThreshold: d.LowerThreshold = native.Uint32(attr.Value) - case ipvsDestAttrAddressFamily: - d.AddressFamily = native.Uint16(attr.Value) case ipvsDestAttrActiveConnections: d.ActiveConnections = int(native.Uint16(attr.Value)) case ipvsDestAttrInactiveConnections: