diff options
author | Anders Svensson <anders@erlang.org> | 2019-05-09 13:53:41 +0200 |
---|---|---|
committer | Anders Svensson <anders@erlang.org> | 2019-05-16 16:04:27 +0200 |
commit | bd9faf298ae0d8525080b605a571fd7a9edb516c (patch) | |
tree | 759436654d8a4389bcefcebcd830451971a54388 | |
parent | 620ac3e68c5bc8b36143965fcf2892a07dc005c4 (diff) | |
download | erlang-bd9faf298ae0d8525080b605a571fd7a9edb516c.tar.gz |
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.
-rw-r--r-- | lib/common_test/src/ct_netconfc.erl | 8 |
1 files 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); |