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: per-neighbor dampening support #15911

Merged

Commits on May 3, 2024

  1. bgpd: vtysh commands for peer/group dampening profiles

    Additional cli commands to add dampening profiles to peers / peer groups
    and functions to save dampening configurations.
    
    Signed-off-by: David Schweizer <[email protected]>
    davischw authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    255b392 View commit details
    Browse the repository at this point in the history
  2. bgpd: peer / peer group dampening profiles

    Changes implement dampening profiles for peers and peer groups. This is
    achieved by introducing the possibility to have multible existing
    dampening configurations with their own sets of parameters and lists of
    associated paths.
    
    Signed-off-by: Rafael Zalamena <[email protected]>
    Signed-off-by: David Schweizer <[email protected]>
    davischw authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    22473c4 View commit details
    Browse the repository at this point in the history
  3. bgpd: Do not output peer doppleganger dampened output

    When we are cycling through all peers and looking for
    dampening data to dump, do not consider non-configed
    peers( dopplegangers ).
    
    Signed-off-by: Donald Sharp <[email protected]>
    donaldsharp authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    b29ef10 View commit details
    Browse the repository at this point in the history
  4. bgpd: clear ip bgp dampening was not triggering the route calculation…

    … for the prefix
    
    Description:
        clear ip bgp dampening was not triggering the route
        calculation for the prefix, Due to this prefix are not install in
        RIB(Zebra) and not adv to neighbor
    
    Problem Description/Summary :
        clear ip bgp dampening was not triggering the route
        calculation for the prefix, Due to this prefix are not install in
        RIB(Zebra) and not adv to neighbor
    
        Fix: When clear ip bgp dampening, route are put for route-calculation as
        that it is install in the Zebra and adv to neighbor.
    
    Signed-off-by: sudhanshukumar22 <[email protected]>
    sudhanshukumar22 authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    debe0f5 View commit details
    Browse the repository at this point in the history
  5. bgpd: Remove useless reuselist_node assignment before while loop

    Seems really not necessary pointing to initial value before while loop, where
    it's assigned anyway.
    
    Signed-off-by: Donatas Abraitis <[email protected]>
    ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    6b3486b View commit details
    Browse the repository at this point in the history
  6. bgpd: fix double free in dampening code

    bgp_damp_info_unclaim already calls bgp_reuselist_del. We must not call
    it again here.
    
    Fixes FRRouting#9046.
    
    Signed-off-by: Igor Ryzhov <[email protected]>
    idryzhov authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    a1e49ec View commit details
    Browse the repository at this point in the history
  7. bgpd: Drop double-pointer for bgp_damp_info_free()

    This causes a crash using `clear ip bgp dampening <prefix>`.
    
    Signed-off-by: Donatas Abraitis <[email protected]>
    Signed-off-by: Donatas Abraitis <[email protected]>
    ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    391b4fa View commit details
    Browse the repository at this point in the history
  8. bgpd: fix missing list add in dampening

    One more crash in dampening code...
    
    When bgp_damp_withdraw is called, if there's already a BDI structure,
    bgp_damp_info_claim is called to re-assign the bdi->config in case it
    was changed. The problem is that bgp_damp_info_claim actually removes
    the BDI from the reuse list of the old config and never adds it to the
    reuse list of the new config. We must do this to prevent the crash
    because all the code assumes that BDI is always in some list.
    
    Signed-off-by: Igor Ryzhov <[email protected]>
    idryzhov authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    4c500d6 View commit details
    Browse the repository at this point in the history
  9. bgpd: fix incorrect usage of slist in dampening

    Current code is a complete misuse of SLIST structure. Instead of just
    adding a SLIST_ENTRY to struct bgp_damp_info, it allocates a separate
    structure to be a node in the list.
    
    Signed-off-by: Igor Ryzhov <[email protected]>
    idryzhov authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    1d37871 View commit details
    Browse the repository at this point in the history
  10. bgpd: cleanup bgp_damp_info_free

    bgp_damp_config, afi and safi are never used.
    
    Signed-off-by: Igor Ryzhov <[email protected]>
    Signed-off-by: Donatas Abraitis <[email protected]>
    idryzhov authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    ad97cd0 View commit details
    Browse the repository at this point in the history
  11. bgpd: fix missing damp info free when cleaning bgp path

    Signed-off-by: Igor Ryzhov <[email protected]>
    idryzhov authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    471e373 View commit details
    Browse the repository at this point in the history
  12. bgpd: Use SLIST_FOREACH_SAFE when iterating over the list in bgp_reus…

    …e_timer
    
    Signed-off-by: Donatas Abraitis <[email protected]>
    ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    f8e6b7c View commit details
    Browse the repository at this point in the history
  13. bgpd: Pass the right reuse_list when handling it via bgp_reuse_timer …

    …thread
    
    This fixes the crash:
    
    ```
    ==14759== Invalid read of size 8
    ==14759==    at 0x31032B: bgp_reuselist_del (bgp_damp.c:51)
    ==14759==    by 0x310392: bgp_damp_info_unclaim (bgp_damp.c:69)
    ==14759==    by 0x310CD6: bgp_damp_info_free (bgp_damp.c:387)
    ==14759==    by 0x311016: bgp_reuse_timer (bgp_damp.c:230)
    ==14759==    by 0x4F227CC: thread_call (thread.c:2008)
    ==14759==    by 0x4EDB7D7: frr_run (libfrr.c:1216)
    ==14759==    by 0x1EF748: main (bgp_main.c:525)
    ==14759==  Address 0x48 is not stack'd, malloc'd or (recently) free'd
    ==14759==
    ==14759==
    ==14759== Process terminating with default action of signal 11 (SIGSEGV)
    ==14759==    at 0x59CC7F5: raise (raise.c:46)
    ==14759==    by 0x4F10CEB: core_handler (sigevent.c:261)
    ==14759==    by 0x59CC97F: ??? (in /lib/x86_64-linux-gnu/libpthread-2.27.so)
    ==14759==    by 0x31032A: bgp_reuselist_del (bgp_damp.c:51)
    ==14759==    by 0x310392: bgp_damp_info_unclaim (bgp_damp.c:69)
    ==14759==    by 0x310CD6: bgp_damp_info_free (bgp_damp.c:387)
    ==14759==    by 0x311016: bgp_reuse_timer (bgp_damp.c:230)
    ==14759==    by 0x4F227CC: thread_call (thread.c:2008)
    ==14759==    by 0x4EDB7D7: frr_run (libfrr.c:1216)
    ==14759==    by 0x1EF748: main (bgp_main.c:525)
    ```
    
    Signed-off-by: Donatas Abraitis <[email protected]>
    ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    70ac630 View commit details
    Browse the repository at this point in the history
  14. bgpd: Put dest into work queue when the path is really withdrawn by d…

    …ampening
    
    Signed-off-by: Donatas Abraitis <[email protected]>
    ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    3921324 View commit details
    Browse the repository at this point in the history
  15. doc: user doc for route-flap dampening commands

    Changes update the user documentation to include a description of the
    now available commands to enable/disable route-flap dampening for peers
    and peer groups.
    
    Signed-off-by: David Schweizer <[email protected]>
    Signed-off-by: Donatas Abraitis <[email protected]>
    davischw authored and ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    b07a21d View commit details
    Browse the repository at this point in the history
  16. tests: Check if dampening per-peer works

    Signed-off-by: Donatas Abraitis <[email protected]>
    ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    709bdcb View commit details
    Browse the repository at this point in the history
  17. bgpd: Reduce the nesting level for bgp_clear_damp_route()

    Signed-off-by: Donatas Abraitis <[email protected]>
    ton31337 committed May 3, 2024
    Configuration menu
    Copy the full SHA
    bf37877 View commit details
    Browse the repository at this point in the history