]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
7 months agoMerge pull request #16713 from opensourcerouting/fix/bgpd_parse_received_err
Donald Sharp [Tue, 3 Sep 2024 14:36:16 +0000 (10:36 -0400)]
Merge pull request #16713 from opensourcerouting/fix/bgpd_parse_received_err

bgpd: Print errors as error not as information when parsing OPEN message

7 months agoMerge pull request #15605 from donaldsharp/evpn_local_table_warning
Russ White [Tue, 3 Sep 2024 14:19:34 +0000 (10:19 -0400)]
Merge pull request #15605 from donaldsharp/evpn_local_table_warning

bgpd: Ensure evpn local table display shows route send status

7 months agoMerge pull request #16725 from chiragshah6/bgp_dev1
Jafar Al-Gharaibeh [Tue, 3 Sep 2024 14:02:01 +0000 (10:02 -0400)]
Merge pull request #16725 from chiragshah6/bgp_dev1

bgpd: fix proper json format for unicast statistics for non exists vrf

7 months agoMerge pull request #16726 from LabNConsulting/native-munet-topotest
Donald Sharp [Tue, 3 Sep 2024 11:15:32 +0000 (07:15 -0400)]
Merge pull request #16726 from LabNConsulting/native-munet-topotest

fix native munet topotest

7 months agotests: improve example munet test
Christian Hopps [Tue, 3 Sep 2024 04:40:01 +0000 (00:40 -0400)]
tests: improve example munet test

Signed-off-by: Christian Hopps <chopps@labn.net>
7 months agotests: fix munet native topotest runs
Christian Hopps [Tue, 3 Sep 2024 04:41:03 +0000 (00:41 -0400)]
tests: fix munet native topotest runs

Enabe/fix using a munet.yaml config file for topology configuration.
Easier test writing.

This also uses the standard `frrinit.sh` to launch and teardown
FRR, so we actually test what most users use.

Signed-off-by: Christian Hopps <chopps@labn.net>
7 months agobgpd: fix proper json format for unicast statistics for non exists vrf
Sindhu Parvathi Gopinathan [Mon, 26 Aug 2024 07:02:46 +0000 (00:02 -0700)]
bgpd: fix proper json format for unicast statistics for non exists vrf

Ticket: #4060069

show bgp vrf afi unicast statistics json output is not return in json
format for non exists vrf.

Fix:
Json output is formatted for non exists vrf cases.

Command supported:

```
show bgp vrf <VRFNAME> ipv4/ipv6 unicast statistics json
show bgp vrf <VRFNAME> l2vpn evpn statistics json
```

Before Fix:

```
leaf11#
leaf11# show bgp vrf test ipv4 unicast statistics json
View/Vrf test is unknown
leaf11#
leaf11#
leaf11# show bgp vrf test ipv6 unicast statistics json
View/Vrf test is unknown
leaf11#
leaf11#
leaf11# show bgp vrf default1 l2vpn evpn statistics json
View/Vrf default1 is unknown
leaf11#

```

After Fix:

```
leaf11#
leaf11# show bgp vrf test ipv4 unicast statistics json
{
  "warning":"View/Vrf is unknown"
}
leaf11#
leaf11#
leaf11# show bgp vrf test ipv6 unicast statistics json
{
  "warning":"View/Vrf is unknown"
}
leaf11#
leaf11# show bgp vrf default1 l2vpn evpn statistics json
{
  "warning":"View/Vrf is unknown"
}
leaf11#
```

Ticket: #4060069

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
7 months agoMerge pull request #16711 from donaldsharp/memory_type_stuff
Jafar Al-Gharaibeh [Sun, 1 Sep 2024 23:44:29 +0000 (19:44 -0400)]
Merge pull request #16711 from donaldsharp/memory_type_stuff

Memory type stuff

7 months agobgpd: Print errors as error not as information when parsing OPEN message
Donatas Abraitis [Sun, 1 Sep 2024 19:42:54 +0000 (22:42 +0300)]
bgpd: Print errors as error not as information when parsing OPEN message

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
7 months agoMerge pull request #16698 from louis-6wind/fix-nhrp-redundancy
Donatas Abraitis [Sun, 1 Sep 2024 17:30:02 +0000 (20:30 +0300)]
Merge pull request #16698 from louis-6wind/fix-nhrp-redundancy

nhrpd, test: fix nhrp_redundancy topotest

7 months ago*: Create termtable specific temp memory
Donald Sharp [Fri, 30 Aug 2024 13:05:11 +0000 (09:05 -0400)]
*: Create termtable specific temp memory

When trying to track down a MTYPE_TMP memory leak
it's harder to search for it when you happen to
have some usage of ttable_dump.  Let's just give
it it's own memory type so that we can avoid
confusion in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 months agoisisd: in isis_mt.c use appropriate memory allocator
Donald Sharp [Fri, 30 Aug 2024 12:52:06 +0000 (08:52 -0400)]
isisd: in isis_mt.c use appropriate memory allocator

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 months agoMerge pull request #16701 from Jafaral/unified-config
Donald Sharp [Sat, 31 Aug 2024 12:56:55 +0000 (08:56 -0400)]
Merge pull request #16701 from Jafaral/unified-config

tests: detect all daemons correctly when using frr.conf

7 months agoMerge pull request #16688 from donaldsharp/no_connected_nexthops_at_first
Jafar Al-Gharaibeh [Fri, 30 Aug 2024 21:36:17 +0000 (17:36 -0400)]
Merge pull request #16688 from donaldsharp/no_connected_nexthops_at_first

No connected/local/kernel nexthops at first

7 months agobgpd: Ensure evpn local table display shows route send status
Donald Sharp [Fri, 22 Mar 2024 20:04:19 +0000 (16:04 -0400)]
bgpd: Ensure evpn local table display shows route send status

evpn has a concept of `local` tables where the evpn routes
are actually converted into underlying routes/neighbor
table entries( or vice versa ).  Then this local route
is propagated to the global evpn l2vpn table and sent
to the peers.  Certain show commands in evpn look
operate on the local table but make the output look
like the data has not been sent to the peer.  This
is confusing for the operator.  Modify the code
such that local tables get a `Local BGP table not advertised`
in the place where the code talks about whom has received
the data or not.

Example:
torm11# show bgp l2vpn evpn route vni 1000 mac 8a:a1:cc:73:a3:ac ip 45.0.0.5
BGP routing table entry for [2]:[0]:[48]:[8a:a1:cc:73:a3:ac]:[32]:[45.0.0.5]
Paths: (2 available, best #2)
  Local BGP table not advertised
  Route [2]:[0]:[48]:[8a:a1:cc:73:a3:ac]:[32]:[45.0.0.5] VNI 1000
  Imported from 192.168.100.18:2:[2]:[0]:[48]:[8a:a1:cc:73:a3:ac]:[32]:[45.0.0.5], VNI 1000
  65101 65005
    192.168.100.18(leaf2) from leaf2(192.168.5.1) (192.168.100.14)
      Origin IGP, valid, external
      Extended Community: RT:65005:1000 ET:8
      Last update: Thu Mar 21 14:29:04 2024
  Route [2]:[0]:[48]:[8a:a1:cc:73:a3:ac]:[32]:[45.0.0.5] VNI 1000
  Imported from 192.168.100.18:2:[2]:[0]:[48]:[8a:a1:cc:73:a3:ac]:[32]:[45.0.0.5], VNI 1000
  65101 65005
    192.168.100.18(leaf1) from leaf1(192.168.1.1) (192.168.100.13)
      Origin IGP, valid, external, bestpath-from-AS 65101, best (Router ID)
      Extended Community: RT:65005:1000 ET:8
      Last update: Thu Mar 21 14:29:04 2024

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 months agotests: detect all daemons correctly when using frr.conf
Jafar Al-Gharaibeh [Fri, 30 Aug 2024 19:35:31 +0000 (14:35 -0500)]
tests: detect all daemons correctly when using frr.conf

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
7 months agotests: use private addresses in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 12:52:49 +0000 (14:52 +0200)]
tests: use private addresses in nhrp_redundancy

Use private addresses in nhrp_redundancy.

> cd tests/topotests/nhrp_redundancy
> git grep 176.16  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|176.16|172.16|g' -i
> git grep 5.5.5.  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|5.5.5.|10.5.5.|g' -i
> git grep 4.4.4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|4.4.4.|10.4.4.|g' -i

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: check show ip nhrp shorcut in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 12:41:08 +0000 (14:41 +0200)]
tests: check show ip nhrp shorcut in nhrp_redundancy

Check show ip nhrp shorcut in nhrp_redundancy

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agonhrpd: fix show nhrp shortcut json
Louis Scalbert [Fri, 30 Aug 2024 12:35:58 +0000 (14:35 +0200)]
nhrpd: fix show nhrp shortcut json

Fix show nhrp shortcut json

Fixes: 87b9e98203 ("nhrpd: add json support to show nhrp vty commands")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: fix iptables command in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 12:22:45 +0000 (14:22 +0200)]
tests: fix iptables command in nhrp_redundancy

Replace --nflog-range argument by --nflog-range due to:

> 2024-08-30 10:44:54,816 INFO: topo: input: iptables -A FORWARD -i nhs3-gre0 -o nhs3-gre0 -m hashlimit --hashlimit-upto 4/minute --hashlimit-burst 1 --hashlimit-mode srcip,dstip --hashlimit-srcmask 24 --hashlimit-dstmask 24 --hashlimit-name loglimit-0 -j NFLOG --nflog-group 1 --nflog-range 128
> 2024-08-30 10:44:54,819 INFO: topo: output: warn: --nflog-range has never worked and is no longer supported, please use --nflog-size insted

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: fix nhs1 down check in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 12:12:27 +0000 (14:12 +0200)]
tests: fix nhs1 down check in nhrp_redundancy

Fully check the NHRP convergence after setting nhs1 down. Otherwise the
ping may pass because the previous shortcut is still present.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: fix nhc1 route check after nhs1 down
Louis Scalbert [Fri, 30 Aug 2024 12:08:51 +0000 (14:08 +0200)]
tests: fix nhc1 route check after nhs1 down

After setting down nhs1, the test is checking that nhc1 routing table
matches routes in nhc1/nhrp_route.json. It is incorrect because it
checks that the NHRP route to nhs1 is still present but it should have
disappeared.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: simplify nhrp_redundancy convergence
Louis Scalbert [Fri, 30 Aug 2024 12:14:17 +0000 (14:14 +0200)]
tests: simplify nhrp_redundancy convergence

Simplify nhrp_redundancy convergence code. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: rename router variables in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 09:23:42 +0000 (11:23 +0200)]
tests: rename router variables in nhrp_redundancy

Rename router variables in nhrp_redundancy to match the actual name.
Cosmetic change to help debugging.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: rename routers in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 09:16:44 +0000 (11:16 +0200)]
tests: rename routers in nhrp_redundancy

Rename routers in nhrp_redundancy to match the diagram. Cosmetic change.

> cd tests/topotests/nhrp_redundancy
> git grep r1  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r1|nhs1|g' -i
> git grep r2  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r2|nhs2|g' -i
> git grep r3  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r3|nhs3|g' -i
> git grep r4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r4|nhc1|g' -i
> git grep r5  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r5|nhc2|g' -i
> git grep r6  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r6|router|g' -i
> git grep r7  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r7|host|g' -i
>
> git grep R1  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R1|nhs1|g' -i
> git grep R2  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R2|nhs2|g' -i
> git grep R3  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R3|nhs3|g' -i
> git grep R4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R4|nhc1|g' -i
> git grep R5  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R5|nhc2|g' -i
> git grep R6  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R6|router|g' -i
> git grep R7  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R7|host|g' -i
>
> mv r1 nhs1
> mv r2 nhs2
> mv r3 nhs3
> mv r4 nhc1
> mv r5 nhc2
> mv r6 router
> mv r7 host

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: apply black nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 12:53:55 +0000 (14:53 +0200)]
tests: apply black nhrp_redundancy

Apply black nhrp_redundancy

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agodoc: Update documentation to talk about nhe changes
Donald Sharp [Thu, 29 Aug 2024 15:38:26 +0000 (11:38 -0400)]
doc: Update documentation to talk about nhe changes

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 months agozebra: Allow for initial deny of installation of nhe's
Donald Sharp [Thu, 29 Aug 2024 15:29:55 +0000 (11:29 -0400)]
zebra: Allow for initial deny of installation of nhe's

Currently the FRR code will receive both kernel and
connected routes that do not actually have an underlying
nexthop group at all.  Zebra turns around and creates
a `matching` nexthop hash entry and installs it.
For connected routes, this will create 2 singleton
nexthops in the dplane per interface (v4 and v6).
For kernel routes it would just create 1 singleton
nexthop that might be used or not.

This is bad because the dplane has a limited amount
of space available for nexthop entries and if you
happen to have a large number of interfaces then
all of a sudden you have 2x(# of interfaces) singleton
nexthops.

Let's modify the code to delay creation of these singleton
nexthops until they have been used by something else in the
system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
7 months agotests: fix prefix length in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 11:54:36 +0000 (13:54 +0200)]
tests: fix prefix length in nhrp_redundancy

The expected prefix should be 5.5.5.0/24 otherwise the hosts behind NHRP
client 1 nhc1 (aka. r5) are not reachable via NHRP.

The issue was not seen in the FRR official CI because the tests were
skipped because iptables were missing in CI machines.

It solves the 16690 issue.

Fixes: https://github.com/FRRouting/frr/issues/16690
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agoMerge pull request #16689 from donaldsharp/blackhole_and_afi
Jafar Al-Gharaibeh [Fri, 30 Aug 2024 02:13:03 +0000 (22:13 -0400)]
Merge pull request #16689 from donaldsharp/blackhole_and_afi

Blackhole and afi

8 months agoMerge pull request #16692 from donaldsharp/zebra_avoid_ng_null
Jafar Al-Gharaibeh [Fri, 30 Aug 2024 02:11:03 +0000 (22:11 -0400)]
Merge pull request #16692 from donaldsharp/zebra_avoid_ng_null

zebra: Convince SA that the ng will always be valid

8 months agozebra: Convince SA that the ng will always be valid
Donald Sharp [Thu, 29 Aug 2024 22:10:30 +0000 (18:10 -0400)]
zebra: Convince SA that the ng will always be valid

There is a code path that could theoretically get you
to a point where the ng->nexthop is a NULL value.
Let's just make sure the SA system believes that
cannot happen anymore.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16687 from Jafaral/isis-test-fix
Donald Sharp [Thu, 29 Aug 2024 19:10:54 +0000 (15:10 -0400)]
Merge pull request #16687 from Jafaral/isis-test-fix

tests: increase the timeout for packet padding check

8 months agozebra: Allow blackhole singleton nexthops to be v6
Donald Sharp [Thu, 29 Aug 2024 19:06:31 +0000 (15:06 -0400)]
zebra: Allow blackhole singleton nexthops to be v6

A blackhole nexthop, according to the linux kernel,
can be v4 or v6.  A v4 blackhole nexthop cannot be
used on a v6 route, but a v6 blackhole nexthop can
be used with a v4 route.  Convert all blackhole
singleton nexthops to v6 and just use that.
Possibly reducing the number of active nexthops by 1.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Display afi of the nexthop hash entry
Donald Sharp [Thu, 29 Aug 2024 18:49:36 +0000 (14:49 -0400)]
zebra: Display afi of the nexthop hash entry

Let's display the afi of the nexthop hash entry.  Right
now it is impossible to tell the difference between v4 or
v6 nexthops, especially since it is important for the kernel.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotests: increase the timeout for packet padding check
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 16:40:50 +0000 (11:40 -0500)]
tests: increase the timeout for packet padding check

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agoMerge pull request #16664 from mjstapp/igor_debug_simplify
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 15:51:53 +0000 (11:51 -0400)]
Merge pull request #16664 from mjstapp/igor_debug_simplify

*: simplify frrlib debug

8 months agoMerge pull request #16685 from opensourcerouting/fix/document_reverts
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 15:39:27 +0000 (11:39 -0400)]
Merge pull request #16685 from opensourcerouting/fix/document_reverts

doc: Document the git revert flow

8 months agoMerge pull request #16680 from donaldsharp/route_scale_minor_changes
Mark Stapp [Thu, 29 Aug 2024 12:17:34 +0000 (08:17 -0400)]
Merge pull request #16680 from donaldsharp/route_scale_minor_changes

tests: Fix route-scale at higher ecmp

8 months agodoc: Document the git revert flow
Donatas Abraitis [Thu, 29 Aug 2024 06:04:28 +0000 (09:04 +0300)]
doc: Document the git revert flow

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16683 from donaldsharp/test_ospf_netns_vrf_failure
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 05:12:40 +0000 (01:12 -0400)]
Merge pull request #16683 from donaldsharp/test_ospf_netns_vrf_failure

tests: ospf_netns_vrf should give more time for coming up

8 months agoMerge pull request #16682 from donaldsharp/bgp_suppress_test
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 05:12:17 +0000 (01:12 -0400)]
Merge pull request #16682 from donaldsharp/bgp_suppress_test

tests: Ensure bgp suppress fib has a chance to transmit data to peer

8 months agoMerge pull request #16681 from donaldsharp/zebra_re_after_rn
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 03:43:40 +0000 (23:43 -0400)]
Merge pull request #16681 from donaldsharp/zebra_re_after_rn

zebra: Move prefix lookup to outside re loop

8 months agoMerge pull request #16673 from donaldsharp/default_original_sin
Jafar Al-Gharaibeh [Wed, 28 Aug 2024 19:30:12 +0000 (15:30 -0400)]
Merge pull request #16673 from donaldsharp/default_original_sin

tests: Fix bgp_default_originate_topo1_3

8 months agoMerge pull request #16672 from raja-rajasekar/vty_out_mem_spike_srujana
Mark Stapp [Wed, 28 Aug 2024 19:29:23 +0000 (15:29 -0400)]
Merge pull request #16672 from raja-rajasekar/vty_out_mem_spike_srujana

lib: Memory spike reduction for sh cmds at scale

8 months agotests: Fix route-scale at higher ecmp
Donald Sharp [Tue, 27 Aug 2024 14:29:13 +0000 (10:29 -0400)]
tests: Fix route-scale at higher ecmp

Recent commits moved the default retries to 60, but
the higher ecmp counts were over-riding to 40.  Let's
make it 80.

Noticed this when I went looking at failures on 386 platforms
in our ci.  Route scale is timing out when deleting routes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotests: ospf_netns_vrf should give more time for coming up
Donald Sharp [Wed, 28 Aug 2024 19:10:04 +0000 (15:10 -0400)]
tests: ospf_netns_vrf should give more time for coming up

Test fails:

            test_func = partial(
                topotest.router_json_cmp,
                router,
                "show ip ospf vrf {0}-ospf-cust1 json".format(rname),
                expected,
            )
            _, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
            assertmsg = '"{}" JSON output mismatches'.format(rname)
>           assert diff is None, assertmsg
E           AssertionError: "r1" JSON output mismatches
E           assert Generated JSON diff error report:
E
E             > $->r1-ospf-cust1->areas->0.0.0.0->nbrFullAdjacentCounter: output has element with value '1' but in expected it has value '2'

/home/sharpd/frr2/tests/topotests/ospf_netns_vrf/test_ospf_netns_vrf.py:239: AssertionError

Support bundle has this data:
r1# show ip ospf vrf all neighbor
% 2024/08/28 14:55:54.763

VRF Name: r1-ospf-cust1

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.0.255.3        1 Full/DR         10.547s           39.456s 10.0.3.1        r1-eth1:10.0.3.2                     0     0     0
10.0.255.2        1 Full/Backup     0.543s            38.378s 10.0.3.3        r1-eth1:10.0.3.2                     1     0     0

So immediately after the test fails this test, the neighbor comes up.
Let's give the test a bit more time for failure to not happen

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotests: Ensure bgp suppress fib has a chance to transmit data to peer
Donald Sharp [Wed, 28 Aug 2024 19:05:40 +0000 (15:05 -0400)]
tests: Ensure bgp suppress fib has a chance to transmit data to peer

Giving only 5 seconds to pass bgp data to peers on a heavily
loaded system is a recipe for not having fun.  Add more time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16679 from donaldsharp/nhrp_test_documentation
Mark Stapp [Wed, 28 Aug 2024 18:11:18 +0000 (14:11 -0400)]
Merge pull request #16679 from donaldsharp/nhrp_test_documentation

doc: Update topotest doc to include iptables is needed

8 months agoMerge pull request #16300 from donaldsharp/local_connected
Mark Stapp [Wed, 28 Aug 2024 18:10:14 +0000 (14:10 -0400)]
Merge pull request #16300 from donaldsharp/local_connected

Local connected

8 months agozebra: Move prefix lookup to outside re loop
Donald Sharp [Wed, 28 Aug 2024 17:18:00 +0000 (13:18 -0400)]
zebra: Move prefix lookup to outside re loop

Move the prefix lookup/comparison to outside the re loop
and into the rn loop, since that is where the code should
actually be.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16676 from opensourcerouting/fix/lua_nexthop_handling_in_lua
Donald Sharp [Wed, 28 Aug 2024 16:45:39 +0000 (12:45 -0400)]
Merge pull request #16676 from opensourcerouting/fix/lua_nexthop_handling_in_lua

Lua stack dumping

8 months agoMerge pull request #16677 from donaldsharp/mgmt_map
Jafar Al-Gharaibeh [Wed, 28 Aug 2024 16:38:11 +0000 (12:38 -0400)]
Merge pull request #16677 from donaldsharp/mgmt_map

mgmtd: Ensure map is NULL

8 months agodoc: Update topotest doc to include iptables is needed
Donald Sharp [Wed, 28 Aug 2024 16:05:41 +0000 (12:05 -0400)]
doc: Update topotest doc to include iptables is needed

The nhrp tests skip tests that do not have iptables installed.
As such we have ended up with a situation where the nrhp test
is now failing locally for me because I have iptables installed
and if the CI system had iptables installed it would have detected
the problem as well.

Let's document that iptables is needed to do testing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotests: Fix bgp_default_originate_topo1_3
Donald Sharp [Tue, 27 Aug 2024 21:08:38 +0000 (17:08 -0400)]
tests: Fix bgp_default_originate_topo1_3

This test was killing bgp on r1 and r2
and then immediately testing that the
default route transitioned.  Unfortunately
the test was written that under load the
system might be in a bad state.  Let's
modify the code to check for a bgp version
change and then that the bgp state has
come back up

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agomgmtd: Ensure map is NULL
Donald Sharp [Wed, 28 Aug 2024 14:09:52 +0000 (10:09 -0400)]
mgmtd: Ensure map is NULL

Build is complaining:
build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c: In function â€˜mgmt_register_client_xpath’:
build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c:274:27: warning: â€˜maps’ may be used uninitialized [-Wmaybe-uninitialized]
build 27-Aug-2024 05:46:38   274 |         map = darr_append(*maps);
build 27-Aug-2024 05:46:38       |                           ^
build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c:250:36: note: â€˜maps’ was declared here
build 27-Aug-2024 05:46:38   250 |         struct mgmt_be_xpath_map **maps, *map;
build 27-Aug-2024 05:46:38       |                                    ^~~~

Let's make the compiler happy, even though there is no problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agolib: Add a helper function to dump Lua stack
Donatas Abraitis [Wed, 28 Aug 2024 14:08:45 +0000 (17:08 +0300)]
lib: Add a helper function to dump Lua stack

Very handy for debugging.

In Lua script just use "log.trace(table)":

```
function on_rib_process_dplane_results(ctx)
log.trace(ctx.rinfo.zd_ng)
end
```

You will get something like:

```
Aug 28 17:04:36 donatas-laptop zebra[3782199]: [GCZ7N-MM9D9] {
                                                 1: {
                                                   type: 2
                                                   weight: 1
                                                   flags: 5
                                                   backup_idx: 0
                                                   vrf_id: 0
                                                   nh_encap_type: 0
                                                   gate: {
                                                     value: 5.87967e+08
                                                     string: "192.168.11.35"
                                                   }
                                                   nh_label_type: 0
                                                   srte_color: 0
                                                   ifindex: 0
                                                   backup_num: 0
                                                 }
                                                 2: {
                                                   type: 3
                                                   weight: 1
                                                   flags: 3
                                                   backup_idx: 0
                                                   vrf_id: 0
                                                   nh_encap_type: 0
                                                   nh_label_type: 0
                                                   srte_color: 0
                                                   ifindex: 4
                                                   backup_num: 0
                                                 }
                                               }
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agolib: Start from 1, not 0 when creating Lua tables for nexthops
Donatas Abraitis [Wed, 28 Aug 2024 12:31:47 +0000 (15:31 +0300)]
lib: Start from 1, not 0 when creating Lua tables for nexthops

Lua technically enumerates arrays from 1, not 0.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agolib: Memory spike reduction for sh cmds at scale
Srujana [Tue, 30 Jul 2024 20:39:33 +0000 (20:39 +0000)]
lib: Memory spike reduction for sh cmds at scale

The output buffer vty->obuf is a linked list where
each element is of 4KB.
Currently, when a huge sh command  like <show ip route json>
is executed on a large scale, all the vty_outs are
processed and the entire data is accumulated.
After the entire vty execution, vtysh_flush proceeses
and puts this data in the socket (131KB at a time).

Problem here is the memory spike for such heavy duty
show commands.

The fix here is to chunkify the output on VTY shell by
flushing it intermediately for every 128 KB of output
accumulated and free the memory allocated for the buffer data.

This way, we achieve ~25-30% reduction in the memory spike.

Fixes: #16498
Note: This is a continuation of MR #16498

Signed-off-by: Srujana <skanchisamud@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
8 months agoMerge pull request #16655 from louis-6wind/fix-bmp-bpi-extra
Donatas Abraitis [Tue, 27 Aug 2024 19:14:13 +0000 (22:14 +0300)]
Merge pull request #16655 from louis-6wind/fix-bmp-bpi-extra

bgpd: fix labels static-analyser

8 months agoMerge pull request #16651 from opensourcerouting/fix/blackhole_community_bgpd
Donald Sharp [Tue, 27 Aug 2024 19:11:00 +0000 (15:11 -0400)]
Merge pull request #16651 from opensourcerouting/fix/blackhole_community_bgpd

bgpd: Respect BLACKHOLE community for internal BGP peering also

8 months agoMerge pull request #16665 from louis-6wind/fix-flexalgo-crash-no-te
Jafar Al-Gharaibeh [Tue, 27 Aug 2024 17:52:50 +0000 (13:52 -0400)]
Merge pull request #16665 from louis-6wind/fix-flexalgo-crash-no-te

isisd: fix crash at flex-algo without mpls-te

8 months agoMerge pull request #16652 from opensourcerouting/fix/prefix_sid_handling
Russ White [Tue, 27 Aug 2024 14:57:44 +0000 (10:57 -0400)]
Merge pull request #16652 from opensourcerouting/fix/prefix_sid_handling

bgpd: Filter Prefix-SID, Encap, PMSI Tunnel

8 months agoMerge pull request #16610 from Jafaral/no-py
Russ White [Tue, 27 Aug 2024 14:38:09 +0000 (10:38 -0400)]
Merge pull request #16610 from Jafaral/no-py

tools, ospfclient: add a config option to skip installing python scripts

8 months agoisisd: fix crash at flex-algo without mpls-te
Louis Scalbert [Tue, 27 Aug 2024 13:45:38 +0000 (15:45 +0200)]
isisd: fix crash at flex-algo without mpls-te

Fix crash when flex-algo is configured and mpls-te is disabled.

> interface eth0
>  ip router isis 1
> !
> router isis 1
>  flex-algo 129
>   dataplane sr-mpls
>   advertise-definition

> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140486233631168) at ./nptl/pthread_kill.c:44
> #1  __pthread_kill_internal (signo=11, threadid=140486233631168) at ./nptl/pthread_kill.c:78
> #2  __GI___pthread_kill (threadid=140486233631168, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
> #3  0x00007fc5802e9476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
> #4  0x00007fc58076021f in core_handler (signo=11, siginfo=0x7ffd38d42470, context=0x7ffd38d42340) at lib/sigevent.c:248
> #5  <signal handler called>
> #6  0x000055c527f798c9 in isis_link_params_update_asla (circuit=0x55c52aaed3c0, ifp=0x55c52a1044e0) at isisd/isis_te.c:176
> #7  0x000055c527fb29da in isis_instance_flex_algo_create (args=0x7ffd38d43120) at isisd/isis_nb_config.c:2875
> #8  0x00007fc58072655b in nb_callback_create (context=0x55c52ab1d2f0, nb_node=0x55c529f72950, event=NB_EV_APPLY, dnode=0x55c52ab06230, resource=0x55c52ab189f8, errmsg=0x7ffd38d43750 "",
>     errmsg_len=8192) at lib/northbound.c:1262
> #9  0x00007fc580727625 in nb_callback_configuration (context=0x55c52ab1d2f0, event=NB_EV_APPLY, change=0x55c52ab189c0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) at lib/northbound.c:1662
> #10 0x00007fc580727c39 in nb_transaction_process (event=NB_EV_APPLY, transaction=0x55c52ab1d2f0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) at lib/northbound.c:1794
> #11 0x00007fc580725f77 in nb_candidate_commit_apply (transaction=0x55c52ab1d2f0, save_transaction=true, transaction_id=0x0, errmsg=0x7ffd38d43750 "", errmsg_len=8192)
>     at lib/northbound.c:1131
> #12 0x00007fc5807260d1 in nb_candidate_commit (context=..., candidate=0x55c529f0a730, save_transaction=true, comment=0x0, transaction_id=0x0, errmsg=0x7ffd38d43750 "", errmsg_len=8192)
>     at lib/northbound.c:1164
> #13 0x00007fc58072d220 in nb_cli_classic_commit (vty=0x55c52a0fc6b0) at lib/northbound_cli.c:51
> #14 0x00007fc58072d839 in nb_cli_apply_changes_internal (vty=0x55c52a0fc6b0,
>     xpath_base=0x7ffd38d477f0 "/frr-isisd:isis/instance[area-tag='1'][vrf='default']/flex-algos/flex-algo[flex-algo='129']", clear_pending=false) at lib/northbound_cli.c:178
> #15 0x00007fc58072dbcf in nb_cli_apply_changes (vty=0x55c52a0fc6b0, xpath_base_fmt=0x55c528014de0 "./flex-algos/flex-algo[flex-algo='%ld']") at lib/northbound_cli.c:234
> #16 0x000055c527fd3403 in flex_algo_magic (self=0x55c52804f1a0 <flex_algo_cmd>, vty=0x55c52a0fc6b0, argc=2, argv=0x55c52ab00ec0, algorithm=129, algorithm_str=0x55c52ab120d0 "129")
>     at isisd/isis_cli.c:3752
> #17 0x000055c527fc97cb in flex_algo (self=0x55c52804f1a0 <flex_algo_cmd>, vty=0x55c52a0fc6b0, argc=2, argv=0x55c52ab00ec0) at ./isisd/isis_cli_clippy.c:6445
> #18 0x00007fc5806b9abc in cmd_execute_command_real (vline=0x55c52aaf78f0, vty=0x55c52a0fc6b0, cmd=0x0, up_level=0) at lib/command.c:984
> #19 0x00007fc5806b9c35 in cmd_execute_command (vline=0x55c52aaf78f0, vty=0x55c52a0fc6b0, cmd=0x0, vtysh=0) at lib/command.c:1043
> #20 0x00007fc5806ba1e5 in cmd_execute (vty=0x55c52a0fc6b0, cmd=0x55c52aae6bd0 "flex-algo 129\n", matched=0x0, vtysh=0) at lib/command.c:1209
> #21 0x00007fc580782ae1 in vty_command (vty=0x55c52a0fc6b0, buf=0x55c52aae6bd0 "flex-algo 129\n") at lib/vty.c:615
> #22 0x00007fc580784a05 in vty_execute (vty=0x55c52a0fc6b0) at lib/vty.c:1378
> #23 0x00007fc580787131 in vtysh_read (thread=0x7ffd38d4ab10) at lib/vty.c:2373
> #24 0x00007fc58077b605 in event_call (thread=0x7ffd38d4ab10) at lib/event.c:2011
> #25 0x00007fc5806f8976 in frr_run (master=0x55c529df9b30) at lib/libfrr.c:1212
> #26 0x000055c527f301bc in main (argc=5, argv=0x7ffd38d4ad58, envp=0x7ffd38d4ad88) at isisd/isis_main.c:350
> (gdb) f 6
> #6  0x000055c527f798c9 in isis_link_params_update_asla (circuit=0x55c52aaed3c0, ifp=0x55c52a1044e0) at isisd/isis_te.c:176
> 176                     list_delete_all_node(ext->aslas);
> (gdb) p ext
> $1 = (struct isis_ext_subtlvs *) 0x0

Fixes: ae27101e6f ("isisd: fix building asla at first flex-algo config")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agolib: common debug status output
Igor Ryzhov [Tue, 26 Mar 2024 18:25:21 +0000 (20:25 +0200)]
lib: common debug status output

Implement common code for debug status output and remove daemon-specific
code that is duplicated everywhere.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
8 months agolib: common debug config output
Igor Ryzhov [Tue, 26 Mar 2024 17:24:45 +0000 (19:24 +0200)]
lib: common debug config output

Implement common code for debug config output and remove daemon-specific
code that is duplicated everywhere.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
8 months agolib: rework debug init
Igor Ryzhov [Tue, 26 Mar 2024 14:54:54 +0000 (16:54 +0200)]
lib: rework debug init

The debug library allows to register a `debug_set_all` callback which
should enable all debugs in a daemon. This callback is implemented
exactly the same in each daemon. Instead of duplicating the code, rework
the lib to allow registration of each debug type, and implement the
common code only once in the lib.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
8 months agoMerge pull request #16103 from mjstapp/fix_5549_nhg_type
Russ White [Tue, 27 Aug 2024 13:46:53 +0000 (09:46 -0400)]
Merge pull request #16103 from mjstapp/fix_5549_nhg_type

zebra: be consistent about v6 nexthops for v4 routes

8 months agoMerge pull request #16656 from donaldsharp/minor_fix_for_pim_dr_nondr
Mark Stapp [Tue, 27 Aug 2024 12:17:46 +0000 (08:17 -0400)]
Merge pull request #16656 from donaldsharp/minor_fix_for_pim_dr_nondr

tests: Allow convergence before adding multicast routes

8 months agotests: Add some tests to show new behavior works as expected
Donald Sharp [Thu, 15 Aug 2024 20:02:55 +0000 (16:02 -0400)]
tests: Add some tests to show new behavior works as expected

a) A noprefix address by itself should not create a connected route.
   This was pre-existing.
b) A noprefix address with a corresponding route should result in a
   connected route.  This is how NetworkManager appears to work.
   This is new behavior, so a new test.
c) A route is added to the system from someone else.
   This is new behavior, so a new test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Prevent accidental re memory leak in odd case
Donald Sharp [Wed, 26 Jun 2024 17:21:38 +0000 (13:21 -0400)]
zebra: Prevent accidental re memory leak in odd case

There exists a path in rib_add_multipath where if a decision
is made to not use the passed in re, we just drop the memory
instead of freeing it.  Let's free it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Handle kernel routes appropriately
Donald Sharp [Fri, 7 Jun 2024 17:50:07 +0000 (13:50 -0400)]
zebra: Handle kernel routes appropriately

Current code intentionally ignores kernel routes.  Modify
zebra to allow these routes to be read in on linux.  Also
modify zebra to look to see if a route should be treated
as a connected and mark it as such.

Additionally this should properly handle some of the issues
being seen with NOPREFIXROUTE.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Expose rib_update_handle_vrf_all
Donald Sharp [Fri, 7 Jun 2024 16:56:35 +0000 (12:56 -0400)]
zebra: Expose rib_update_handle_vrf_all

This function will be used on interface down
events to allow for kernel routes to be cleaned
up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Make p and src_p const for rib_delete
Donald Sharp [Fri, 7 Jun 2024 16:30:59 +0000 (12:30 -0400)]
zebra: Make p and src_p const for rib_delete

The prefix'es p and src_p are not const.  Let's make
them so.  Useful to signal that we will not change this
data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobgpd: Respect BLACKHOLE community for internal BGP peering also
Donatas Abraitis [Tue, 27 Aug 2024 07:08:54 +0000 (10:08 +0300)]
bgpd: Respect BLACKHOLE community for internal BGP peering also

rfc7999 does not define to use this technique ONLY for EBGP sessions.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16657 from Jafaral/ospfv3_test_fix
Donald Sharp [Tue, 27 Aug 2024 00:29:38 +0000 (20:29 -0400)]
Merge pull request #16657 from Jafaral/ospfv3_test_fix

tests: Fix frequent ospfv3 basic functionality test failure

8 months agotests: Fix frequent ospfv3 basic functionality test failure
Jafar Al-Gharaibeh [Mon, 26 Aug 2024 20:06:35 +0000 (15:06 -0500)]
tests: Fix frequent ospfv3 basic functionality test failure

The dead timer is set to 4 seconds, while the hello interval is set to 6535.
This test will only pass of the platform is fast enough for ospfv3 to
converge in 4 seconds. These timers were already tested multiple time earlier.
This test should just make sure that the boundary value 65535 is configurable,

Other changes in this commit:
  - add sequence numbers to the dead intervals tests to make it easier to
    track test faliures.
  - swap the config order in one test to match order with all other tests.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agotests: Allow convergence before adding multicast routes
Donald Sharp [Wed, 21 Aug 2024 19:44:12 +0000 (15:44 -0400)]
tests: Allow convergence before adding multicast routes

Current code adds a new vlan interface, sets up ospf and
pim on it and immediately starts shoving data down the pipes.
This of course has the fun thing where the IGP and pim do not
always come up in a nice neat manner and the test is looking
for state from a nice neat come up, even though pim is `working`
correctly it is not correct for what the test wants.

Modify the code to ensure that ospf is up and has propagated
the route where it is needed as well as that pim neighbors have
properly come up, then initiate the multicast streams and igmp
reports.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobgpd: fix labels static-analyser
Louis Scalbert [Mon, 26 Aug 2024 08:23:12 +0000 (10:23 +0200)]
bgpd: fix labels static-analyser

Fix static-analyser warnings with BGP labels:

> $ scan-build make -j12
> bgpd/bgp_updgrp_packet.c:819:10: warning: Access to field 'extra' results in a dereference of a null pointer (loaded from variable 'path') [core.NullDereference]
>                                                 ? &path->extra->labels->label[0]
>                                                    ^~~~~~~~~

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agobgpd: Set encap attribute if received and parsed
Donatas Abraitis [Sun, 25 Aug 2024 16:15:10 +0000 (19:15 +0300)]
bgpd: Set encap attribute if received and parsed

It's not used much in the code, but we should have it set when everything is fine.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agobgpd: Allow filtering Encap attribute
Donatas Abraitis [Sun, 25 Aug 2024 16:11:01 +0000 (19:11 +0300)]
bgpd: Allow filtering Encap attribute

Filtering this attribute via `path-attribute discard/treat-as-widthraw`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agobgpd: Allow filtering PMSI Tunnel attribute
Donatas Abraitis [Sun, 25 Aug 2024 16:05:53 +0000 (19:05 +0300)]
bgpd: Allow filtering PMSI Tunnel attribute

Filtering this attribute via `path-attribute discard/treat-as-widthraw`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agobgpd: Allow filtering Prefix-SID attribute
Donatas Abraitis [Sun, 25 Aug 2024 16:03:05 +0000 (19:03 +0300)]
bgpd: Allow filtering Prefix-SID attribute

Filtering this attribute via `path-attribute discard/treat-as-widthraw`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16649 from opensourcerouting/fix/free_memory_on_return
Donald Sharp [Sat, 24 Aug 2024 19:30:45 +0000 (15:30 -0400)]
Merge pull request #16649 from opensourcerouting/fix/free_memory_on_return

bgpd: Free epvn_overlay memory on error

8 months agobgpd: Free epvn_overlay memory on error
Donatas Abraitis [Sat, 24 Aug 2024 08:58:48 +0000 (11:58 +0300)]
bgpd: Free epvn_overlay memory on error

When parsing EVPN NLRIs, and an error occurred, do no forget to free the memory.

Fixes: 4ace11d010 ("bgpd: Move evpn_overlay to a pointer")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16646 from csilt/pim-ifp-crash
Donatas Abraitis [Sat, 24 Aug 2024 08:12:23 +0000 (11:12 +0300)]
Merge pull request #16646 from csilt/pim-ifp-crash

pimd: Fix crash in pimd

8 months agoMerge pull request #16631 from pguibert6WIND/imported_from_l3nhg_json
Donatas Abraitis [Sat, 24 Aug 2024 06:32:49 +0000 (09:32 +0300)]
Merge pull request #16631 from pguibert6WIND/imported_from_l3nhg_json

bgpd: add json support for BGP L3NHG values

8 months agopimd: Fix crash in pimd
Corey Siltala [Fri, 23 Aug 2024 18:04:26 +0000 (18:04 +0000)]
pimd: Fix crash in pimd

ifp->info is not always set in PIM. So add a guard here to stop
it from crashing when addresses are added to a non-PIM enabled interface
and PIM zebra debugging is enabled.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
8 months agoMerge pull request #16609 from donaldsharp/singleton_no_weight
Mark Stapp [Fri, 23 Aug 2024 20:19:29 +0000 (16:19 -0400)]
Merge pull request #16609 from donaldsharp/singleton_no_weight

Reduce the number of Singleton objects when using weight for NHG's

8 months agoMerge pull request #16640 from louis-6wind/fix-nhrp-local
Donatas Abraitis [Fri, 23 Aug 2024 19:57:09 +0000 (22:57 +0300)]
Merge pull request #16640 from louis-6wind/fix-nhrp-local

nhrpd: fix sending /32 shortcut

8 months agoMerge pull request #16633 from Jafaral/fix-version-build
Donald Sharp [Fri, 23 Aug 2024 18:45:33 +0000 (14:45 -0400)]
Merge pull request #16633 from Jafaral/fix-version-build

config: fix missing case when reporting version 'configured with'

8 months agonhrpd: fix sending /32 shortcut
Louis Scalbert [Fri, 23 Aug 2024 14:05:45 +0000 (16:05 +0200)]
nhrpd: fix sending /32 shortcut

The remote spoke always sends a 32 prefix length to a shortcut request.
In the example, the remote spoke as the IP address 192.168.2.1/24.

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.1/32           10.255.255.2

Do not deal with local routes in nhrpd. Now:

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.0/24           10.255.255.2

Fixes: d4aa24ba7d ("*: Introduce Local Host Routes to FRR")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agobgpd: add json support for BGP L3NHG values
Philippe Guibert [Thu, 22 Aug 2024 14:53:55 +0000 (16:53 +0200)]
bgpd: add json support for BGP L3NHG values

Some json attributes are missing for L3NHG values.

> PE1# show bgp vrf all detail
> [..]
> Instance vrf-purple:
> BGP table version is 1, local router ID is 27.3.0.85, vrf id 7
> Default local pref 100, local AS 65000
> BGP routing table entry for fe80::4620:ff:feff:ff01/128, version 1
> Paths: (1 available, best #1, vrf vrf-purple)
>   Not advertised to any peer
>   Imported from 10.30.30.30:5:[2]:[0]:[48]:[44:20:00:ff:ff:01]:[128]:[fe80::4620:ff:feff:ff01], VNI 4000  Local
>     ::ffff:a1e:1e1e (metric 20) from 10.30.30.30 (10.30.30.30) announce-nh-self
>       Origin IGP, localpref 100, valid, internal, best (First path received)
>       Extended Community: RT:65000:4000 ET:8
>       Last update: Thu Aug 22 18:23:38 2024
>
> Displayed 1 routes and 1 total paths

> PE1# show bgp vrf all json detail
> {
> "vrf-purple":{
>  "vrfId": 7,
>  "vrfName": "vrf-purple",
>  "tableVersion": 1,
>  "routerId": "27.3.0.85",
>  "defaultLocPrf": 100,
>  "localAS": 65000,
>  "routes": { "fe80::4620:ff:feff:ff01/128": [{"importedFrom":"10.30.30.30:5","l3nhg":false,"l3nhgActive":false, "vni": "4000",
> "aspath":{"string":"Local","segments":[],"length":0},"announceNexthopSelf":true,"origin":"IGP","locPrf":100,
> "valid":true,"version":1,"bestpath":{"overall":true,"selectionReason":"First path received"},
> "extendedCommunity":{"string":"RT:65000:4000 ET:8"},"lastUpdate":{"epoch":1724343817,
> "string":"Thu Aug 22 18:23:37 2024\n"},
> "nexthops":[{"ip":"::ffff:a1e:1e1e","hostname":"PE2","afi":"ipv6",
> "scope":"global","metric":20,"accessible":true,"used":true}],
> "peer":{"peerId":"10.30.30.30","routerId":"10.30.30.30","hostname":"PE2","type":"internal"}}]
>  }  }
> }

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 months agoMerge pull request #15561 from kraj/master
Jafar Al-Gharaibeh [Fri, 23 Aug 2024 04:34:00 +0000 (00:34 -0400)]
Merge pull request #15561 from kraj/master

Mimic GNU basename() API for non-glibc library e.g. musl

8 months agoMerge pull request #16632 from donaldsharp/SA_warnings_from_upstream
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 22:25:11 +0000 (18:25 -0400)]
Merge pull request #16632 from donaldsharp/SA_warnings_from_upstream

Sa warnings from upstream

8 months agoMerge pull request #16615 from Jafaral/revert-v4-v6-bgp
Donald Sharp [Thu, 22 Aug 2024 21:57:38 +0000 (17:57 -0400)]
Merge pull request #16615 from Jafaral/revert-v4-v6-bgp

Revert ipv4-mapped ipv6 and 6vpe nexthop in BGP

8 months agozebra: Mimic GNU basename() API for non-glibc library e.g. musl
Khem Raj [Fri, 15 Mar 2024 21:34:06 +0000 (14:34 -0700)]
zebra: Mimic GNU basename() API for non-glibc library e.g. musl

musl only provides POSIX version of basename and it has also removed
providing it via string.h header [1] which now results in compile errors
with newer compilers e.g. clang-18

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

Signed-off-by: Khem Raj <raj.khem@gmail.com>
8 months agoconfig: fix missing case when reporting version 'configured with'
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 19:26:01 +0000 (14:26 -0500)]
config: fix missing case when reporting version 'configured with'

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agoMerge pull request #16630 from donaldsharp/babel_metric
Mark Stapp [Thu, 22 Aug 2024 19:20:32 +0000 (15:20 -0400)]
Merge pull request #16630 from donaldsharp/babel_metric

Babel metric