From bd9faf298ae0d8525080b605a571fd7a9edb516c Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 9 May 2019 13:53:41 +0200 Subject: Don't treat reception of NETCONF > 1.0 hello as error Module ct_netconfc appears to have followed the introduction of NETCONF 1.1 in RFC 6241, but assumes NETCONF 1.0 (RFC 4741). A server supporting the 1.1 can send the corresponding base capability in hello, which caused ct_netconfc to close the connection. Now simply ignore any version but 1.0, and fail only if the server doesn't advertise 1.0. Actual support for 1.1 is still missing: being able to agree on this version with the peer and receive messages that are chunked as specified in RFC 6242. --- lib/common_test/src/ct_netconfc.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/common_test/src/ct_netconfc.erl b/lib/common_test/src/ct_netconfc.erl index 6a758c4ea3..37e9555343 100644 --- a/lib/common_test/src/ct_netconfc.erl +++ b/lib/common_test/src/ct_netconfc.erl @@ -1,7 +1,7 @@ %%---------------------------------------------------------------------- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2012-2017. All Rights Reserved. +%% Copyright Ericsson AB 2012-2019. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -1545,12 +1545,12 @@ decode_hello({hello,_Attrs,Hello}) -> {error,{incorrect_hello,no_session_id_found}} end. -decode_caps([{capability,[],[?NETCONF_BASE_CAP++Vsn=Cap]} |Caps], Acc, _) -> +decode_caps([{capability,[],[?NETCONF_BASE_CAP++Vsn=Cap]} |Caps], Acc, Base) -> case Vsn of ?NETCONF_BASE_CAP_VSN -> decode_caps(Caps, [Cap|Acc], true); - _ -> - {error,{incompatible_base_capability_vsn,Vsn}} + _ -> %% unsupported version: discard + decode_caps(Caps, Acc, Base) end; decode_caps([{capability,[],[Cap]}|Caps],Acc,Base) -> decode_caps(Caps,[Cap|Acc],Base); -- cgit v1.2.1