Skip to content

pathd: some nodes not displayed in show yang operational-data /frr-pathd:pathd/srte pathd #20615

@hedrok

Description

@hedrok

Description

/frr-pathd:pathd/srte/segment-list is not displayed in output of command show yang operational-data /frr-pathd:pathd/srte pathd, though /frr-pathd:pathd/srte/policy is.

Version

r1# show version
FRRouting 10.6-dev (r1) on Linux(6.6.117-vyos).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
    '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--sbindir=/usr/lib/frr' '--with-vtysh-pager=/usr/bin/pager' '--libdir=/usr/lib/x86_64-linux-gnu/frr' '--with-moduledir=/usr/lib/x86_64-linux-gnu/frr/modules' '--disable-dependency-tracking' '--enable-rpki' '--enable-scripting' '--enable-pim6d' '--disable-grpc' '--with-libpam' '--enable-doc' '--enable-doc-html' '--enable-snmp' '--enable-fpm' '--disable-protobuf' '--disable-zeromq' '--enable-ospfapi' '--enable-bgp-vnc' '--enable-multipath=256' '--enable-user=frr' '--enable-group=frr' '--enable-vty-group=frrvty' '--enable-configfile-mask=0640' '--enable-logfile-mask=0640' '--enable-pcre2posix' 'build_alias=x86_64-linux-gnu'

How to reproduce

Add

segment-routing
 traffic-eng
  mpls-te on
  segment-list testing-segment-list
   index 0 mpls label 1000
   index 0 nai adjacency 192.168.0.1 192.168.0.2
  exit
  policy color 57 endpoint 192.168.0.7
  exit
 exit
exit

To FRR config, reload, run:

vtysh -c 'show yang operational-data /frr-pathd:pathd/srte pathd'

Expected behavior

All segment-list and policy data is shown as output of command.

Actual behavior

Only policy data is displayed:

vyos@r1:~$ vtysh -c 'show yang operational-data /frr-pathd:pathd/srte pathd'
{
  "frr-pathd:pathd": {
    "srte": {
      "policy": [
        {
          "color": 57,
          "endpoint": "192.168.0.7",
          "is-operational": false
        }
      ]
    }
  }
}

Additional context

I've also added a little debug code to see that node /frr-pathd:pathd/srte/segment-list really exists.
I've added at the beginning of config_write_segment_routing (pathd/path_cli.c):

	size_t i;
	const char *paths_to_check[] = {
		"/frr-pathd:pathd/srte",
		"/frr-pathd:pathd/srte/segment-list",
		"/frr-pathd:pathd/srte/policy",
		"/frr-pathd:pathd/srte/blabla",
	};

#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
	for (i = 0; i < ARRAY_SIZE(paths_to_check); i++) {
		if (yang_dnode_exists(running_config->dnode, paths_to_check[i]))
			zlog_notice("HEDROK config_write_segment_routing: we have the node '%s'!", paths_to_check[i]);
		else
			zlog_notice("HEDROK config_write_segment_routing, no such node '%s'!", paths_to_check[i]);
	}

So it is executed each time write terminal is run in vtysh.
Result in logs:

vyos@r1:~$ journalctl -g HEDROK -u frr
...
Jan 28 21:03:51 r1 pathd[5431]: HEDROK config_write_segment_routing: we have the node '/frr-pathd:pathd/srte'!
Jan 28 21:03:51 r1 pathd[5431]: HEDROK config_write_segment_routing: we have the node '/frr-pathd:pathd/srte/segment-list'!
Jan 28 21:03:51 r1 pathd[5431]: HEDROK config_write_segment_routing: we have the node '/frr-pathd:pathd/srte/policy'!
Jan 28 21:03:51 r1 pathd[5431]: HEDROK config_write_segment_routing, no such node '/frr-pathd:pathd/srte/blabla'!

Checklist

  • I have searched the open issues for this bug.
  • I have not included sensitive information in this report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNeeds further investigation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions