-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefix is empty when handling identityref (libyang 2.1.144) #2146
Comments
I do not know exactly where you get the data (it should not be netopeer2) <bbf-qos-cls:filter-operation>match-all-filter<bbf-qos-cls:filter-operation> but they are wrong if
the default namespace is used, not the one of the prefix. |
Well, actually I have problem with applying deviation replace on default value. I have custom yang, which contains such deviation:
I imported modules using custom binary, which use sr_install_modules2 function from sysrepo. All is okey, but as a result i see, that startup datastore file bbf-qos-classifiers.yang in /etc/sysrepo/data/ contains value "match-all-filter" without any prefix. So, the default value for bbf-qos-cls:filter-operation was changed from "match-any-filter". But prefix is absent. And it's the reason of error:
Behaviour on the previous versions of libyang, sysrepo and netopeer was such, that i have match-all-filter in startup datastore with prefix after applying deviation. |
That is all fine, the value <filter-operation xmlns="urn:bbf:yang:bbf-qos-classifiers">match-all-filter<filter-operation> because it simply inherits the default namespace. That is why I have asked (and am asking again) how exactly did you get the XML data that are not using a default namespace but a prefixed namespace instead? Those are the only problem. |
Hello!
I discovered the following problem on the libyang version 2.1.144.
Other related libs versions:
libnetconf2 - 2.1.38
sysrepo - 2.2.33
netopeer2 - 2.1.49
We sent get-config into the running datastore on the whole yang tree. Saved received config, and then send edit-config with content of this file to the candidate datastore. And got error in a response:
I discovered, that we handle identityref in function identityref_str2ident. But problem is that during handling the next part of xml:
we got only:
as "value" parameter of identityref_str2ident function. Then we try to parse prefix from value inside it:
Of course, we can find nothing before we rich value_len and set prefix_len to 0. Then we have the same stacktrace into identityref_str2ident:
I see, that even if we found prefix, we never try find real matching between it and prefixes, which are stored in prefix_data set. We hardcode NULL as second paramter instead of pass prefix parameter, and 0 instead of real prefix_len.
The text was updated successfully, but these errors were encountered: