Hi,
In Libnetconf2 version Version 3.0.8.
when add <idle-timeout>0</idle-timeout> setting to ietf-netconf-server the client can not be connected,
the server will always report
[ERR]: LN: Session 2: Client <hello> timeout elapsed.
the reason is that in
|
timeout_io = server_opts.idle_timeout * 1000; |
timeout_io used the same value for ietf-netconf-server's idle-timeout value, if the idle_timeout set to 0, this timeout_io == 0,
causes the r = nc_read_msg_poll_io(session, timeout_io, &msg); Return immediately and failed.
As according to ietf-netconf-server.yang , 0 should be supported for never drops inactive client session.
Can you please have a look for this?
Maybe we can change it like this?
if(server_opts.idle_timeout ==0)
timeout_io = 180 * 1000; // 180 seconds default value
else
timeout_io = server_opts.idle_timeout * 1000;
or simply change to timeout_io = 180 * 1000; // 180 seconds default value ?
Will it block the server here forever if the client have no password action if set timeout_io to -1( permanent)?
References:
If set to zero, then the server
will never drop a session because it is idle.
leaf idle-timeout {
type uint16;
units "seconds";
default "180"; // three minutes
description
"Specifies the maximum number of seconds that a NETCONF
session may remain idle. A NETCONF session will be
dropped if it is idle for an interval longer than this
number of seconds. If set to zero, then the server
will never drop a session because it is idle.";
}
Detect session timeout:
|
(now_mono >= session->opts.server.last_rpc + (unsigned) server_opts.idle_timeout)) { |
XML configuration:
<netconf-server xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-server">
<listen>
<idle-timeout>0</idle-timeout>
<endpoints>
<endpoint>
<name>default-ssh</name>
Hi,
In Libnetconf2 version Version 3.0.8.
when add
<idle-timeout>0</idle-timeout>setting to ietf-netconf-server the client can not be connected,the server will always report
[ERR]: LN: Session 2: Client <hello> timeout elapsed.the reason is that in
libnetconf2/src/session.c
Line 1484 in d44d328
timeout_io used the same value for ietf-netconf-server's idle-timeout value, if the idle_timeout set to 0, this timeout_io == 0,
causes the
r = nc_read_msg_poll_io(session, timeout_io, &msg);Return immediately and failed.As according to ietf-netconf-server.yang , 0 should be supported for never drops inactive client session.
Can you please have a look for this?
Maybe we can change it like this?
or simply change to
timeout_io = 180 * 1000; // 180 seconds default value?Will it block the server here forever if the client have no password action if set timeout_io to -1( permanent)?
References:
libnetconf2/modules/ietf-netconf-server@2023-12-28.yang
Line 452 in d44d328
Detect session timeout:
libnetconf2/src/session_server.c
Line 1591 in d44d328
XML configuration: