Skip to content

Commit 5209845

Browse files
committed
plugins BUGFIX differentiate between plugin types
1 parent 7efb69e commit 5209845

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/plugins.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,13 @@ static LY_ERR
615615
lyplg_add_plugin(struct ly_ctx *ctx, uint32_t version, enum LYPLG type, const void *recs)
616616
{
617617
LY_ERR ret = LY_SUCCESS;
618+
uint32_t cur_ver = (type == LYPLG_TYPE) ? LYPLG_TYPE_API_VERSION : LYPLG_EXT_API_VERSION;
618619

619620
LY_CHECK_ARG_RET(NULL, recs, LY_EINVAL);
620621

621-
if (version != LYPLG_TYPE_API_VERSION) {
622-
LOGERR(ctx, LY_EINVAL, "Adding user %s plugin failed, wrong API version - %d expected, %" PRIu32 " found.",
623-
(type == LYPLG_TYPE) ? "type" : "extension", LYPLG_TYPE_API_VERSION, version);
622+
if (version != cur_ver) {
623+
LOGERR(ctx, LY_EINVAL, "Adding user %s plugin failed, wrong API version - %" PRIu32 " expected, %" PRIu32 " found.",
624+
(type == LYPLG_TYPE) ? "type" : "extension", cur_ver, version);
624625
return LY_EINVAL;
625626
}
626627

0 commit comments

Comments
 (0)