Skip to content

[202511][cherry-pick] Add FRR failed route check in route_check.py (#4119)#4362

Merged
vmittal-msft merged 1 commit intosonic-net:202511from
PriyanshTratiya:cherry-pick-4119-to-202511
Mar 17, 2026
Merged

[202511][cherry-pick] Add FRR failed route check in route_check.py (#4119)#4362
vmittal-msft merged 1 commit intosonic-net:202511from
PriyanshTratiya:cherry-pick-4119-to-202511

Conversation

@PriyanshTratiya
Copy link

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

    # 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

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)

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]>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vmittal-msft vmittal-msft enabled auto-merge (squash) March 17, 2026 00:06
@vmittal-msft vmittal-msft merged commit 8936c06 into sonic-net:202511 Mar 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants