Skip to content

Set ietf-netconf-server idle-timeout to 0 will causes the client can not connected.([ERR]: LN: Session 2: Client <hello> timeout elapsed) libnetconf2 3.0.8 #459

@starx1000

Description

@starx1000

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:bugBug description.status:completedFrom the developer perspective, the issue was solved (bug fixed, question answered,...)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions