libyang icon indicating copy to clipboard operation
libyang copied to clipboard

According to RFC6243, “default” uses the wrong namespace

Open NextLitete opened this issue 8 months ago • 4 comments

rfc6243:

Image

I understand that default is defined in the urn:ietf:params:xml:ns:netconf:default:1.0 namespace, but currently libyang2 incorrectly uses the urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults namespace for default.

The related error implementation includes parsing, printing, and other code processes.

Please confirm whether the current implementation complies with the protocol. If it does not comply with the protocol, please let me know your plan to fix this issue.

Thanks!

NextLitete avatar Jun 12 '25 01:06 NextLitete

This XML can be parsed without errors, just like the test case, but it may not be in compliance with the RFC.

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1744338271054">
  <edit-config>
    <target>
      <running />
    </target>
    <config xmlns:ncwd="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults">
      <container_test xmlns="urn:ietf:params:xml:ns:yang:netconf_sample">
        <test_default>
          <id>0</id>
          <number ncwd:default="true">32</number>
        </test_default>
      </container_test>
    </config>
  </edit-config>
</rpc>

NextLitete avatar Jun 12 '25 01:06 NextLitete

It seems you are right but I am not sure I want to fix this, since you are the first person to notice this and it has been working like this for years. Changing it would entail adding a new internal module with the correct namespace and the default metadata, which is quite a significant change.

michalvasko avatar Jun 12 '25 09:06 michalvasko

This issue causes servers using libyang integration to not interact correctly with clients that implement the default namespace. While this is a heavy historical burden, let's try to fix this issue together. Also, if you have fixed this issue, please reply to this issue. Thanks a lot!

NextLitete avatar Jun 12 '25 11:06 NextLitete

Fine, this should be fixed but it is committed only in an internal branch and this branch is not compatible with any of the other projects (sysrepo, libnetconf2, netopeer2) yet. It will still take a few months until it is and is merged into devel. Then still a few weeks at least before we officially release it because there will be several major changes.

michalvasko avatar Jun 18 '25 13:06 michalvasko

May I ask if these code test have passed? Are there any considerations for not merging them into the master branch? Thank you for your response.@michalvasko @Roytak

NextLitete avatar Aug 07 '25 03:08 NextLitete

Yes, the changes are fine but their release is a bit delayed. But it should not take now more than a week.

michalvasko avatar Aug 07 '25 06:08 michalvasko

Did you miss the changes here in your commit? Please confirm. Image Additionally, have these codes been merged into the master branch? Some of our development rules require that only community-accepted code be used. Please merge them as soon as possible. Thank you very much!

NextLitete avatar Aug 27 '25 09:08 NextLitete

Yes, even this use-case is covered in a later commit and you can find them all in the devel branch for now. There are quite a lot of changes so we want to test them for some time until they are merged to master so you will have to wait a few months.

michalvasko avatar Sep 01 '25 06:09 michalvasko