From 85c6c119704ba35c3c419b79329d5a9d8af31946 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 17 Mar 2022 20:29:41 +0100 Subject: [PATCH] * Netconf: Disabled default announcing of Netconf 1.1, instead only announce 1.0 * See [Clixon does not switch to chunked framing after NETCONF 1.1 is negotiated](https://github.com/clicon/clixon/issues/314) * To enable Netconf 1.1, set `NETCONF_1_1_ANNOUNCE` --- CHANGELOG.md | 3 +++ include/clixon_custom.h | 7 +++++++ lib/src/clixon_netconf_lib.c | 2 ++ 3 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35649cc3..68c191e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ Expected: May 2022 Users may have to change how they access the system +* Netconf: Disabled default announcing of Netconf 1.1, instead only announce 1.0 + * See [Clixon does not switch to chunked framing after NETCONF 1.1 is negotiated](https://github.com/clicon/clixon/issues/314) + * To enable Netconf 1.1, set `NETCONF_1_1_ANNOUNCE` * Netconf data-not-unique info changed to return schema nodes instead of XML for RFC7950 compliance * CLI reconnects to backend if backend restarts with a warning * Note that edits to the candidate database or locks will be lost diff --git a/include/clixon_custom.h b/include/clixon_custom.h index aad8a351..f316aee4 100644 --- a/include/clixon_custom.h +++ b/include/clixon_custom.h @@ -156,3 +156,10 @@ * If not set, client will exit */ #define PROTO_RESTART_RECONNECT + +/*! Announce Netconf 1.1 capability as defined by RFC 6242 + * Problem wih 1.1 is it requires "chunked framing" which Clixon at this point does not + * support. + * See https://github.com/clicon/clixon/issues/50 and https://github.com/clicon/clixon/issues/314 + */ +#undef NETCONF_1_1_ANNOUNCE diff --git a/lib/src/clixon_netconf_lib.c b/lib/src/clixon_netconf_lib.c index 4c3c89b1..bfbb4e09 100644 --- a/lib/src/clixon_netconf_lib.c +++ b/lib/src/clixon_netconf_lib.c @@ -1691,10 +1691,12 @@ netconf_hello_server(clicon_handle h, cprintf(cb, "", NETCONF_BASE_NAMESPACE, 42); cprintf(cb, ""); +#ifdef NETCONF_1_1_ANNOUNCE /* Each peer MUST send at least the base NETCONF capability, "urn:ietf:params:netconf:base:1.1" * RFC 6241 Sec 8.1 */ cprintf(cb, "%s", NETCONF_BASE_CAPABILITY_1_1); +#endif /* A peer MAY include capabilities for previous NETCONF versions, to indicate that it supports multiple protocol versions. */ cprintf(cb, "%s", NETCONF_BASE_CAPABILITY_1_0);