[202511][cherry-pick] Add FRR failed route check in route_check.py (#4119)#4362
Merged
vmittal-msft merged 1 commit intosonic-net:202511from Mar 17, 2026
Merged
Conversation
What I did
It supports to detect the route with offload False or without offload, which can capture queued route, because queued route doesn’t have offload, but for rejected route, the offload is True. It can’t detect the rejected route.
So, we add a new detection check for the value of key failed for route entries, which can cover both rejected and queued routes.
It will help to detect rejected route and queued route on device.
How I did it
Append failed route prefix into failed list, if it's not empty, script will print error message into syslog
# Check for failed state
if entry.get('failed', False):
failed_rt.append(route_prefix)
How to verify it
For rejected route:
The output of route_check.py
Some routes have failed state in FRR : ['0.0.0.0/0', '192.168.128.0/25', '192.168.128.128/25', '192.168.136.0/25', '192.168.136.128/25', '192.168.144.0/25', '192.168.144.128/25', '192.168.152.0/25', '192.168.152.128/25', '192.168.160.0/25', '192.168.160.128/25', '192.168.168.0/25', '192.168.168.128/25', '192.168.176.0/25', '192.168.176.128/25', '192.168.184.0/25', '192.168.184.128/25', '192.168.192.0/25', '192.168.192.128/25', '192.168.200.0/25', '192.168.200.128/25', '192.168.208.0/25', '192.168.208.128/25', '192.168.216.0/25', '192.168.216.128/25', '192.168.224.0/25', '192.168.224.128/25', '192.168.232.0/25', '192.168.232.128/25', '192.168.240.0/25', '192.168.240.128/25', '192.168.248.0/25', '192.168.248.128/25', '192.169.0.0/25', '192.169.0.128/25', '192.169.104.0/25', '192.169.104.128/25', '192.169.112.0/25', '192.169.112.128/25', '192.169.120.0/25', '192.169.120.128/25', '192.169.128.0/25', '192.169.128.128/25', '192.169.136.0/25', '192.169.136.128/25', '192.169.144.0/25', '192.16
Failure results: {{
"": {
"failed_FRR_routes": [
"0.0.0.0/0",
"192.168.128.0/25",
"192.168.128.128/25",
"192.168.136.0/25",
"192.168.136.128/25",
"192.168.144.0/25",
"192.168.144.128/25",
"192.168.152.0/25",
"192.168.152.128/25",
"192.168.160.0/25",
"192.168.160.128/25",
"192.168.168.0/25",
"192.168.168.128/25",
"192.168.176.0/25",
"192.168.176.128/25",
"192.168.184.0/25",
"192.168.184.128/25",
"192.168.192.0/25",
"192.168.192.128/25",
"192.168.200.0/25",
"192.168.200.128/25",
"192.168.208.0/25",
"192.168.208.128/25",
"192.168.216.0/25",
"192.168.216.128/25",
"192.168.224.0/25",
"192.168.224.128/25",
"192.168.232.0/25",
"192.168.232
Failed. Look at reported mismatches above
For rejected route:
the output of route_check.py
Some routes have failed state in FRR : ['0.0.0.0/0', '192.168.128.0/25', '192.168.128.128/25', '192.168.136.0/25', '192.168.136.128/25', '192.168.144.0/25', '192.168.144.128/25', '192.168.152.0/25', '192.168.152.128/25', '192.168.160.0/25', '192.168.160.128/25', '192.168.168.0/25', '192.168.168.128/25', '192.168.176.0/25', '192.168.176.128/25', '192.168.184.0/25', '192.168.184.128/25', '192.168.192.0/25', '192.168.192.128/25', '192.168.200.0/25', '192.168.200.128/25', '192.168.208.0/25', '192.168.208.128/25', '192.168.216.0/25', '192.168.216.128/25', '192.168.224.0/25', '192.168.224.128/25', '192.168.232.0/25', '192.168.232.128/25', '192.168.240.0/25', '192.168.240.128/25', '192.168.248.0/25', '192.168.248.128/25', '192.169.0.0/25', '192.169.0.128/25', '192.169.104.0/25', '192.169.104.128/25', '192.169.112.0/25', '192.169.112.128/25', '192.169.120.0/25', '192.169.120.128/25', '192.169.128.0/25', '192.169.128.128/25', '192.169.136.0/25', '192.169.136.128/25', '192.169.144.0/25', '192.16
Failure results: {{
"": {
"missed_FRR_routes": [
{
"destSelected": true,
"distance": 20,
"failed": true,
"installedNexthopGroupId": 39146,
"internalFlags": 8,
"internalNextHopActiveNum": 4,
"internalNextHopNum": 4,
"internalStatus": 168,
"metric": 0,
"nexthopGroupId": 39146,
"nexthops": [
{
"active": true,
"afi": "ipv4",
"fib": true,
"flags": 3,
"interfaceIndex": 6,
"interfaceName": "PortChannel102",
"ip": "10.0.0.1",
"rmapSource": "10.1.0.32",
"weight": 1
},
{
"active": true,
Failed. Look at reported mismatches above
Signed-off-by: Priyansh Tratiya <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
vmittal-msft
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual Cherry-Pick: #4119
What I did
It supports to detect the route with offload False or without offload, which can capture queued route, because queued route doesn’t have offload, but for rejected route, the offload is True. It can’t detect the rejected route. So, we add a new detection check for the value of key failed for route entries, which can cover both rejected and queued routes. It will help to detect rejected route and queued route on device.
How I did it
Append failed route prefix into failed list, if it's not empty, script will print error message into syslog
How to verify it
For rejected route:
The output of route_check.py
Some routes have failed state in FRR : ['0.0.0.0/0', '192.168.128.0/25', '192.168.128.128/25', '192.168.136.0/25', '192.168.136.128/25', '192.168.144.0/25', '192.168.144.128/25', '192.168.152.0/25', '192.168.152.128/25', '192.168.160.0/25', '192.168.160.128/25', '192.168.168.0/25', '192.168.168.128/25', '192.168.176.0/25', '192.168.176.128/25', '192.168.184.0/25', '192.168.184.128/25', '192.168.192.0/25', '192.168.192.128/25', '192.168.200.0/25', '192.168.200.128/25', '192.168.208.0/25', '192.168.208.128/25', '192.168.216.0/25', '192.168.216.128/25', '192.168.224.0/25', '192.168.224.128/25', '192.168.232.0/25', '192.168.232.128/25', '192.168.240.0/25', '192.168.240.128/25', '192.168.248.0/25', '192.168.248.128/25', '192.169.0.0/25', '192.169.0.128/25', '192.169.104.0/25', '192.169.104.128/25', '192.169.112.0/25', '192.169.112.128/25', '192.169.120.0/25', '192.169.120.128/25', '192.169.128.0/25', '192.169.128.128/25', '192.169.136.0/25', '192.169.136.128/25', '192.169.144.0/25', '192.16 Failure results: {{
"": {
"failed_FRR_routes": [
"0.0.0.0/0",
"192.168.128.0/25",
"192.168.128.128/25",
"192.168.136.0/25",
"192.168.136.128/25",
"192.168.144.0/25",
"192.168.144.128/25",
"192.168.152.0/25",
"192.168.152.128/25",
"192.168.160.0/25",
"192.168.160.128/25",
"192.168.168.0/25",
"192.168.168.128/25",
"192.168.176.0/25",
"192.168.176.128/25",
"192.168.184.0/25",
"192.168.184.128/25",
"192.168.192.0/25",
"192.168.192.128/25",
"192.168.200.0/25",
"192.168.200.128/25",
"192.168.208.0/25",
"192.168.208.128/25",
"192.168.216.0/25",
"192.168.216.128/25",
"192.168.224.0/25",
"192.168.224.128/25",
"192.168.232.0/25",
"192.168.232
Failed. Look at reported mismatches above
For rejected route:
the output of route_check.py
Some routes have failed state in FRR : ['0.0.0.0/0', '192.168.128.0/25', '192.168.128.128/25', '192.168.136.0/25', '192.168.136.128/25', '192.168.144.0/25', '192.168.144.128/25', '192.168.152.0/25', '192.168.152.128/25', '192.168.160.0/25', '192.168.160.128/25', '192.168.168.0/25', '192.168.168.128/25', '192.168.176.0/25', '192.168.176.128/25', '192.168.184.0/25', '192.168.184.128/25', '192.168.192.0/25', '192.168.192.128/25', '192.168.200.0/25', '192.168.200.128/25', '192.168.208.0/25', '192.168.208.128/25', '192.168.216.0/25', '192.168.216.128/25', '192.168.224.0/25', '192.168.224.128/25', '192.168.232.0/25', '192.168.232.128/25', '192.168.240.0/25', '192.168.240.128/25', '192.168.248.0/25', '192.168.248.128/25', '192.169.0.0/25', '192.169.0.128/25', '192.169.104.0/25', '192.169.104.128/25', '192.169.112.0/25', '192.169.112.128/25', '192.169.120.0/25', '192.169.120.128/25', '192.169.128.0/25', '192.169.128.128/25', '192.169.136.0/25', '192.169.136.128/25', '192.169.144.0/25', '192.16 Failure results: {{
"": {
"missed_FRR_routes": [
{
"destSelected": true,
"distance": 20,
"failed": true,
"installedNexthopGroupId": 39146,
"internalFlags": 8,
"internalNextHopActiveNum": 4,
"internalNextHopNum": 4,
"internalStatus": 168,
"metric": 0,
"nexthopGroupId": 39146,
"nexthops": [
{
"active": true,
"afi": "ipv4",
"fib": true,
"flags": 3,
"interfaceIndex": 6,
"interfaceName": "PortChannel102",
"ip": "10.0.0.1",
"rmapSource": "10.1.0.32",
"weight": 1
},
{
"active": true,
Failed. Look at reported mismatches above
What I did
How I did it
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)