Merge pull request #20647 from LabNConsulting/chopps/improve-op-state-change-notifyFixes for op-state change notifications being sent to backend clients (daemons)
tests: add test for update-groups JSON timer fieldsAdd test to verify that 'show bgp update-groups json' command returns
the new grpCreateTimeStr and subGrpCreateTimeStr fields in
dd:hh:mm:ss format.
Signed-off-by: Soumya Roy <souroy@nvidia.com>
lib,bgpd: Adding JSON str for time in dd:hh:mm:ss formatIssue:
We don't have uptime JSON output in 'dd:hh:mm:ss' format for few of the
vtysh show bgp commands.
Fix:
- commom api is implemented to calculate the uptimes and convert it
into dd:hh:mm:ss display format.
- added a JOSN attribute for dd:hh:mm:ss format.
- common api is replaced for bfd last update time convertion.
Testing:
subGrpCreateTimeStr":"0:01:39:41",
Commands supported:
...
bgpd: Missing large community value in commAttriSentToNbr JSONThe operational value of send-community large is not being populated in JSON
by FRR.
This fix accommodates the large string in commAttriSentToNbr if large
send-community is present.
Before FIX:
$ sudo -S vtysh -c "show bgp vrf default neighbors 150.1.2.20 json" |
grep 'commAttriSentToNbr'
"commAttriSentToNbr":"extendedAndStandard",
AFTER FIX:
$ sudo -S vtysh -c "show bgp vrf de...
tests: add test for commAttriSentToNbr JSON fieldAdd test to verify that the commAttriSentToNbr field in
'show bgp neighbors json' output correctly includes large
community when send-community large is enabled.
Signed-off-by: Soumya Roy <souroy@nvidia.com>
bgpd: Replace 3 with BGP_ALLOWAS_IN_DEFAULT constantWe were setting a default value to 3 if "origin" or an arbitraty (1-10) number
is omitted.
It was a bit confusing to read in neighbor_allowas_in_cmd because we expected
idx for a value also be on the third position.
Let's improve the readability.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: use BGP_PATH_INFO_NUM_LABELS macro in bgp_evpn_path_info_get_l3vniCommit a932abc105b5 ("bgpd: do not crash when labels are empty")
attempted to fix a crash by adding a NULL check on the return value
of bgp_evpn_path_info_labels_get_l3vni(). However, this still accesses
pi->extra->labels->label without first verifying that pi->extra->labels
is non-NULL, which can lead to a crash.
Use the BGP_PATH_INFO_NUM_LABELS() macro as a guard instead, which
properly vali...
lib: Utility function to convert monotime to epochAdded a utility function to convert time_t to epoch.
Issue:3624937
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
tests: add test for show bgp router json new fieldsAdd test to verify that 'show bgp router json' command returns
the new fields: bgpGShutEnabled, bgpWaitForFibSet, bgpInputQueueLimit,
bgpOutputQueueLimit, bgpUpdateDelayTime, bgpEstablishWaitTime.
Signed-off-by: Soumya Roy <souroy@nvidia.com>
bgpd: improve show bgp router output descriptions and timer infoUse descriptive text for non-JSON output: 'BGP Graceful Shutdown'
instead of 'GSHUT', 'suppress FIB pending' with spaces. Rename
bgpRMapDelayTimer to bgpRmapDelayTimer and add remaining time
display for route-map delay timer when active.
Signed-off-by: Soumya Roy <souroy@nvidia.com>
bgpd: Fix double-free crash in peer_delete() during doppelganger peer transferIn peer_xfer_conn(), the hostname, domainname, and soft_version pointers
were transferred between peers using simple pointer assignment, which
caused both peers to reference the same memory. If the transfer didn't
complete cleanly or there was a race condition during peer state
transitions, when both peers were eventually deleted, the same memory
was freed twice, causing a crash.
Fix this by u...
mgmtd: fix and improve the diagnostic show backend registry command- Adapt the command to the new notify selectors.
- Also trying to use this show command in an actual test exposed it's less than
optimal design. Change the output format to be grep-able.
Signed-off-by: Christian Hopps <chopps@labn.net>
mgmtd: send notify-selectors on daemon connect/subscribe- This allows the daemon to re-notify it's operations state which matches the
notify selectors. This state may have changed while the daemon was disconnected.
- Remove the daemon's notify_seletors on disconnect, as they will be added back
on reconnect, and this also keeps us from superfluously tracking changes to
notify no-one.
- In BE client code use the oper-state xpath registrations to fil...
mgmtd: switch ns_string to IDs for use by front and back-end- We now associate both FE sessions and BE clients using IDs with
subscription to datastore oper-state notifications.
- Move BE to use FE ns_string for notifications
Signed-off-by: Christian Hopps <chopps@labn.net>
mgmtd: modify front end session-id range- reserve 0-1000 for other uses (e.g., backend client IDs)
- deal with ID wrapping, even if it seems pathological.
Signed-off-by: Christian Hopps <chopps@labn.net>
tests: log test start, end and result to all log filesLog TEST-START, TEST-END and TEST-RESULT to the all log files. We use the vtysh
command `send log ...` to enter the log in all the daemon log files. As a result
of running the command the messages also get logged in the router log and in the
exec.log as well.
logs:
- exec.log
- <router>.log
- <router>/<daemon>.log
Also log when doing the extra checks (valgrind memleaks, cores, memleaks)...