context UPDATE modules' enabled features and imp state part of hash
diff --git a/src/context.c b/src/context.c
index 05b16f6..b0d8dcc 100644
--- a/src/context.c
+++ b/src/context.c
@@ -673,15 +673,29 @@
ly_ctx_get_modules_hash(const struct ly_ctx *ctx)
{
const struct lys_module *mod;
- uint32_t i = ly_ctx_internal_modules_count(ctx), hash = 0;
+ uint32_t i = ly_ctx_internal_modules_count(ctx), hash = 0, fi = 0;
+ struct lysp_feature *f = NULL;
LY_CHECK_ARG_RET(ctx, ctx, 0);
while ((mod = ly_ctx_get_module_iter(ctx, &i))) {
+ /* name */
hash = dict_hash_multi(hash, mod->name, strlen(mod->name));
+
+ /* revision */
if (mod->revision) {
hash = dict_hash_multi(hash, mod->revision, strlen(mod->revision));
}
+
+ /* enabled features */
+ while ((f = lysp_feature_next(f, mod->parsed, &fi))) {
+ if (f->flags & LYS_FENABLED) {
+ hash = dict_hash_multi(hash, f->name, strlen(f->name));
+ }
+ }
+
+ /* imported/implemented */
+ hash = dict_hash_multi(hash, (char *)&mod->implemented, sizeof mod->implemented);
}
hash = dict_hash_multi(hash, NULL, 0);