Skip to content
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

RPC get-conf method returned some content not specified by select filter #281

Closed
nowaits opened this issue Oct 30, 2021 · 1 comment
Closed

Comments

@nowaits
Copy link
Contributor

nowaits commented Oct 30, 2021

Hi olof,
Current netconf RPC get-conf method returned some content not specified by select filter, Below is the test case:

yang:

module example {
    yang-version 1.1;
    namespace "example.com";
    prefix ex;

    container top {
        leaf a {
            type string;
            default "1";
        }
        leaf b {
            type string;
            default "1";
        }
    }
}

config

<configuration>
   <top xmlns="example.com">
      <b>100</b>
   </top>
<configuration>

My calling in netconf is:

<hello
    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42">
    <capabilities>
        <capability>urn:ietf:params:netconf:base:1.1</capability>
    </capabilities>
</hello>]]>]]>

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42">
    <get-config>
        <source>
            <running/>
        </source>
        <nc:filter nc:type="xpath" nc:select="/top/b" xmlns="example.com"/>
    </get-config>
</rpc>]]>]]>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42"><data><top xmlns="example.com"><a>1</a><b>100</b></top></data></rpc-reply>]]>]]>

Backend log is:

Oct 30 22:03:54: clicon_msg_decode <hello username="root" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42"><capabilities><capability>urn:ietf:params:netconf:base:1.1</capability></capabilities></hello>
Oct 30 22:03:54: from_client_msg cbret:<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42"><session-id>1</session-id></hello>
Oct 30 22:03:54: from_client_msg retval:0
Oct 30 22:03:54: from_client retval=0
Oct 30 22:04:03: from_client
Oct 30 22:04:03: from_client_msg
Oct 30 22:04:03: clicon_msg_decode <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42" username="root"><get-config><source><running/></source><nc:filter nc:type="xpath" nc:select="/top/b" xmlns="example.com"/><cp:list-pagination xmlns:cp="http://clicon.org/clixon-netconf-list-pagination">false</cp:list-pagination><cp:limit xmlns:cp="http://clicon.org/clixon-netconf-list-pagination">unbounded</cp:limit><cp:offset xmlns:cp="http://clicon.org/clixon-netconf-list-pagination">none</cp:offset><cp:direction xmlns:cp="http://clicon.org/clixon-netconf-list-pagination">forward</cp:direction><cp:sort xmlns:cp="http://clicon.org/clixon-netconf-list-pagination">default</cp:sort></get-config></rpc>
Oct 30 22:04:03: from_client_msg module:ietf-netconf rpc:get-config
Oct 30 22:04:03: get_common
Oct 30 22:04:03: get_common retval:0
Oct 30 22:04:03: rpc_callback_call retval:1
Oct 30 22:04:03: from_client_msg cbret:<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><data><top xmlns="example.com"><a>1</a><b>100</b></top></data></rpc-reply>
Oct 30 22:04:03: from_client_msg retval:0
Oct 30 22:04:03: from_client retval=0

In my filter I need 'nc:select="/top/b', but the /top/a also return to me.
It's a bug.

olofhagsand added a commit that referenced this issue Nov 13, 2021
…filter](#281)

  * Bug introduced when upgrading of list pagination
@olofhagsand
Copy link
Member

Bug introduced when upgrading of list pagination
Thanks for reporting
Please verify

@nowaits nowaits closed this as completed Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants