Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed JSON output on "show ip prefix-list" command #15277

Closed
2 tasks done
fdomain opened this issue Feb 1, 2024 · 4 comments
Closed
2 tasks done

Malformed JSON output on "show ip prefix-list" command #15277

fdomain opened this issue Feb 1, 2024 · 4 comments
Labels
triage Needs further investigation

Comments

@fdomain
Copy link

fdomain commented Feb 1, 2024


Describe the bug
This is a new issue following #15177 because the original issue has been closed prematurely.

JSON output from "show ip prefix-list <prefix_list_name> json" is not valid:
There are 2 consecutive JSON objects concatenated, one from the Zebra perspective, and another one for BGP, making the output invalid for a JSON parser.

  • Did you check if this is a duplicate issue?
  • Did you test it on the latest FRRouting/frr master branch? (tested on stable/9.1)

To Reproduce

  1. Define a prefix-lsit
ip prefix-list PF-NET1 seq 5 permit 10.0.0.0/24
  1. Run the following "show ip prefix-list json"
{
  "ZEBRA":{
    "PF-NET1":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":5,
          "type":"permit",
          "prefix":"10.0.0.0/24"
        }
      ]
    }
  }
}
{
  "BGP":{
    "PF-NET1":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":5,
          "type":"permit",
          "prefix":"10.0.0.0/24"
        }
      ]
    }
  }
}

Expected behavior

{
  "ZEBRA": {
    "PF-NET1": {
      "addressFamily": "IPv4",
      "entries": [
        {
          "sequenceNumber": 5,
          "type": "permit",
          "prefix": "10.0.0.0/24"
        }
      ]
    }
  },
  "BGP": {
    "PF-NET1": {
      "addressFamily": "IPv4",
      "entries": [
        {
          "sequenceNumber": 5,
          "type": "permit",
          "prefix": "10.0.0.0/24"
        }
      ]
    }
  }
}

Screenshots

Versions

  • OS Version: Debian 22.04
  • Kernel: 6.1.71
  • FRR Version: 9.1

Additional context

@fdomain fdomain added the triage Needs further investigation label Feb 1, 2024
@fdomain
Copy link
Author

fdomain commented Feb 1, 2024

I believe the issue might be also present on another "show" commands. As said in #15177 by @donaldsharp it has been fixed for route-map only with the following PR #14856.

@donaldsharp
Copy link
Member

As a note all show ip prefix-list [detail|summary] json are broken and all need to be fixed.

@fdomain
Copy link
Author

fdomain commented Apr 15, 2024

I found a workaround by connecting vtysh only to the bgpd daemon, that way we don't output the zebra definition:

# sudo vtysh -d bgpd
rtr# show ip prefix-list PF-TEST json 
{
  "BGP":{
    "PF-TEST":{
      "addressFamily":"IPv4",
      "entries":[
        {
          "sequenceNumber":5,
          "type":"permit",
          "prefix":"10.0.0.0/8"
        }
      ]
    }
  }
}

@ton31337
Copy link
Member

ton31337 commented Jul 3, 2024

Fixed already, closing.

@ton31337 ton31337 closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

3 participants