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

bgpd: Fix "show bgp l2vpn evpn neighbors x.x.x.x advertised-routes json" #5078

Merged
merged 1 commit into from
Oct 16, 2019

Conversation

lkrishnamoor
Copy link
Contributor

@lkrishnamoor lkrishnamoor commented Sep 27, 2019

Fixed incorrect output that was shown (rib table previously) to show the output form adj_out.

Fixed crash on json output caused by writing null buffer to json_object. Null object was written by inet_ntop which returns null for any address family other than AF_INET or AF_INET6. (Provides fix for: #5010)

Before my fix:

leaf-1# sh bgp l2vpn evpn neighbors 203.0.113.2 advertised-routes json
vtysh: error reading from bgpd: Success (0)Warning: closing connection to bgpd because of an I/O error!
leaf-1#

After my fix: (modelled after sh ip bgp neighbors 203.0.113.2 advertised-routes json)

leaf-1# sh bgp l2vpn evpn neighbors 203.0.113.2 advertised-routes
BGP table version is 0, local router ID is 10.100.0.1
Default local pref 100, local AS 65000
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 10.100.0.2:2
*> [3]:[0]:[32]:[10.100.0.2]
                                           0 65002 i
Route Distinguisher: 10.101.1.2:2
*> [5]:[0]:[24]:[100.100.99.0]
                             0         32768 i
*> [5]:[0]:[25]:[100.100.99.0]
                             0         32768 i
*> [5]:[0]:[32]:[100.100.100.100]
                             0         32768 i
*> [5]:[0]:[64]:[111::]
                             0         32768 i
Route Distinguisher: 10.101.1.4:4
*> [5]:[0]:[24]:[100.100.99.0]
                                           0 65002 i
*> [5]:[0]:[32]:[200.200.200.200]
                                           0 65002 i

Total number of prefixes 7
leaf-1# sh bgp l2vpn evpn neighbors 203.0.113.2 advertised-routes json
{
  "bgpTableVersion":0,
  "bgpLocalRouterId":"10.100.0.1",
  "defaultLocPrf":100,
  "localAS":65000,
  "bgpStatusCodes":{
    "suppressed":"s",
    "damped":"d",
    "history":"h",
    "valid":"*",
    "best":">",
    "internal":"i"
  },
  "bgpOriginCodes":{
    "igp":"i",
    "egp":"e",
    "incomplete":"?"
  },
  "advertisedRoutes":{
    "10.100.0.2:2":{
      "rd":"10.100.0.2:2",
      "[3]:[10.100.0.2]\/288":{
        "routeType":3,
        "ethTag":0,
        "ipLen":32,
        "ip":"10.100.0.2",
        "nextHop":"10.100.0.2",
        "weight":0,
        "asPath":"65002",
        "path":"65002",
        "bgpOriginCode":"i",
        "appliedStatusSymbols":{
          "*":true,
          ">":true
        }
      }
    },
    "10.101.1.2:2":{
      "rd":"10.101.1.2:2",
      "[5]:[0][100.100.99.0\/24]\/288":{
        "nextHop":"10.100.0.1",
        "metric":0,
        "weight":32768,
        "asPath":"",
        "path":"",
        "bgpOriginCode":"i",
        "appliedStatusSymbols":{
          "*":true,
          ">":true
        }
      },
      "[5]:[0][100.100.99.0\/25]\/288":{
        "nextHop":"10.100.0.1",
        "metric":0,
        "weight":32768,
        "asPath":"",
        "path":"",
        "bgpOriginCode":"i",
        "appliedStatusSymbols":{
          "*":true,
          ">":true
        }
      },
      "[5]:[0][100.100.100.100\/32]\/288":{
        "nextHop":"10.100.0.1",
        "metric":0,
        "weight":32768,
        "asPath":"",
        "path":"",
        "bgpOriginCode":"i",
        "appliedStatusSymbols":{
          "*":true,
          ">":true
        }
      },
      "[5]:[0][111::\/64]\/288":{
        "nextHop":"10.100.0.1",
        "metric":0,
        "weight":32768,
        "asPath":"",
        "path":"",
        "bgpOriginCode":"i",
        "appliedStatusSymbols":{
          "*":true,
          ">":true
        }
      }
    },
    "10.101.1.4:4":{
      "rd":"10.101.1.4:4",
      "[5]:[0][100.100.99.0\/24]\/288":{
        "nextHop":"10.100.0.2",
        "weight":0,
        "asPath":"65002",
        "path":"65002",
        "bgpOriginCode":"i",
        "appliedStatusSymbols":{
          "*":true,
          ">":true
        }
      },
      "[5]:[0][200.200.200.200\/32]\/288":{
        "nextHop":"10.100.0.2",
        "weight":0,
        "asPath":"65002",
        "path":"65002",
        "bgpOriginCode":"i",
        "appliedStatusSymbols":{
          "*":true,
          ">":true
        }
      }
    }
  },
  "totalPrefixCounter":7
}
leaf-1#

Signed-off-by: Lakshman Krishnamoorthy [email protected]

Copy link

@polychaeta polychaeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to FRR!

  • One of your commits has an improperly formatted commit message

If you are a new contributor to FRR, please see our contributing guidelines.

lkrishnamoor added a commit to lkrishnamoor/frr that referenced this pull request Sep 27, 2019
Display output from adj_out instead of the rib table.

Also fixes crash for the json output. RCA: prefix is written to json object
using inet_ntop. But, this api returns null buffer for AF_EVPN address family
(it works only for AF_INET and AF_INET6).  This null buffer is then deref'd
by json-object-to string api.

Full output shown in PR: FRRouting#5078
Crash issue: FRRouting#5010

Signed-off-by: Lakshman Krishnamoorthy <[email protected]>
… json

Display output from adj_out instead of the rib table.

Also fixes crash for the json output. RCA: prefix is written to json object
using inet_ntop. But, this api returns null buffer for AF_EVPN address family
(it works only for AF_INET and AF_INET6).  This null buffer is then deref'd
by json-object-to string api.

Full output shown in PR: FRRouting#5078
Crash issue: FRRouting#5010

Signed-off-by: Lakshman Krishnamoorthy <[email protected]>
@LabN-CI
Copy link
Collaborator

LabN-CI commented Sep 27, 2019

🚧 Basic BGPD CI results: Partial FAILURE, 1 tests failed

Results table
_ _
Result SUCCESS git merge/5078 e47536a
Date 09/27/2019
Start 15:00:33
Finish 16:43:08
Run-Time 01:42:35
Total 1815
Pass 1814
Fail 1
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-09-27-15:00:33.txt
Log autoscript-2019-09-27-15:01:25.log.bz2
Memory 436 368 359

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9071/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotest tests on Ubuntu 16.04 i386: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPOI386-9071/test

Topology Tests failed for Topotest tests on Ubuntu 16.04 i386:

RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
*** defaultIntf: warning: r1 has no interfaces
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument
RTNETLINK answers: Invalid argument

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9071/artifact/TOPOI386/ErrorLog/log_topotests.txt

Topology tests on Ubuntu 16.04 amd64: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPOU1604-9071/test

Topology Tests failed for Topology tests on Ubuntu 16.04 amd64:

*** defaultIntf: warning: r1 has no interfaces

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9071/artifact/TOPOU1604/ErrorLog/log_topotests.txt

Topology tests on Ubuntu 18.04 amd64: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPOU1804-9071/test

Topology Tests failed for Topology tests on Ubuntu 18.04 amd64:

*** defaultIntf: warning: r1 has no interfaces

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9071/artifact/TOPOU1804/ErrorLog/log_topotests.txt

Successful on other platforms
  • IPv4 ldp protocol on Ubuntu 16.04
  • Debian 10 deb pkg check
  • Ubuntu 14.04 deb pkg check
  • CentOS 7 rpm pkg check
  • Addresssanitizer topotest
  • Debian 8 deb pkg check
  • IPv4 protocols on Ubuntu 14.04
  • Debian 9 deb pkg check
  • Ubuntu 12.04 deb pkg check
  • Fedora 29 rpm pkg check
  • Static analyzer (clang)
  • IPv6 protocols on Ubuntu 14.04
  • Ubuntu 16.04 deb pkg check

Topology Tests memory analysis: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9071/artifact/TOPOI386/MemoryLeaks/
Topology Tests memory analysis: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9071/artifact/TOPOU1604/MemoryLeaks/
Topology Tests memory analysis: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9071/artifact/TOPOU1804/MemoryLeaks/

CLANG Static Analyzer Summary

  • Github Pull Request 5078, comparing to Git base SHA 5c256b5

No Changes in Static Analysis warnings compared to base

1 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9071/artifact/shared/static_analysis/index.html

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9072/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


CLANG Static Analyzer Summary

  • Github Pull Request 5078, comparing to Git base SHA 5c256b5

No Changes in Static Analysis warnings compared to base

1 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9072/artifact/shared/static_analysis/index.html

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9073/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


CLANG Static Analyzer Summary

  • Github Pull Request 5078, comparing to Git base SHA 5c256b5

No Changes in Static Analysis warnings compared to base

1 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9073/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Collaborator

LabN-CI commented Sep 27, 2019

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/5078 dc387b0
Date 09/27/2019
Start 16:45:30
Finish 17:07:17
Run-Time 21:47
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-09-27-16:45:30.txt
Log autoscript-2019-09-27-16:46:24.log.bz2
Memory 433 427 360

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9074/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


CLANG Static Analyzer Summary

  • Github Pull Request 5078, comparing to Git base SHA 5c256b5

No Changes in Static Analysis warnings compared to base

1 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9074/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Collaborator

LabN-CI commented Sep 28, 2019

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/5078 dc387b0
Date 09/28/2019
Start 12:20:30
Finish 12:42:14
Run-Time 21:44
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-09-28-12:20:30.txt
Log autoscript-2019-09-28-12:21:20.log.bz2
Memory 424 415 360

For details, please contact louberger

@donaldsharp donaldsharp self-requested a review October 15, 2019 15:28
@riw777 riw777 self-requested a review October 15, 2019 15:28
@srimohans
Copy link
Contributor

@riw777 @donaldsharp Can one of you finish your review for this ?

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks fine

@riw777 riw777 merged commit 7188041 into FRRouting:master Oct 16, 2019
SumitAgarwal123 pushed a commit to SumitAgarwal123/frr that referenced this pull request Nov 19, 2019
… json

Display output from adj_out instead of the rib table.

Also fixes crash for the json output. RCA: prefix is written to json object
using inet_ntop. But, this api returns null buffer for AF_EVPN address family
(it works only for AF_INET and AF_INET6).  This null buffer is then deref'd
by json-object-to string api.

Full output shown in PR: FRRouting#5078
Crash issue: FRRouting#5010

Signed-off-by: Lakshman Krishnamoorthy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants