Fixed: [message-id present on netconf app "hello"](https://github.com/clicon/clixon/issues/369)
This commit is contained in:
parent
6063d9a147
commit
e3f3d772c7
11 changed files with 23 additions and 22 deletions
|
|
@ -1767,8 +1767,7 @@ netconf_hello_server(clicon_handle h,
|
|||
char *encstr = NULL;
|
||||
|
||||
module_set_id = clicon_option_str(h, "CLICON_MODULE_SET_ID");
|
||||
|
||||
cprintf(cb, "<hello xmlns=\"%s\" message-id=\"%u\">", NETCONF_BASE_NAMESPACE, 42);
|
||||
cprintf(cb, "<hello xmlns=\"%s\">", NETCONF_BASE_NAMESPACE);
|
||||
cprintf(cb, "<capabilities>");
|
||||
if (clicon_option_int(h, "CLICON_NETCONF_BASE_CAPABILITY") > 0){
|
||||
/* Each peer MUST send at least the base NETCONF capability, "urn:ietf:params:netconf:base:1.1"
|
||||
|
|
|
|||
|
|
@ -1506,7 +1506,7 @@ clicon_hello_req(clicon_handle h,
|
|||
int ret;
|
||||
|
||||
username = clicon_username_get(h);
|
||||
if ((msg = clicon_msg_encode(0, "<hello username=\"%s\" xmlns=\"%s\" message-id=\"42\"><capabilities><capability>%s</capability></capabilities></hello>",
|
||||
if ((msg = clicon_msg_encode(0, "<hello username=\"%s\" xmlns=\"%s\"><capabilities><capability>%s</capability></capabilities></hello>",
|
||||
username?username:"",
|
||||
NETCONF_BASE_NAMESPACE,
|
||||
NETCONF_BASE_CAPABILITY_1_1)) == NULL)
|
||||
|
|
|
|||
|
|
@ -642,6 +642,8 @@ xml_bind_yang_rpc(cxobj *xrpc,
|
|||
/* Hello: dont bind, dont appear in any yang spec, just ensure there is nothing apart from
|
||||
* session-id or capabilities/capability tags
|
||||
* If erro, just log, drop and close, rpc-error should not be sent since it is not rpc
|
||||
* Actually, there are no error replies to hello messages according to any RFC, so
|
||||
* rpc error reply here is non-standard, but may be useful.
|
||||
*/
|
||||
x = NULL;
|
||||
while ((x = xml_child_each(xrpc, x, CX_ELMNT)) != NULL) {
|
||||
|
|
|
|||
|
|
@ -528,6 +528,7 @@ xmltree2cbuf(cbuf *cb,
|
|||
* therefore not well-formed.
|
||||
* Therefore checking for empty XML must be done by a calling function which knows wether the
|
||||
* the XML represents a full document or not.
|
||||
* @note may be called recursively, some yang-bind (eg rpc) semantic checks may trigger error message
|
||||
*/
|
||||
static int
|
||||
_xml_parse(const char *str,
|
||||
|
|
@ -855,8 +856,8 @@ clixon_xml_attr_copy(cxobj *xin,
|
|||
clicon_err(OE_XML, EINVAL, "xin or xout NULL");
|
||||
goto done;
|
||||
}
|
||||
if ((msgid = xml_find_value(xin, "message-id")) != NULL){
|
||||
if ((xa = xml_new("message-id", xout, CX_ATTR)) == NULL)
|
||||
if ((msgid = xml_find_value(xin, name)) != NULL){
|
||||
if ((xa = xml_new(name, xout, CX_ATTR)) == NULL)
|
||||
goto done;
|
||||
if (xml_value_set(xa, msgid) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue