]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agoMerge pull request #12146 from rgirada/frr_gr
Donatas Abraitis [Wed, 19 Oct 2022 07:10:50 +0000 (10:10 +0300)]
Merge pull request #12146 from rgirada/frr_gr

ospf6d: adding missing json fields

2 years agoMerge pull request #12124 from anlancs/ospfd-len
Russ White [Tue, 18 Oct 2022 15:40:21 +0000 (11:40 -0400)]
Merge pull request #12124 from anlancs/ospfd-len

ospfd: pass the length of string to function

2 years agoMerge pull request #8647 from sworleys/DVNI-Config-Changes
Donatas Abraitis [Tue, 18 Oct 2022 11:17:04 +0000 (14:17 +0300)]
Merge pull request #8647 from sworleys/DVNI-Config-Changes

bgpd: EVPN D-VNI L3 RT Config Enhancements

2 years agoospf6d: adding missing json fields
rgirada [Tue, 18 Oct 2022 05:51:18 +0000 (05:51 +0000)]
ospf6d: adding missing json fields

Description:
Active GR count field is missing in json o/p
of 'show ipv6 ospf gr helper' command.

Issue: #12100

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2 years agoMerge pull request #12136 from opensourcerouting/fix/drop_leftovers
Donald Sharp [Sun, 16 Oct 2022 19:21:01 +0000 (15:21 -0400)]
Merge pull request #12136 from opensourcerouting/fix/drop_leftovers

tools: Do not try creating /proc with install command

2 years agotools: Do not try creating /proc with install command
Donatas Abraitis [Fri, 14 Oct 2022 18:30:13 +0000 (21:30 +0300)]
tools: Do not try creating /proc with install command

Leftovers.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #12126 from cscarpitta/fix/add-missing-debug-guard-bgpd-srv6
Donatas Abraitis [Fri, 14 Oct 2022 07:12:56 +0000 (10:12 +0300)]
Merge pull request #12126 from cscarpitta/fix/add-missing-debug-guard-bgpd-srv6

bgpd: Add missing debug guard in SRv6 L3VPN code

2 years agoMerge pull request #12113 from donaldsharp/network_statement
Donatas Abraitis [Fri, 14 Oct 2022 07:12:18 +0000 (10:12 +0300)]
Merge pull request #12113 from donaldsharp/network_statement

bgpd: Allow `network XXX` to work with bgp suppress-fib-pending

2 years agoMerge pull request #12066 from opensourcerouting/cleanup-cli-xref
Donald Sharp [Thu, 13 Oct 2022 17:47:04 +0000 (13:47 -0400)]
Merge pull request #12066 from opensourcerouting/cleanup-cli-xref

*: clean up various CLI-related bits

2 years agobgpd: Add missing debug guard in SRv6 L3VPN code
Carmine Scarpitta [Thu, 13 Oct 2022 15:26:24 +0000 (17:26 +0200)]
bgpd: Add missing debug guard in SRv6 L3VPN code

This commit adds a missing debug guard in `ensure_vrf_tovpn_sid()`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agoMerge pull request #12115 from donaldsharp/ospf_unnumbered_showdown
Russ White [Thu, 13 Oct 2022 15:02:17 +0000 (11:02 -0400)]
Merge pull request #12115 from donaldsharp/ospf_unnumbered_showdown

ospfd: Allow unnumbered and numbered addresses to co-exist better

2 years agoMerge pull request #11980 from isabelladeleon12/set_overload_startup
Russ White [Thu, 13 Oct 2022 14:59:24 +0000 (10:59 -0400)]
Merge pull request #11980 from isabelladeleon12/set_overload_startup

isisd: Add support for set-overload on-startup

2 years agoospfd: pass the length of string to function
anlan_cs [Thu, 13 Oct 2022 13:25:37 +0000 (21:25 +0800)]
ospfd: pass the length of string to function

Fix CID 1526337: (SIZEOF_MISMATCH)

Needs to pass the correct length to the function.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #12116 from alexclewontin/snapcraft-arch
Donald Sharp [Thu, 13 Oct 2022 13:23:08 +0000 (09:23 -0400)]
Merge pull request #12116 from alexclewontin/snapcraft-arch

snapcraft: fix staging libssh on non-x86 arches

2 years agoMerge pull request #12121 from opensourcerouting/feature/tag_prs_with_conflicts
Donald Sharp [Thu, 13 Oct 2022 13:21:40 +0000 (09:21 -0400)]
Merge pull request #12121 from opensourcerouting/feature/tag_prs_with_conflicts

github: Add `conflicts`/`no_conflicts` labels for PRs

2 years agoMerge pull request #12122 from opensourcerouting/fix/use_install_instead_of_touch_cho...
Donald Sharp [Thu, 13 Oct 2022 12:58:25 +0000 (08:58 -0400)]
Merge pull request #12122 from opensourcerouting/fix/use_install_instead_of_touch_chown_combination

tools: Use `install` instead of `touch/chown` combination

2 years agotools: Use `install` instead of `touch/chown` combination
Donatas Abraitis [Mon, 10 Oct 2022 15:27:59 +0000 (18:27 +0300)]
tools: Use `install` instead of `touch/chown` combination

touch + chown can have a gap between the commands (or the second failed).

This could lead to unexpected permissions (root, instead of frr) for some
.conf files or directories.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agogithub: Add `conflicts`/`no_conflicts` labels for PRs
Donatas Abraitis [Thu, 13 Oct 2022 05:18:59 +0000 (08:18 +0300)]
github: Add `conflicts`/`no_conflicts` labels for PRs

Just to quickly identify which PRs needs attention on rebasing.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #12108 from donaldsharp/general_mayhem
Donatas Abraitis [Thu, 13 Oct 2022 05:08:27 +0000 (08:08 +0300)]
Merge pull request #12108 from donaldsharp/general_mayhem

General mayhem

2 years agoisisd: Add JSON object functions to save overload status between restarts.
Isabella de Leon [Wed, 12 Oct 2022 23:03:29 +0000 (16:03 -0700)]
isisd: Add JSON object functions to save overload status between restarts.

Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2 years agosnapcraft: fix staging libssh on non-x86 arches
Alex Lewontin [Wed, 12 Oct 2022 21:20:25 +0000 (17:20 -0400)]
snapcraft: fix staging libssh on non-x86 arches

Signed-off-by: Alex Lewontin <alex.lewontin@canonical.com>
2 years agoospfd: Allow unnumbered and numbered addresses to co-exist better
Donald Sharp [Wed, 12 Oct 2022 20:05:23 +0000 (16:05 -0400)]
ospfd: Allow unnumbered and numbered addresses to co-exist better

When forming a neighbor relationship on an interface, ospf is
currently evaluating unnumbered as highest priority, without
any consideration for if you have /32's and non /32's on the
interface.  Effectively if I have something like this:

int foo0
  ip address 192.168.119.1/24
!
router ospf
  network 0.0.0.0/0 area 0
!

ospf will form a neighbor on foo0 if it exists.  Now
suppose someone does this:

int foo0
  ip address 192.168.120.1/32

This will create the unnumbered interface on foo0 and
the peering will come down immediately.

The problem here is that the original designers of the unnumbered
code for ospf didn't envision end operators mixing and matching
addresses on an interface like this ( for perfectly legitimate
reasons I might add ).

So if ospf has both numbered and unnumbered let's match against
the numbered first and then unnumbered.  This solves the problem

Fixes: #6823
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12053 from opensourcerouting/feature/accept_own_extended_communit...
Russ White [Wed, 12 Oct 2022 19:58:23 +0000 (15:58 -0400)]
Merge pull request #12053 from opensourcerouting/feature/accept_own_extended_community_single_rr

bgpd: Implement ACCEPT_OWN extended community

2 years agobgpd: Allow `network XXX` to work with bgp suppress-fib-pending
Donald Sharp [Wed, 12 Oct 2022 18:53:21 +0000 (14:53 -0400)]
bgpd: Allow `network XXX` to work with bgp suppress-fib-pending

When bgp is using `bgp suppress-fib-pending` and the end
operator is using network statements, bgp was not sending
the network'ed prefix'es to it's peers.  Fix this.

Also update the test cases for bgp_suppress_fib to test
this new corner case( I am sure that there are going to
be others that will need to be added ).

Fixes: #12112
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoisisd: Add expected behavior with set-overload-bit
Isabella de Leon [Wed, 12 Oct 2022 17:52:27 +0000 (10:52 -0700)]
isisd: Add expected behavior with set-overload-bit

Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2 years agobgpd: Implement ACCEPT_OWN extended community
Donatas Abraitis [Sun, 18 Sep 2022 19:18:13 +0000 (22:18 +0300)]
bgpd: Implement ACCEPT_OWN extended community

TL;DR: rfc7611.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11159 from maduri111/bgpd-orr
Russ White [Wed, 12 Oct 2022 13:30:36 +0000 (09:30 -0400)]
Merge pull request #11159 from maduri111/bgpd-orr

bgpd: optimal route reflection

2 years agoMerge pull request #12059 from achernavin22/fix-max-med-on-startup
Donatas Abraitis [Wed, 12 Oct 2022 13:19:06 +0000 (16:19 +0300)]
Merge pull request #12059 from achernavin22/fix-max-med-on-startup

bgpd: fix "bgp max-med on-startup"

2 years agoMerge pull request #11981 from proelbtn/add-support-to-change-function-length
Russ White [Wed, 12 Oct 2022 12:44:29 +0000 (08:44 -0400)]
Merge pull request #11981 from proelbtn/add-support-to-change-function-length

bgpd: Add support to change Segment Routing function length

2 years agoMerge pull request #12105 from opensourcerouting/fix/bgp_list_sequence_handling_frr...
Donald Sharp [Wed, 12 Oct 2022 11:41:56 +0000 (07:41 -0400)]
Merge pull request #12105 from opensourcerouting/fix/bgp_list_sequence_handling_frr-reload

tools: Handle sequence numbers for BGP community (large/ext) in frr-reload.py

2 years agozebra: Cleanup memory leaks on shutdown
Donald Sharp [Tue, 11 Oct 2022 20:26:42 +0000 (16:26 -0400)]
zebra: Cleanup memory leaks on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoripngd: Cleanup memory allocations on shutdown
Donald Sharp [Tue, 11 Oct 2022 20:21:44 +0000 (16:21 -0400)]
ripngd: Cleanup memory allocations on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoripd: Cleanup memory allocations on shutdown
Donald Sharp [Tue, 11 Oct 2022 20:21:30 +0000 (16:21 -0400)]
ripd: Cleanup memory allocations on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: zrouter.mh_info is leaked on shutdown
Donald Sharp [Tue, 11 Oct 2022 19:22:04 +0000 (15:22 -0400)]
zebra: zrouter.mh_info is leaked on shutdown

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Free some memory in scripting subsystem at shutdown
Donald Sharp [Tue, 11 Oct 2022 17:21:03 +0000 (13:21 -0400)]
lib: Free some memory in scripting subsystem at shutdown

Pre:
staticd: showing active allocations in memory group libfrr
staticd: memstats:  Scripting                     :     16 * (variably sized)
staticd: memstats:  Hash                          :      2 * (variably sized)
staticd: memstats:  Hash Bucket                   :      8 *         32
staticd: memstats:  Hash Index                    :      1 * (variably sized)
staticd: memstats:  Link List                     :      1 *         40
staticd: memstats:  Link Node                     :      1 *         24
staticd: showing active allocations in memory group logging subsystem
staticd: memstats:  log file target               :      1 *         88
staticd: showing active allocations in memory group staticd

Post:
staticd: showing active allocations in memory group libfrr
staticd: showing active allocations in memory group logging subsystem
staticd: memstats:  log file target               :      1 *         88
staticd: showing active allocations in memory group staticd

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agostaticd: Clean up zclient on shutdown
Donald Sharp [Tue, 11 Oct 2022 16:57:57 +0000 (12:57 -0400)]
staticd: Clean up zclient on shutdown

The zclient data structure was not being cleaned up on shutdown.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: code review comments addressed
Madhuri Kuruganti [Tue, 11 Oct 2022 13:29:37 +0000 (18:59 +0530)]
bgpd: code review comments addressed

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agobgpd, ospfd: update BGP when routes are removed from OSPF routing table
Madhuri Kuruganti [Sun, 18 Sep 2022 22:23:20 +0000 (03:53 +0530)]
bgpd, ospfd: update BGP when routes are removed from OSPF routing table

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agobgpd: fix for crash when no neighbor A.B.C.D remote-as AS_NUM with orr config
Madhuri Kuruganti [Sun, 18 Sep 2022 15:45:03 +0000 (21:15 +0530)]
bgpd: fix for crash when no neighbor A.B.C.D remote-as AS_NUM with orr config

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agoospfd: few fixes in rSPF calc when LSA received from non root node
Madhuri Kuruganti [Mon, 12 Sep 2022 14:27:20 +0000 (19:57 +0530)]
ospfd: few fixes in rSPF calc when LSA received from non root node

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agobgpd, ospfd: BGP ORR CI warning fixes
Madhuri Kuruganti [Sun, 4 Sep 2022 15:11:07 +0000 (20:41 +0530)]
bgpd, ospfd: BGP ORR CI warning fixes

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agoospfd: rSPF calc and messaging for optimal route reflection
Madhuri Kuruganti [Sun, 4 Sep 2022 12:46:09 +0000 (18:16 +0530)]
ospfd: rSPF calc and messaging for optimal route reflection

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agobgpd: optimal router reflection cli and fsm changes
Madhuri Kuruganti [Sun, 4 Sep 2022 12:06:33 +0000 (17:36 +0530)]
bgpd: optimal router reflection cli and fsm changes

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agodoc: Add documentation for BGP ORR support
Madhuri Kuruganti [Sun, 4 Sep 2022 11:59:41 +0000 (17:29 +0530)]
doc: Add documentation for BGP ORR support

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agolib: BGP registration with IGP for BGP ORR rSPF calc
Madhuri Kuruganti [Sun, 4 Sep 2022 11:56:11 +0000 (17:26 +0530)]
lib: BGP registration with IGP for BGP ORR rSPF calc

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agoMerge pull request #12074 from donaldsharp/lib_debugs
Donatas Abraitis [Wed, 12 Oct 2022 07:38:21 +0000 (10:38 +0300)]
Merge pull request #12074 from donaldsharp/lib_debugs

*: Create and use infrastructure to show debugs in lib

2 years agoMerge pull request #12091 from kuldeepkash/update_assert_msg
Donatas Abraitis [Wed, 12 Oct 2022 07:37:10 +0000 (10:37 +0300)]
Merge pull request #12091 from kuldeepkash/update_assert_msg

tests: [topojson]Update assert messages for better debugging

2 years agotools: Apply black formatting for frr-reload.py
Donatas Abraitis [Tue, 11 Oct 2022 19:38:30 +0000 (22:38 +0300)]
tools: Apply black formatting for frr-reload.py

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotools: Handle sequence numbers for BGP community (large/ext) in frr-reload.py
Donatas Abraitis [Tue, 11 Oct 2022 19:36:26 +0000 (22:36 +0300)]
tools: Handle sequence numbers for BGP community (large/ext) in frr-reload.py

If we add/modify community/large/ext lists without sequence numbers, and
doing frr-reload.py, then rules with sequence numbers (show running-config
always adds sequence numbers) will be deleted and new ones will be re-added.

This could lead to blackholing for some time.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #12090 from patrasar/pimv6_show_bsm_db
Donatas Abraitis [Tue, 11 Oct 2022 18:59:22 +0000 (21:59 +0300)]
Merge pull request #12090 from patrasar/pimv6_show_bsm_db

pim6d: Fix RpAddress in "show ipv6 pim bsm-database"

2 years agoMerge pull request #12087 from achernavin22/fix-no-match-rpki
Donatas Abraitis [Tue, 11 Oct 2022 14:05:19 +0000 (17:05 +0300)]
Merge pull request #12087 from achernavin22/fix-no-match-rpki

bgpd: fix "no match rpki" in route-map

2 years agoMerge pull request #12099 from cscarpitta/fix/remove-null-check-before-free
Donatas Abraitis [Tue, 11 Oct 2022 13:39:16 +0000 (16:39 +0300)]
Merge pull request #12099 from cscarpitta/fix/remove-null-check-before-free

bgpd: Don't check for `NULL` when removing SRv6 SIDs

2 years agobgpd: Don't check for NULL when removing SRv6 SIDs
Carmine Scarpitta [Tue, 11 Oct 2022 11:06:39 +0000 (13:06 +0200)]
bgpd: Don't check for NULL when removing SRv6 SIDs

When an SRv6 locator is unset, all the SRv6 SIDs allocated from the
locator are removed. Before freeing the memory allocated for an SRv6
SID, we check if the pointer to the SID is `NULL`.

However, checking for `NULL` before freeing memory is useless.

This PR aims to improve the code's readability by removing the
useless `NULL` checks.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agobgpd: fix "bgp max-med on-startup"
Alexander Chernavin [Tue, 4 Oct 2022 12:38:54 +0000 (12:38 +0000)]
bgpd: fix "bgp max-med on-startup"

Currently, if `bgp max-med on-startup` is configured, after BGP session
is established for the first time, a timer for the specified time is
started. When the timer is expired, an UPDATE message should be sent to
reflect changes in the routes' MED value. The problem is that the routes
are being suppressed because based on the attributes they look like they
have not changed. However, in the case of max-med, the value is copied
to the packet directly from `bgp->maxmed_value`, not from the
attributes. Thus, changes in this case cannot be detected by comparing
attributes.

With this fix, avoid route suppressing when the `max-med on-startup`
timer expires and initiates an UPDATE.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2 years agobgpd: fix "no match rpki" in route-map
Alexander Chernavin [Mon, 10 Oct 2022 13:17:54 +0000 (13:17 +0000)]
bgpd: fix "no match rpki" in route-map

With this fix, make "no match rpki" in a route-map actually remove the
node in the candidate configuration instead of creating it.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2 years agoMerge pull request #12084 from ak503/bgp_show_lc
Donatas Abraitis [Tue, 11 Oct 2022 06:56:39 +0000 (09:56 +0300)]
Merge pull request #12084 from ak503/bgp_show_lc

bgpd: fix display bgp large-community exact-match

2 years agotests: Applied black formatting
Kuldeep Kashyap [Tue, 11 Oct 2022 06:47:54 +0000 (12:17 +0530)]
tests: Applied black formatting

Applied black formatting to suites,
which were missing.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agopim6d: Fix RpAddress in "show ipv6 pim bsm-database"
Sarita Patra [Tue, 11 Oct 2022 05:10:43 +0000 (22:10 -0700)]
pim6d: Fix RpAddress in "show ipv6 pim bsm-database"

RpAddress is showing wrong value in
"show ipv6 pim bsm-database" cli. This is fixed now.

Issue: #12089

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agodoc: Update docs for SRv6 locator prefix command
Ryoga Saito [Fri, 7 Oct 2022 02:20:31 +0000 (11:20 +0900)]
doc: Update docs for SRv6 locator prefix command

In previous commits, func-bits was expanded to 0-64. This PR reflects
these changes.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agotests: Updated assert message for better debugging
Kuldeep Kashyap [Mon, 10 Oct 2022 23:57:50 +0000 (05:27 +0530)]
tests: Updated assert message for better debugging

Updating topojson script's assert messages,
which will help in better debugging, when
test will fail.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agoMerge pull request #9998 from pguibert6WIND/bgp_tcp_keepalive
Donatas Abraitis [Mon, 10 Oct 2022 12:46:30 +0000 (15:46 +0300)]
Merge pull request #9998 from pguibert6WIND/bgp_tcp_keepalive

Bgp tcp keepalive

2 years agobgpd: fix display bgp large-community exact-match
Your Name [Mon, 10 Oct 2022 10:51:27 +0000 (13:51 +0300)]
bgpd: fix display bgp large-community exact-match

Before patch:
frr# show bgp large-community 1:1:1 exact-match
% Large-community malformed

After patch:
frr# show bgp large-community 1:1:1 exact-match

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
2 years agoMerge pull request #12082 from anlancs/fix/cleanup-21
Donatas Abraitis [Mon, 10 Oct 2022 09:37:21 +0000 (12:37 +0300)]
Merge pull request #12082 from anlancs/fix/cleanup-21

bgpd: cosmetic function address

2 years agoMerge pull request #12070 from cscarpitta/fix/srv6-sid-print-using-pI6
Donatas Abraitis [Mon, 10 Oct 2022 06:36:36 +0000 (09:36 +0300)]
Merge pull request #12070 from cscarpitta/fix/srv6-sid-print-using-pI6

bgpd: Use `%pI6` to print the SRv6 VPN SIDs

2 years agoMerge pull request #11961 from maduri111/ospfd-debug-cmds
Donatas Abraitis [Sun, 9 Oct 2022 18:16:01 +0000 (21:16 +0300)]
Merge pull request #11961 from maduri111/ospfd-debug-cmds

ospfd: fix for some of ospf debug commands config lost after reboot

2 years agoMerge pull request #12073 from donaldsharp/pi_or_die
Donatas Abraitis [Sun, 9 Oct 2022 14:01:38 +0000 (17:01 +0300)]
Merge pull request #12073 from donaldsharp/pi_or_die

bgpd: Remove unnecessary check for pi and setting type and sub-type

2 years agoMerge pull request #12083 from donaldsharp/nexthop_group_issues_local
Donatas Abraitis [Sun, 9 Oct 2022 14:01:16 +0000 (17:01 +0300)]
Merge pull request #12083 from donaldsharp/nexthop_group_issues_local

tests: nhid is interfering with pattern match

2 years agotests: nhid is interfering with pattern match
Donald Sharp [Sat, 8 Oct 2022 14:35:35 +0000 (10:35 -0400)]
tests: nhid is interfering with pattern match

The bgp_gr_restart_retain_routes test is looking for specific output
that does not include the routes nexthop id:

    def _bgp_check_kernel_retained_routes():
        output = (
            r2.cmd("ip route show 172.16.255.1/32 proto bgp dev r2-eth0")
            .replace("\n", "")
            .rstrip()
        )
        expected = "172.16.255.1 via 192.168.255.1 metric 20"
        diff = topotest.get_textdiff(
            output, expected, "Actual IP Routing Table", "Expected IP RoutingTable"
        )
        if diff:
            return False
        return True

While the output includes nexthop group id's now:

root@r2:# ip route show 172.16.255.1 proto bgp dev r2-eth0
172.16.255.1 nhid 8 via 192.168.255.1 metric 20

Let's just mark r2 as not to use nexthop groups for installation
and this test issue will go away.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: cosmetic function address
anlan_cs [Mon, 26 Sep 2022 02:18:52 +0000 (22:18 -0400)]
bgpd: cosmetic function address

No mistake, just to unify style for the parameter of function address - remove
ampersand.  In current code, only this one place of `hook_register()`s needs
to be made.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years ago*: Create and use infrastructure to show debugs in lib
Donald Sharp [Fri, 7 Oct 2022 11:51:17 +0000 (07:51 -0400)]
*: Create and use infrastructure to show debugs in lib

There are lib debugs being set but never show up in
`show debug` commands because there was no way to show
that they were being used.  Add a bit of infrastructure
to allow this and then use it for `debug route-map`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12062 from fdumontet6WIND/hash_list
Mark Stapp [Fri, 7 Oct 2022 11:30:46 +0000 (07:30 -0400)]
Merge pull request #12062 from fdumontet6WIND/hash_list

lib: hash list add function fix

2 years agotests: Add func-bits for compatibility
Ryoga Saito [Wed, 21 Sep 2022 22:24:02 +0000 (07:24 +0900)]
tests: Add func-bits for compatibility

In order to minimize the changes of test files, this PR adds `func-bits`
parameters on the SRv6 locator definition.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agozebra: expand func-bits
Ryoga Saito [Wed, 21 Sep 2022 07:35:40 +0000 (16:35 +0900)]
zebra: expand func-bits

In order to set function length of SID freely, this PR relieves the
lower limitation of `func-bits`.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: expand SID index
Ryoga Saito [Wed, 21 Sep 2022 07:52:00 +0000 (16:52 +0900)]
bgpd: expand SID index

In order to set higher SID index, this PR relieves the upper
limitation of `sid vpn export`.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: add handling for special label
Ryoga Saito [Tue, 20 Sep 2022 09:42:38 +0000 (18:42 +0900)]
bgpd: add handling for special label

Add handling for reserved MPLS label like IMPLICIT_NULL (3).

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: save srv6_locator_chunk in vpn_policy
Ryoga Saito [Tue, 20 Sep 2022 09:41:55 +0000 (18:41 +0900)]
bgpd: save srv6_locator_chunk in vpn_policy

In order to send correct SRv6 L3VPN advertisement, we need to save
srv6_locator_chunk in vpn_policy. With this information, we can
construct correct SRv6 L3VPN advertisement packets.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: allocate SID according to Function length
Ryoga Saito [Tue, 20 Sep 2022 09:19:13 +0000 (18:19 +0900)]
bgpd: allocate SID according to Function length

Allocate SID according to Function length to eliminate old SID
allocation limits (255).

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: fix transpose_sid
Ryoga Saito [Wed, 21 Sep 2022 03:58:18 +0000 (12:58 +0900)]
bgpd: fix transpose_sid

In order to support variable function length, it is need to update
transpose_sid.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agozebra: add default SRv6 Function length
Ryoga Saito [Tue, 20 Sep 2022 09:24:50 +0000 (18:24 +0900)]
zebra: add default SRv6 Function length

Add default SRv6 Function Length for usecases like SRv6 L3VPN. The
default value (16) comes from the default Function length for SRv6
L3VPN in BGPd.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: Remove unnecessary check for pi and setting type and sub-type
Donald Sharp [Fri, 7 Oct 2022 00:17:26 +0000 (20:17 -0400)]
bgpd: Remove unnecessary check for pi and setting type and sub-type

There is code that sets the pi based upon matching it against
the same peer.  In this code the type and sub-type are also
compared to the passed in type and sub-type.  Let's just use
type and sub-type as that if we have a pi we know type and sub-type
are already correct.  This should also make the first iteration
work correctly when the pi has not been created yet when we call
the martian_update function.bgpd: Remove unnecessary check for pi and setting type and sub-type

There is code that sets the pi based upon matching it against
the same peer.  In this code the type and sub-type are also
compared to the passed in type and sub-type.  Let's just use
type and sub-type as that if we have a pi we know type and sub-type
are already correct.  This should also make the first iteration
work correctly when the pi has not been created yet when we call
the martian_update function.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Add test to cover set-overload-bit on-startup functionality
Isabella de Leon [Thu, 6 Oct 2022 20:53:27 +0000 (13:53 -0700)]
tests: Add test to cover set-overload-bit on-startup functionality

Signed-off-by: Isabella de Leon <ideleon@microsoft.com>
2 years agobgpd: Use %pI6 to print SRv6 VPN SIDs
Carmine Scarpitta [Thu, 6 Oct 2022 17:15:50 +0000 (19:15 +0200)]
bgpd: Use %pI6 to print SRv6 VPN SIDs

Use %pI6 to print the SRv6 VPN SIDs in bgpd VTY.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agoMerge pull request #12034 from opensourcerouting/fix/gr_hard_notification
Russ White [Thu, 6 Oct 2022 14:05:11 +0000 (10:05 -0400)]
Merge pull request #12034 from opensourcerouting/fix/gr_hard_notification

bgpd: Do not send Deconfig/Shutdown message when restarting

2 years agoMerge pull request #12038 from pguibert6WIND/show_bgp_nexthop_better
Russ White [Thu, 6 Oct 2022 14:04:49 +0000 (10:04 -0400)]
Merge pull request #12038 from pguibert6WIND/show_bgp_nexthop_better

bgpd: improve 'show bgp nexthop' command

2 years agoMerge pull request #12040 from opensourcerouting/fix/bgp_local_as_remote_as
Russ White [Thu, 6 Oct 2022 14:03:26 +0000 (10:03 -0400)]
Merge pull request #12040 from opensourcerouting/fix/bgp_local_as_remote_as

bgpd: Allow using remote-as the same as local-as

2 years agopython: use ujson if available
David Lamparter [Tue, 4 Oct 2022 16:01:08 +0000 (18:01 +0200)]
python: use ujson if available

It's noticeably faster.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobuild: don't include vtysh.xref in frr.xref
David Lamparter [Tue, 4 Oct 2022 15:59:38 +0000 (17:59 +0200)]
build: don't include vtysh.xref in frr.xref

vtysh.xref only contains a rather-useless duplicate of every single CLI
command incorporated into vtysh...  and including it prevents frr.xref
from becoming the source for vtysh_cmd.c.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agovtysh: fix bugged command definitions
David Lamparter [Tue, 4 Oct 2022 15:57:09 +0000 (17:57 +0200)]
vtysh: fix bugged command definitions

DAEMON_LIST really needs a space.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years ago*: fix some malformed CLI docstrings
David Lamparter [Tue, 4 Oct 2022 13:18:29 +0000 (15:18 +0200)]
*: fix some malformed CLI docstrings

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: add CMD_ATTR_NOSH
David Lamparter [Tue, 4 Oct 2022 11:44:19 +0000 (13:44 +0200)]
lib: add CMD_ATTR_NOSH

To propagate into .xref so extract.pl can be handled there.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: detangle DEFUN macros
David Lamparter [Tue, 4 Oct 2022 11:42:03 +0000 (13:42 +0200)]
lib: detangle DEFUN macros

Make the variants go into an _ATTR macro each.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: make cmd_element->attr a bitmask & clarify
David Lamparter [Tue, 4 Oct 2022 11:30:04 +0000 (13:30 +0200)]
lib: make cmd_element->attr a bitmask & clarify

It already "looks" like a bitmask, but we currently can't flag a command
both YANG and HIDDEN at the same time.  It really should be a bitmask.

Also clarify DEPRECATED behaviour (or the absence thereof.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: remove unused CLI macros
David Lamparter [Tue, 4 Oct 2022 11:11:43 +0000 (13:11 +0200)]
lib: remove unused CLI macros

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agotests: make hash collision test collide harder
David Lamparter [Thu, 6 Oct 2022 13:27:08 +0000 (15:27 +0200)]
tests: make hash collision test collide harder

The issue fixed in the previous commit now correctly triggers a failure:
("assertion (list_add(&head, &itm[j]) == &itm[j]) failed")

Turns out the "shitty" hash function was not shitty enough.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: fix typesafe hash add with hash collision
Francois Dumontet [Tue, 4 Oct 2022 14:26:19 +0000 (16:26 +0200)]
lib: fix typesafe hash add with hash collision

The typesafe hash data structure enforces items to be unique, but their
hash values may still collide.  To this extent, when two items have the
same hash value, the compare function is called to see if it returns 0
(aka "equal").

While the _find() function handles this correctly, the _add() function
mistakenly only checked the first item with a colliding hash value for
equality, and if it was inequal proceeded to add the new item.  There
may however be additional items with the same hash value collision, one
of which could still compare as equal.  In that case, _add() would
mistakenly add the new element, failing to notice the already added
item.  Breakage ensues.

Fix by looking for an equal element among *all* existing items with the
same hash value, not just the first.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
[DL: rewrote commit message, fixed whitespace/formatting]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #12054 from opensourcerouting/feature/show_that_route_is_not_adver...
mobash-rasool [Thu, 6 Oct 2022 09:53:21 +0000 (15:23 +0530)]
Merge pull request #12054 from opensourcerouting/feature/show_that_route_is_not_advertised

bgpd: Show why the prefix is inaccessible in show commands

2 years agoMerge pull request #11983 from maduri111/bgpd-cond-adv-debug
Donatas Abraitis [Thu, 6 Oct 2022 09:42:28 +0000 (12:42 +0300)]
Merge pull request #11983 from maduri111/bgpd-cond-adv-debug

bgpd: adding debug command for conditional advertisement

2 years agobgpd: conditional advertisement code cleanup
Madhuri Kuruganti [Thu, 6 Oct 2022 07:13:05 +0000 (12:43 +0530)]
bgpd: conditional advertisement code cleanup

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2 years agoMerge pull request #11838 from Pdoijode/v6-gua-nh-bgp-update
Donatas Abraitis [Thu, 6 Oct 2022 07:04:37 +0000 (10:04 +0300)]
Merge pull request #11838 from Pdoijode/v6-gua-nh-bgp-update

bgpd: BGP does not update next-hop when global V6 address is configured

2 years agobgpd: adding debug command for conditional advertisement
Madhuri Kuruganti [Wed, 21 Sep 2022 07:03:52 +0000 (12:33 +0530)]
bgpd: adding debug command for conditional advertisement

Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>