CESNET / libnetconf

C NETCONF library
Other
113 stars 83 forks source link

Regarding to Netconf base1.1 issue #217

Closed classcwnd closed 8 years ago

classcwnd commented 8 years ago

we found when sending hello message with netocnf:base:1.1 capability, there is error when sending rpc messag. Even the issue happened when just enter empty '\n' after sending hello message.

It can be reproduced by sending the following Netconf message.

<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
    <capability>urn:ietf:params:netconf:base:1.1</capability>
  </capabilities>
</hello>
]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
        <get-config>
                <source>
                        <running />
                </source>
        </get-config>
</rpc>
]]>]]>

Then you will see the error from server:

#370
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
    <error-type>rpc</error-type>
    <error-tag>malformed-message</error-tag>
    <error-severity>error</error-severity>
    <error-message>A message could not be handled because it failed to be parsed correctly.</error-message>
  </rpc-error>
</rpc-reply>

However, if I removed urn:ietf:params:netconf:base:1.1 from hello message, the Netconf session and get-config will work.

rkrejci commented 8 years ago

That is correct, you are sending malformed message - you declare that you support NETCONF 1.1, but you are sending message with 1.0 framing mechanism (check RFC 6242).