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: [7.5] Backport maximum-prefix and show bgp neighbor routes for LU fixes #7291

Merged
merged 2 commits into from
Oct 13, 2020
Merged

bgpd: [7.5] Backport maximum-prefix and show bgp neighbor routes for LU fixes #7291

merged 2 commits into from
Oct 13, 2020

Commits on Oct 13, 2020

  1. bgpd: Correctly calculate threshold being reached

    if (pcout > (pcount * peer->max_threshold[afi][safi] / 100 ))
    is always true.  So the very first route received will always
    trigger the warning.  We actually want the warning to happen
    when we hit the threshold.
    
    Signed-off-by: Donald Sharp <sharpd@nvidia.com>
    donaldsharp authored and ton31337 committed Oct 13, 2020
    Configuration menu
    Copy the full SHA
    b61afc4 View commit details
    Browse the repository at this point in the history
  2. bgpd: fix show bgp neighbor routes for labeled-unicast

    bgp_show_neighbor_route() was rewriting safi from LU to uni
    before checking if the peer was enabled for LU.  This resulted
    in the peer's address-family check looking for unicast, which
    would always fail for LU peers since unicast + LU are
    mutually-exclusive AFIs.
    This moves this safi reassignment after the peer AFI check,
    ensuring that the peer's address-family check looks for LU
    while the call to bgp_show() still uses uni.
    
    -- highlights from manual testing
    
    config:
    
    router bgp 2
     neighbor 1.1.1.1 remote-as external
     neighbor 1.1.1.1 disable-connected-check
     neighbor 1.1.1.1 update-source 2.2.2.2
     !
     address-family ipv4 unicast
      no neighbor 1.1.1.1 activate
     exit-address-family
     !
     address-family ipv4 labeled-unicast
      neighbor 1.1.1.1 activate
     exit-address-family
    
    before:
    
    spine01# show bgp ipv4 unicast neighbors 1.1.1.1 routes
    % No such neighbor or address family
    spine01# show bgp ipv4 labeled-unicast neighbors 1.1.1.1 routes
    % No such neighbor or address family
    
    after:
    
    spine01# show bgp ipv4 unicast neighbors 1.1.1.1 routes
    % No such neighbor or address family
    spine01# show bgp ipv4 label neighbors 1.1.1.1 routes
    BGP table version is 1, local router ID is 2.2.2.2
    Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
                  i internal, r RIB-failure, S Stale, R Removed
    Origin codes: i - IGP, e - EGP, ? - incomplete
       Network          Next Hop            Metric LocPrf Weight Path
    *> 11.11.11.11/32   1.1.1.1                  0             0 1 i
    Displayed  1 routes and 1 total paths
    
    Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
    Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
    Trey Aspelund authored and ton31337 committed Oct 13, 2020
    Configuration menu
    Copy the full SHA
    9a4f152 View commit details
    Browse the repository at this point in the history