]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agobgpd: Dump BGP attrs to check what's the actual prefix with aggr_as 0
Donatas Abraitis [Sat, 6 Feb 2021 11:57:42 +0000 (13:57 +0200)]
bgpd: Dump BGP attrs to check what's the actual prefix with aggr_as 0

Just for more debug information regarding malformed aggregator_as.

```
bgpd[5589]: [EC 33554434] 192.168.10.25: AGGREGATOR AS number is 0 for aspath: 65030
bgpd[5589]: bgp_attr_aggregator: attributes: nexthop 192.168.10.25, origin i, path 65030
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #7937 from pjdruddy/topotest-evpn-svi-advertise
Quentin Young [Fri, 5 Feb 2021 19:30:55 +0000 (14:30 -0500)]
Merge pull request #7937 from pjdruddy/topotest-evpn-svi-advertise

tests: update EVPN VXLAN for SVI behaviour change

3 years agoMerge pull request #7981 from gromit1811/fix_ospf6_lsa_str_retval
Quentin Young [Fri, 5 Feb 2021 19:08:37 +0000 (14:08 -0500)]
Merge pull request #7981 from gromit1811/fix_ospf6_lsa_str_retval

ospf6d: Fix LSA formatting inconsistent retvals

3 years agoMerge pull request #8019 from ton31337/fix/bgpd_aggregator_0
Donald Sharp [Fri, 5 Feb 2021 17:33:29 +0000 (12:33 -0500)]
Merge pull request #8019 from ton31337/fix/bgpd_aggregator_0

bgpd: Unset only aggregator flag when AGGREGATOR_AS is 0

3 years agoMerge pull request #7218 from kuldeepkash/multicast_pim_bsm
Donald Sharp [Fri, 5 Feb 2021 15:20:15 +0000 (10:20 -0500)]
Merge pull request #7218 from kuldeepkash/multicast_pim_bsm

tests: Add multicast-pim-bsm-topo1 suite

3 years agobgpd: Unset only aggregator flag when AGGREGATOR_AS is 0
Donatas Abraitis [Fri, 5 Feb 2021 14:47:55 +0000 (16:47 +0200)]
bgpd: Unset only aggregator flag when AGGREGATOR_AS is 0

Avoid mangling packet size which is expected to be the same as received.

Stream pointer advancing is necessary to avoid changing the packet and
reseting BGP sessions.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #7126 from vijaykug/multicast_with_static_rp
Donald Sharp [Fri, 5 Feb 2021 14:37:40 +0000 (09:37 -0500)]
Merge pull request #7126 from vijaykug/multicast_with_static_rp

tests: Add multicast-pim-static-rp-topo1 test suite

3 years agoMerge pull request #7998 from volta-networks/fix_isis_attach_bit
Donald Sharp [Thu, 4 Feb 2021 23:46:19 +0000 (18:46 -0500)]
Merge pull request #7998 from volta-networks/fix_isis_attach_bit

isisd: When adjacencies go up and down add support to modify attached-bit

3 years agoMerge pull request #8010 from ton31337/fix/drop_aggregate_as_attribute_if_malformed
Mark Stapp [Thu, 4 Feb 2021 20:02:42 +0000 (15:02 -0500)]
Merge pull request #8010 from ton31337/fix/drop_aggregate_as_attribute_if_malformed

bgpd: Drop aggregator_as attribute if malformed in case of BGP_AS_ZERO

3 years agoMerge pull request #7709 from donaldsharp/vrf_doc
Mark Stapp [Thu, 4 Feb 2021 18:53:07 +0000 (13:53 -0500)]
Merge pull request #7709 from donaldsharp/vrf_doc

zebra: Slightly touch on the vrf route lookup semantics

3 years agoMerge pull request #8009 from pjdruddy/evpn-cleanup
Donald Sharp [Thu, 4 Feb 2021 18:37:24 +0000 (13:37 -0500)]
Merge pull request #8009 from pjdruddy/evpn-cleanup

zebra: resolve multiple functions for local MAC delete

3 years agoMerge pull request #7961 from mobash-rasool/ospfv3-feature
Mark Stapp [Thu, 4 Feb 2021 18:32:34 +0000 (13:32 -0500)]
Merge pull request #7961 from mobash-rasool/ospfv3-feature

ospf6d: add CLI to control maximum paths for routes.

3 years agoMerge pull request #8007 from wesleycoakley/xcompile-writeup
Mark Stapp [Thu, 4 Feb 2021 18:31:49 +0000 (13:31 -0500)]
Merge pull request #8007 from wesleycoakley/xcompile-writeup

doc: cross compilation guide

3 years agoMerge pull request #7941 from donaldsharp/instance_data
Mark Stapp [Thu, 4 Feb 2021 17:16:15 +0000 (12:16 -0500)]
Merge pull request #7941 from donaldsharp/instance_data

zebra: Display instance id as part of `show zebra client summ`

3 years agodoc: Slightly touch on the vrf route lookup semantics
Donald Sharp [Thu, 10 Dec 2020 12:38:52 +0000 (07:38 -0500)]
doc: Slightly touch on the vrf route lookup semantics

People keep asking about the default unreachable route
in the linux vrf table.  Add a bit of color about the
design choices and what is going on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Display instance id as part of `show zebra client summ`
Donald Sharp [Wed, 27 Jan 2021 13:21:14 +0000 (08:21 -0500)]
zebra: Display instance id as part of `show zebra client summ`

When displaying `show zebra client summ` when we have instances
running, display the instance number as well.

New Output:

sharpd@eva ~/frr7 (instance_data)> vtysh -c "show zebra client summ"
Name      Connect Time    Last Read  Last Write  IPv4 Routes       IPv6 Routes
--------------------------------------------------------------------------------
ospf[1]       00:00:02     00:00:02    00:00:02       0/0              0/0
ospf[5]       00:00:02     00:00:02    00:00:02       0/0              0/0
sharp         00:00:02     00:00:02    00:00:02       0/0              0/0
static        00:00:02     00:00:02    00:00:02       0/0              0/0
Routes column shows (added+updated)/deleted

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #6049 from sarav511/ovrdhold
Russ White [Thu, 4 Feb 2021 12:14:31 +0000 (07:14 -0500)]
Merge pull request #6049 from sarav511/ovrdhold

pimd: SGRpt prune received during prune didn't override holdtime

3 years agoMerge pull request #8013 from mjstapp/fix_topo_ospf6_topo1
Donald Sharp [Thu, 4 Feb 2021 00:59:49 +0000 (19:59 -0500)]
Merge pull request #8013 from mjstapp/fix_topo_ospf6_topo1

tests: fix ospf6_topo1 missing ref files

3 years agotests: fix ospf6_topo1 missing ref files
Mark Stapp [Wed, 3 Feb 2021 21:28:18 +0000 (16:28 -0500)]
tests: fix ospf6_topo1 missing ref files

Only one of the four reference files was present; add the missing
three. The test just silently passed if a ref file was missing:
change that to a failure.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agodoc: cross compilation guide
Wesley Coakley [Tue, 2 Feb 2021 23:16:51 +0000 (18:16 -0500)]
doc: cross compilation guide

Wrote a little guide for cross-compiling FRR, gleaned from notes I took
while compiling for a RPi 3B+ on a Gentoo x86_64 system.

Care was taken to keep this documentation as generic as possible so
these steps could be applied to any cross-compile targeting a supported
architecture.

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
3 years agoMerge pull request #8004 from opensourcerouting/xref-cxx
Donald Sharp [Wed, 3 Feb 2021 16:23:15 +0000 (11:23 -0500)]
Merge pull request #8004 from opensourcerouting/xref-cxx

lib/xref: fix C++ issues

3 years agobgpd: Drop aggregator_as attribute if malformed in case of BGP_AS_ZERO
Donatas Abraitis [Wed, 3 Feb 2021 12:58:23 +0000 (14:58 +0200)]
bgpd: Drop aggregator_as attribute if malformed in case of BGP_AS_ZERO

An UPDATE message that contains the AS number of zero in the AS_PATH
   or AGGREGATOR attribute MUST be considered as malformed and be
   handled by the procedures specified in [RFC7606].

An UPDATE message with a malformed AGGREGATOR attribute SHALL be
   handled using the approach of "attribute discard".

Attribute discard: In this approach, the malformed attribute MUST
      be discarded and the UPDATE message continues to be processed.
      This approach MUST NOT be used except in the case of an attribute
      that has no effect on route selection or installation.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agozebra: resolve multiple functions for local MAC delete
Pat Ruddy [Mon, 1 Jun 2020 13:33:30 +0000 (14:33 +0100)]
zebra: resolve multiple functions for local MAC delete

the old VXLAN function for local MAC deletion was still in
existence and being called from the VXLAN code whilst the new
generic function was not being called at all. Resolve this so
the generic function matches the old function and is called
exclusively.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agolib/xref: fix initializer order for C++
David Lamparter [Tue, 2 Feb 2021 18:27:41 +0000 (19:27 +0100)]
lib/xref: fix initializer order for C++

[v2: drop designated initializer names]

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoMerge pull request #7449 from sudhanshukumar22/bgp-update-connect-timer
Donatas Abraitis [Wed, 3 Feb 2021 10:15:04 +0000 (12:15 +0200)]
Merge pull request #7449 from sudhanshukumar22/bgp-update-connect-timer

bgpd: config connect timer not applied immediately for non-established peers.

3 years agolib/xref: fix frrtrace() calls in thread code
David Lamparter [Tue, 2 Feb 2021 20:05:50 +0000 (21:05 +0100)]
lib/xref: fix frrtrace() calls in thread code

This didn't exist yet when the xref code came around, and since
frrtrace() gets collapsed to nothing by the preprocessor when
tracepoints are disabled, it didn't cause any compiler errors...

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: work around GCC bug 41091
David Lamparter [Tue, 2 Feb 2021 18:38:38 +0000 (19:38 +0100)]
lib/xref: work around GCC bug 41091

gcc fucks up global variables with section attributes when they're used
in templated C++ code.  The template instantiation "magic" kinda breaks
down (it's implemented through COMDAT in the linker, which clashes with
the section attribute.)

The workaround provides full runtime functionality, but the xref
extraction tool (xrelfo.py) won't work on C++ code compiled by GCC.

FWIW, clang gets this right.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: restore lost extern "C" beginning
David Lamparter [Tue, 2 Feb 2021 18:27:41 +0000 (19:27 +0100)]
lib/xref: restore lost extern "C" beginning

The `}` is still there, but the `extern "C" {` got lost somewhere,
probably in a rebase...

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoMerge pull request #8002 from idryzhov/fix-all-backets
Mark Stapp [Tue, 2 Feb 2021 20:42:58 +0000 (15:42 -0500)]
Merge pull request #8002 from idryzhov/fix-all-backets

*: fix all backets

3 years agoMerge pull request #8001 from ton31337/fix/bgpd_replace_65535_with_const
Quentin Young [Tue, 2 Feb 2021 18:43:15 +0000 (13:43 -0500)]
Merge pull request #8001 from ton31337/fix/bgpd_replace_65535_with_const

bgpd: Replace 65535 with UINT16_MAX

3 years ago*: fix all backets
Igor Ryzhov [Tue, 2 Feb 2021 16:11:25 +0000 (19:11 +0300)]
*: fix all backets

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #7314 from kuldeepkash/multicast-sm-topo1
Donald Sharp [Tue, 2 Feb 2021 15:43:09 +0000 (10:43 -0500)]
Merge pull request #7314 from kuldeepkash/multicast-sm-topo1

Add multicast-pim-sm-topo1 test suite

3 years agobgpd: Replace 65535 with UINT16_MAX
Donatas Abraitis [Tue, 2 Feb 2021 08:28:18 +0000 (10:28 +0200)]
bgpd: Replace 65535 with UINT16_MAX

Just consistent.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #6766 from opensourcerouting/xref
Russ White [Tue, 2 Feb 2021 12:44:21 +0000 (07:44 -0500)]
Merge pull request #6766 from opensourcerouting/xref

lib: xrefs - general cross-references & unique IDs

3 years agoMerge pull request #7987 from donaldsharp/eigrp_mtu_correct
Russ White [Tue, 2 Feb 2021 12:31:55 +0000 (07:31 -0500)]
Merge pull request #7987 from donaldsharp/eigrp_mtu_correct

eigrpd: Correctly set the mtu for eigrp packets sent

3 years agoMerge pull request #7991 from donaldsharp/valgrind_cleanups1
Russ White [Tue, 2 Feb 2021 12:30:06 +0000 (07:30 -0500)]
Merge pull request #7991 from donaldsharp/valgrind_cleanups1

Valgrind cleanups

3 years agobgpd: config connect timer is not applied immediately for peers in non-established...
sudhanshukumar22 [Wed, 4 Nov 2020 05:21:42 +0000 (21:21 -0800)]
bgpd: config connect timer is not applied immediately for peers in non-established state.

Description:
When user is config connect timer, it doesn't reflect
immediately. It reflect when next time neighbor is tried to reconnect.

Problem Description/Summary :
When user is config connect timer, it doesn't reflect
The network connection was aborted by the local system.d to reconnect.
Fix is to update the connect timer immediately if BGP
    session is not in establish state.

Expected Behavior :
If neighbor is not yet established, we should immediately apply the config connect timer to the peer.

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
3 years agoMerge pull request #7985 from donaldsharp/eigrp_uninited
Donatas Abraitis [Tue, 2 Feb 2021 07:14:24 +0000 (09:14 +0200)]
Merge pull request #7985 from donaldsharp/eigrp_uninited

bunch of valgrind issues

3 years agoMerge pull request #7992 from donaldsharp/bgp_locks
Donatas Abraitis [Tue, 2 Feb 2021 07:13:33 +0000 (09:13 +0200)]
Merge pull request #7992 from donaldsharp/bgp_locks

bgpd: Centralize the dest unlocking for adj_out data structure

3 years agoMerge pull request #7402 from ranjanyash54/dev_2
Donald Sharp [Tue, 2 Feb 2021 02:07:57 +0000 (21:07 -0500)]
Merge pull request #7402 from ranjanyash54/dev_2

ospf6d: Json support added for command "show ipv6 ospf6 route [json]"

3 years agoMerge pull request #7994 from opensourcerouting/disable-printf-n
Donald Sharp [Tue, 2 Feb 2021 01:41:27 +0000 (20:41 -0500)]
Merge pull request #7994 from opensourcerouting/disable-printf-n

lib/printf: disable `%n` specifier

3 years agoMerge pull request #7958 from sworleys/Fix-Nexthop-Infinite-Recurse
Mark Stapp [Mon, 1 Feb 2021 21:26:01 +0000 (16:26 -0500)]
Merge pull request #7958 from sworleys/Fix-Nexthop-Infinite-Recurse

zebra: disallow resolution to duplicate nexthops

3 years agotests: restore isis-lsp-bits-topo1 test
lynne [Sat, 30 Jan 2021 00:56:44 +0000 (19:56 -0500)]
tests: restore isis-lsp-bits-topo1 test

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
3 years agoisisd: When adjacencies go up and down add support to modify attached-bit
lynne [Sat, 30 Jan 2021 00:36:22 +0000 (19:36 -0500)]
isisd: When adjacencies go up and down add support to modify attached-bit

When adjacencies change state the attached-bits in LSPs in other areas
on the router may need to be modified.

 1. If a router no longer has a L2 adjacency to another area the
    attached-bit must no longer be sent in the LSP
 2. If a new L2 adjacency comes up in a different area then the
    attached-bit should be sent in the LSP

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
3 years agotopotests: add test for infinite recursion
Stephen Worley [Fri, 29 Jan 2021 20:58:34 +0000 (15:58 -0500)]
topotests: add test for infinite recursion

Add a test for the infinite recursion case fixed
with 0c4dbb5f8fe8fb188fa0e0aa8ce04764e893b79b

See that commit for details of the problem. This test uses a simpler
version of the repro found there as the test.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agozebra: disallow resolution to duplicate nexthops
Stephen Worley [Wed, 27 Jan 2021 21:20:22 +0000 (16:20 -0500)]
zebra: disallow resolution to duplicate nexthops

Disallow the resolution to nexthops that are marked duplicate.
When we are resolving to an ecmp group, it's possible this
group has duplicates.

I found this when I hit a bug where we can have groups resolving
to each other and cause the resolved->next->next pointer to increase
exponentially. Sufficiently large ecmp and zebra will grind to a hault.

Like so:

```
D>  4.4.4.14/32 [150/0] via 1.1.1.1 (recursive), weight 1, 00:00:02
  *                       via 1.1.1.1, dummy1 onlink, weight 1, 00:00:02
                        via 4.4.4.1 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.2 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.3 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.4 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.5 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.6 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.7 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.8 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.9 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.10 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.11 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.12 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.13 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.15 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1 onlink, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1 onlink, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                        via 4.4.4.16 (recursive), weight 1, 00:00:02
                          via 1.1.1.1, dummy1 onlink, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
                          via 1.1.1.1, dummy1, weight 1, 00:00:02
D>  4.4.4.15/32 [150/0] via 1.1.1.1 (recursive), weight 1, 00:00:09
  *                       via 1.1.1.1, dummy1 onlink, weight 1, 00:00:09
                        via 4.4.4.1 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.2 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.3 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.4 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.5 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.6 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.7 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.8 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.9 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.10 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.11 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.12 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.13 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.14 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                        via 4.4.4.16 (recursive), weight 1, 00:00:09
                          via 1.1.1.1, dummy1 onlink, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
                          via 1.1.1.1, dummy1, weight 1, 00:00:09
D>  4.4.4.16/32 [150/0] via 1.1.1.1 (recursive), weight 1, 00:00:19
  *                       via 1.1.1.1, dummy1 onlink, weight 1, 00:00:19
                        via 4.4.4.1 (recursive), weight 1, 00:00:19
                          via 1.1.1.1, dummy1, weight 1, 00:00:19
                        via 4.4.4.2 (recursive), weight 1, 00:00:19

...............
................

and on...

```

You can repro the above via:

```
kernel routes:

1.1.1.1 dev dummy1 scope link

4.4.4.0/24 via 1.1.1.1 dev dummy1

==============================

config:

nexthop-group doof
 nexthop 1.1.1.1
 nexthop 4.4.4.1
 nexthop 4.4.4.10
 nexthop 4.4.4.11
 nexthop 4.4.4.12
 nexthop 4.4.4.13
 nexthop 4.4.4.14
 nexthop 4.4.4.15
 nexthop 4.4.4.16
 nexthop 4.4.4.2
 nexthop 4.4.4.3
 nexthop 4.4.4.4
 nexthop 4.4.4.5
 nexthop 4.4.4.6
 nexthop 4.4.4.7
 nexthop 4.4.4.8
 nexthop 4.4.4.9
!

===========================

Then use sharpd to install 4.4.4.16 -> 4.4.4.1 pointing to that nexthop
group in decending order.
```

With these changes it prevents the growing ecmp above by disallowing
duplicates to be in the resolution decision. These nexthops are not
installed anyways so why should we be resolving to them?

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agolib/printf: disable `%n` specifier
David Lamparter [Mon, 1 Feb 2021 16:50:01 +0000 (17:50 +0100)]
lib/printf: disable `%n` specifier

We don't use `%n` anywhere, so the only purpose it serves is enabling
exploits.

(I thought about this initially when adding printfrr, but I wasn't sure
we don't use `%n` anywhere, and thought I'll check later, and then just
forgot it...)

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoMerge pull request #7972 from donaldsharp/getrusage_data
Mark Stapp [Mon, 1 Feb 2021 17:18:18 +0000 (12:18 -0500)]
Merge pull request #7972 from donaldsharp/getrusage_data

lib: Line up `show thread cpu` output appropriately

3 years agoMerge pull request #7948 from Jafaral/strongswan
Donald Sharp [Mon, 1 Feb 2021 17:02:30 +0000 (12:02 -0500)]
Merge pull request #7948 from Jafaral/strongswan

doc: update the links to nhrp/strongswan patches

3 years agotools/checkpatch: downgrade string concat warning
David Lamparter [Mon, 1 Feb 2021 16:33:03 +0000 (17:33 +0100)]
tools/checkpatch: downgrade string concat warning

This is the best I can make the asm blocks in lib/xref.h look, so just
mute the warning.  (It shouldn't come in relevant for other code.)

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agotests: add unit test for xrefs
David Lamparter [Sat, 18 Jul 2020 09:39:31 +0000 (11:39 +0200)]
tests: add unit test for xrefs

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agodoc/developer: xrefs
David Lamparter [Sat, 18 Jul 2020 09:12:52 +0000 (11:12 +0200)]
doc/developer: xrefs

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: add xrefs for install_element()
David Lamparter [Tue, 21 Jul 2020 06:28:04 +0000 (08:28 +0200)]
lib/xref: add xrefs for install_element()

Combined with the DEFUN xrefs, this means we can extract the full CLI
tree from a binary file.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: add xrefs for DEFUNs
David Lamparter [Tue, 28 Apr 2020 13:19:24 +0000 (15:19 +0200)]
lib/xref: add xrefs for DEFUNs

This allows grabbing a list of all DEFUNs and their help texts through
the xref extraction mechanics.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: add xrefs on zlog_* calls
David Lamparter [Tue, 28 Apr 2020 07:30:59 +0000 (09:30 +0200)]
lib/xref: add xrefs on zlog_* calls

This allows extracting a list of all log messages including their ECs
and autogenerated unique IDs for them.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: use to transport thread_* file/line/func
David Lamparter [Tue, 28 Apr 2020 07:30:50 +0000 (09:30 +0200)]
lib/xref: use to transport thread_* file/line/func

Just a better way of doing what was previously the "debugargdef" macro.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib/xref: put setup calls in libraries
David Lamparter [Thu, 30 Apr 2020 19:33:11 +0000 (21:33 +0200)]
lib/xref: put setup calls in libraries

Our "true" libraries (i.e. not modules) don't invoke neither
FRR_DAEMON_INFO nor FRR_MODULE_SETUP, hence XREF_SETUP isn't invoked
either.  Invoke it directly to get things working.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: "xref" identifier infrastructure
David Lamparter [Thu, 9 Aug 2018 20:50:19 +0000 (22:50 +0200)]
lib: "xref" identifier infrastructure

This adds the machinery for cross reference points (hence "xref") for
things to be annotated with source code location or other metadata
and/or to be uniquely identified and found at runtime or by dissecting
executable files.

The extraction tool to walk down an ELF file is done and working but
needs some more cleanup and will be added in a separate commit.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: move frr_weak_random to header file
David Lamparter [Fri, 1 May 2020 08:59:53 +0000 (10:59 +0200)]
lib: move frr_weak_random to header file

Makes more sense to have this as a static inline.  Also I don't want to
be forced to link network.o into clippy ;)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobgpd: Centralize the dest unlocking for adj_out data structure
Donald Sharp [Mon, 1 Feb 2021 15:14:38 +0000 (10:14 -0500)]
bgpd: Centralize the dest unlocking for adj_out data structure

When FRR creates a adj_out data structure we lock the `struct
bgp_dest` node associated with it.  On freeing of this data
structure and removing the lock it was not associated with
the actual free of the adjacency structure.  Let's clean up
the lock/unlock to be centralized to the alloc/free of the adj_out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7965 from opensourcerouting/netns-doc
Donald Sharp [Mon, 1 Feb 2021 14:01:25 +0000 (09:01 -0500)]
Merge pull request #7965 from opensourcerouting/netns-doc

doc: add information about network namespaces

3 years agolib: Line up `show thread cpu` output appropriately
Donald Sharp [Thu, 28 Jan 2021 16:25:51 +0000 (11:25 -0500)]
lib: Line up `show thread cpu` output appropriately

The output from `show thread cpu` was not lined up appropriately
for the header line.  As well as the function name we were
calling in the output.  Fix it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Prevent sending of unininted data
Donald Sharp [Sun, 31 Jan 2021 13:56:00 +0000 (08:56 -0500)]
zebra: Prevent sending of unininted data

valgrind is reporting:
2448137-==2448137== Thread 5 zebra_apic:
2448137-==2448137== Syscall param writev(vector[...]) points to uninitialised byte(s)
2448137:==2448137==    at 0x4D6FDDD: __writev (writev.c:26)
2448137-==2448137==    by 0x4D6FDDD: writev (writev.c:24)
2448137-==2448137==    by 0x48A35F5: buffer_flush_available (buffer.c:431)
2448137-==2448137==    by 0x48A3504: buffer_flush_all (buffer.c:237)
2448137-==2448137==    by 0x495948: zserv_write (zserv.c:263)
2448137-==2448137==    by 0x4904B7E: thread_call (thread.c:1681)
2448137-==2448137==    by 0x48BD3E5: fpt_run (frr_pthread.c:308)
2448137-==2448137==    by 0x4C61EA6: start_thread (pthread_create.c:477)
2448137-==2448137==    by 0x4D78DEE: clone (clone.S:95)
2448137-==2448137==  Address 0x720c3ce is 62 bytes inside a block of size 4,120 alloc'd
2448137:==2448137==    at 0x483877F: malloc (vg_replace_malloc.c:307)
2448137-==2448137==    by 0x48D2977: qmalloc (memory.c:110)
2448137-==2448137==    by 0x48A30E3: buffer_add (buffer.c:135)
2448137-==2448137==    by 0x48A30E3: buffer_put (buffer.c:161)
2448137-==2448137==    by 0x49591B: zserv_write (zserv.c:256)
2448137-==2448137==    by 0x4904B7E: thread_call (thread.c:1681)
2448137-==2448137==    by 0x48BD3E5: fpt_run (frr_pthread.c:308)
2448137-==2448137==    by 0x4C61EA6: start_thread (pthread_create.c:477)
2448137-==2448137==    by 0x4D78DEE: clone (clone.S:95)
2448137-==2448137==  Uninitialised value was created by a stack allocation
2448137:==2448137==    at 0x43E490: zserv_encode_vrf (zapi_msg.c:103)

Effectively we are sending `struct vrf_data` without ensuring
data has been properly initialized.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: prevent use after free
Donald Sharp [Sun, 31 Jan 2021 13:52:44 +0000 (08:52 -0500)]
ospf6d: prevent use after free

Valgrind reports:

2437395-==2437395== Invalid read of size 8
2437395:==2437395==    at 0x40B610: ospf6_asbr_update_route_ecmp_path (ospf6_asbr.c:327)
2437395-==2437395==    by 0x40BC7C: ospf6_asbr_lsa_add (ospf6_asbr.c:544)
2437395-==2437395==    by 0x40C5DF: ospf6_asbr_lsentry_add (ospf6_asbr.c:829)
2437395-==2437395==    by 0x42D88D: ospf6_top_brouter_hook_add (ospf6_top.c:185)
2437395-==2437395==    by 0x4188E3: ospf6_intra_brouter_calculation (ospf6_intra.c:2320)
2437395-==2437395==    by 0x42C624: ospf6_spf_calculation_thread (ospf6_spf.c:638)
2437395-==2437395==    by 0x4904B7E: thread_call (thread.c:1681)
2437395-==2437395==    by 0x48CAA27: frr_run (libfrr.c:1126)
2437395-==2437395==    by 0x40AF43: main (ospf6_main.c:232)
2437395-==2437395==  Address 0x5c668a8 is 24 bytes inside a block of size 256 free'd
2437395:==2437395==    at 0x48399AB: free (vg_replace_malloc.c:538)
2437395-==2437395==    by 0x429027: ospf6_route_delete (ospf6_route.c:419)
2437395-==2437395==    by 0x429027: ospf6_route_unlock (ospf6_route.c:460)
2437395-==2437395==    by 0x429027: ospf6_route_remove (ospf6_route.c:887)
2437395-==2437395==    by 0x40B343: ospf6_asbr_update_route_ecmp_path (ospf6_asbr.c:318)
2437395-==2437395==    by 0x40BC7C: ospf6_asbr_lsa_add (ospf6_asbr.c:544)
2437395-==2437395==    by 0x40C5DF: ospf6_asbr_lsentry_add (ospf6_asbr.c:829)
2437395-==2437395==    by 0x42D88D: ospf6_top_brouter_hook_add (ospf6_top.c:185)
2437395-==2437395==    by 0x4188E3: ospf6_intra_brouter_calculation (ospf6_intra.c:2320)
2437395-==2437395==    by 0x42C624: ospf6_spf_calculation_thread (ospf6_spf.c:638)
2437395-==2437395==    by 0x4904B7E: thread_call (thread.c:1681)
2437395-==2437395==    by 0x48CAA27: frr_run (libfrr.c:1126)
2437395-==2437395==    by 0x40AF43: main (ospf6_main.c:232)
2437395-==2437395==  Block was alloc'd at
2437395:==2437395==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
2437395-==2437395==    by 0x48D2A32: qcalloc (memory.c:115)
2437395-==2437395==    by 0x427CE4: ospf6_route_create (ospf6_route.c:402)
2437395-==2437395==    by 0x40BA8A: ospf6_asbr_lsa_add (ospf6_asbr.c:490)
2437395-==2437395==    by 0x40C5DF: ospf6_asbr_lsentry_add (ospf6_asbr.c:829)
2437395-==2437395==    by 0x42D88D: ospf6_top_brouter_hook_add (ospf6_top.c:185)
2437395-==2437395==    by 0x4188E3: ospf6_intra_brouter_calculation (ospf6_intra.c:2320)
2437395-==2437395==    by 0x42C624: ospf6_spf_calculation_thread (ospf6_spf.c:638)
2437395-==2437395==    by 0x4904B7E: thread_call (thread.c:1681)
2437395-==2437395==    by 0x48CAA27: frr_run (libfrr.c:1126)
2437395-==2437395==    by 0x40AF43: main (ospf6_main.c:232)

ospfv3 loops through the ecmp routes to decide what to clean up.  In some
situations the code free's up an existing route at the head of the list.
Cleaning the pointers in the list but never touching the original pointer.
In that case notice and update the old pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7988 from ton31337/fix/initialize_raw_data
Donald Sharp [Mon, 1 Feb 2021 12:42:21 +0000 (07:42 -0500)]
Merge pull request #7988 from ton31337/fix/initialize_raw_data

bgpd: Initialize bgp_notify.raw_data before passing to bgp_notify_rec…

3 years agoospf6d: add CLI to control maximum paths for routes.
Mobashshera Rasool [Thu, 28 Jan 2021 08:50:39 +0000 (08:50 +0000)]
ospf6d: add CLI to control maximum paths for routes.

CLI added:
maximum-paths (1-64)

Issue: #7961

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agoMerge pull request #7969 from donaldsharp/more_flags
Donatas Abraitis [Mon, 1 Feb 2021 07:12:09 +0000 (09:12 +0200)]
Merge pull request #7969 from donaldsharp/more_flags

More flags

3 years agobgpd: Initialize bgp_notify.raw_data before passing to bgp_notify_receive()
Donatas Abraitis [Sun, 31 Jan 2021 14:20:36 +0000 (16:20 +0200)]
bgpd: Initialize bgp_notify.raw_data before passing to bgp_notify_receive()

```
2523558-==2523558==
2523558-==2523558== Conditional jump or move depends on uninitialised value(s)
2523558:==2523558==    at 0x47F242: bgp_notify_admin_message (bgp_debug.c:505)
2523558-==2523558==    by 0x47F242: bgp_notify_print (bgp_debug.c:534)
2523558-==2523558==    by 0x4BA9BC: bgp_notify_receive (bgp_packet.c:1905)
2523558-==2523558==    by 0x4BA9BC: bgp_process_packet (bgp_packet.c:2602)
2523558-==2523558==    by 0x4904B7E: thread_call (thread.c:1681)
2523558-==2523558==    by 0x48CAA27: frr_run (libfrr.c:1126)
2523558-==2523558==    by 0x474B1A: main (bgp_main.c:540)
2523558-==2523558==  Uninitialised value was created by a stack allocation
2523558:==2523558==    at 0x4BA33D: bgp_process_packet (bgp_packet.c:2529)
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoeigrpd: Correctly set the mtu for eigrp packets sent
Donald Sharp [Sun, 31 Jan 2021 13:32:15 +0000 (08:32 -0500)]
eigrpd: Correctly set the mtu for eigrp packets sent

This version of eigrp pre-calculated the eigrp metric
to be a default of 1500 bytes, but unfortunately it
had entered the byte order wrong.

Modify the code to properly set the byte order
according to the eigrp rfc as well as actually
read in and transmit the mtu of the interface
instead of hard coding it to 1500 bytes.

Fixes: #7986
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7984 from donaldsharp/hidden_command
Donatas Abraitis [Sun, 31 Jan 2021 09:05:35 +0000 (11:05 +0200)]
Merge pull request #7984 from donaldsharp/hidden_command

bgpd: Remove hidden `neighbor X route-map Y <in|out>` command

3 years agolib: Prevent unininted usage of data
Donald Sharp [Sat, 30 Jan 2021 21:19:08 +0000 (16:19 -0500)]
lib: Prevent unininted usage of data

Valgrind reports that some data being used in the
stack unwind of a crash is being used uninitailized.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobfdd: Prevent storage of ifp pointer that has been deleted
Donald Sharp [Sat, 30 Jan 2021 20:41:35 +0000 (15:41 -0500)]
bfdd: Prevent storage of ifp pointer that has been deleted

On shutdown, interfaces are deleted but if the bfd session
is down we retain the interface pointer.  Remove the retained
pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7970 from volta-networks/fix_snmp_topotest_test_oid_walk
Donatas Abraitis [Sat, 30 Jan 2021 20:24:11 +0000 (22:24 +0200)]
Merge pull request #7970 from volta-networks/fix_snmp_topotest_test_oid_walk

tests: update snmp topotest api test_oid_walk

3 years agobfdd: Prevent unininited data transmittal
Donald Sharp [Sat, 30 Jan 2021 19:31:47 +0000 (14:31 -0500)]
bfdd: Prevent unininited data transmittal

Valgrind reports:

2052866-==2052866==
2052866-==2052866== Syscall param sendmsg(msg.msg_name) points to uninitialised byte(s)
2052866:==2052866==    at 0x49C8E13: sendmsg (sendmsg.c:28)
2052866-==2052866==    by 0x11DC08: bp_udp_send (bfd_packet.c:823)
2052866-==2052866==    by 0x11DD76: ptm_bfd_echo_snd (bfd_packet.c:179)
2052866-==2052866==    by 0x114C2D: ptm_bfd_echo_xmt_TO (bfd.c:469)
2052866-==2052866==    by 0x114C2D: ptm_bfd_echo_start (bfd.c:498)
2052866-==2052866==    by 0x114C2D: bs_echo_timer_handler (bfd.c:1199)
2052866-==2052866==    by 0x11E478: bfd_recv_cb (bfd_packet.c:702)
2052866-==2052866==    by 0x4904846: thread_call (thread.c:1681)
2052866-==2052866==    by 0x48CB4DF: frr_run (libfrr.c:1126)
2052866-==2052866==    by 0x113044: main (bfdd.c:403)
2052866-==2052866==  Address 0x1ffefff3e8 is on thread 1's stack

In ptm_bfd_echo_snd, for the v4 case we were memsetting the v6 memory
then setting the v4 memory.  Just fix it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: Prevent sending of uninited data to zebra
Donald Sharp [Sat, 30 Jan 2021 19:15:54 +0000 (14:15 -0500)]
isisd: Prevent sending of uninited data to zebra

Valgrind reports:
2172861-==2172861==
2172861-==2172861== Syscall param write(buf) points to uninitialised byte(s)
2172861:==2172861==    at 0x49B4FB3: write (write.c:26)
2172861-==2172861==    by 0x48A4EA0: buffer_write (buffer.c:475)
2172861-==2172861==    by 0x4915AD9: zclient_send_message (zclient.c:298)
2172861-==2172861==    by 0x12AE08: isis_ldp_sync_state_req_msg (isis_ldp_sync.c:152)
2172861-==2172861==    by 0x12B74B: isis_ldp_sync_adj_state_change (isis_ldp_sync.c:305)
2172861-==2172861==    by 0x16DE04: hook_call_isis_adj_state_change_hook.isra.0 (isis_adjacency.c:141)
2172861-==2172861==    by 0x16EE27: isis_adj_state_change (isis_adjacency.c:371)
2172861-==2172861==    by 0x16F1F3: isis_adj_process_threeway (isis_adjacency.c:242)
2172861-==2172861==    by 0x13BCCA: process_p2p_hello (isis_pdu.c:283)
2172861-==2172861==    by 0x13BCCA: process_hello (isis_pdu.c:781)
2172861-==2172861==    by 0x13BCCA: isis_handle_pdu (isis_pdu.c:1700)

Sending of request includes uninited memory at the end of the interface
name string.  Fix

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Prevent sending of uninited data to zebra
Donald Sharp [Sat, 30 Jan 2021 19:13:34 +0000 (14:13 -0500)]
ospfd: Prevent sending of uninited data to zebra

Valgrind reports:
2174600-==2174600==
2174600-==2174600== Syscall param write(buf) points to uninitialised byte(s)
2174600:==2174600==    at 0x49C7FB3: write (write.c:26)
2174600-==2174600==    by 0x48A4EA0: buffer_write (buffer.c:475)
2174600-==2174600==    by 0x4915AD9: zclient_send_message (zclient.c:298)
2174600-==2174600==    by 0x12DB97: ospf_ldp_sync_state_req_msg (ospf_ldp_sync.c:114)
2174600-==2174600==    by 0x12E4F0: ospf_ldp_sync_if_start (ospf_ldp_sync.c:160)
2174600-==2174600==    by 0x12E4F0: ospf_ldp_sync_ism_change (ospf_ldp_sync.c:339)
2174600-==2174600==    by 0x12E4F0: ospf_ldp_sync_ism_change (ospf_ldp_sync.c:332)
2174600-==2174600==    by 0x12C6A2: hook_call_ospf_ism_change (ospf_ism.c:46)
2174600-==2174600==    by 0x12C6A2: ism_change_state (ospf_ism.c:540)
2174600-==2174600==    by 0x12C6A2: ospf_ism_event (ospf_ism.c:600)
2174600-==2174600==    by 0x4904846: thread_call (thread.c:1681)

When we send the request structure we are sending the whole thing and the
interface name string has junk at the end.  Not a big deal, but cleans
up valgrind going wumple on us.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoeigrpd: Prevent uninitialized value from being used
Donald Sharp [Sat, 30 Jan 2021 18:38:32 +0000 (13:38 -0500)]
eigrpd: Prevent uninitialized value from being used

valgrind is finding:

2141982-==2141982== Conditional jump or move depends on uninitialised value(s)
2141982:==2141982==    at 0x11A7A6: eigrp_metrics_is_same (eigrp_metric.c:134)
2141982-==2141982==    by 0x120360: eigrp_topology_update_distance (eigrp_topology.c:374)
2141982-==2141982==    by 0x124F01: eigrp_get_fsm_event (eigrp_fsm.c:284)
2141982-==2141982==    by 0x12519E: eigrp_fsm_event (eigrp_fsm.c:419)
2141982-==2141982==    by 0x1206A1: eigrp_topology_neighbor_down (eigrp_topology.c:518)
2141982-==2141982==    by 0x11AB3A: eigrp_nbr_delete (eigrp_neighbor.c:178)
2141982-==2141982==    by 0x124494: eigrp_finish_final (eigrpd.c:271)
2141982-==2141982==    by 0x1245A8: eigrp_finish (eigrpd.c:247)
2141982-==2141982==    by 0x124630: eigrp_terminate (eigrpd.c:240)
2141982-==2141982==    by 0x11344B: sigint (eigrp_main.c:112)
2141982-==2141982==    by 0x48F5F32: quagga_sigevent_process (sigevent.c:130)

Prevent this from happening.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Remove hidden `neighbor X route-map Y <in|out>` command
Donald Sharp [Sat, 30 Jan 2021 02:27:49 +0000 (21:27 -0500)]
bgpd: Remove hidden `neighbor X route-map Y <in|out>` command

This command was put in place to allow upgrades for the
neighbor command from the BGP_NODE and have it put
into the ipv4 uni node instead.  Since this
utterly kills the yang conversion.  I believe we need
to remove this.  Since people upgrading will just loose
the route-map applicatoin( if they are using such an old
config ) and RFC 8212 will come into play.  They'll figure
it out pretty fast.

Fixes: #7983
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Fix LSA formatting inconsistent retvals
Martin Buck [Fri, 29 Jan 2021 18:26:49 +0000 (19:26 +0100)]
ospf6d: Fix LSA formatting inconsistent retvals

Make return values for lh_get_prefix_str LSA handlers consistent, i.e.
return NULL in case of error without having written to the passed buffer
and non-NULL (address of buffer) if a string was written to the buffer.

Previously, it was possible in certain cases (bogus LSAs) to not initialize
(and 0-terminate) the buffer but still return non-NULL, causing the caller
to print random junk.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
3 years agodoc: Updated topotest.rst doc with iperf
kuldeepkash [Tue, 8 Dec 2020 15:26:42 +0000 (15:26 +0000)]
doc: Updated topotest.rst doc with iperf

1. We are using iperf to send IGMP join and traffic for multicast suites. Iperf must be
   used to run all multicast suite

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
3 years agotests: Add multicast-pim-sm-topo2 test suite
Kuldeep Kashyap [Sat, 31 Oct 2020 11:47:38 +0000 (11:47 +0000)]
tests: Add multicast-pim-sm-topo2 test suite

1. Added 8 test cases to verify multicast PIM SM functionality

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
3 years agotests: Add multicast-pim-sm-topo1 test suite
Kuldeep Kashyap [Thu, 15 Oct 2020 11:07:55 +0000 (11:07 +0000)]
tests: Add multicast-pim-sm-topo1 test suite

1. Added 10 test cases to verify multicast PIM SM functionality

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
3 years agobgpd: Add `bgp_nexthop_dump_bnc_change_flags` function
Donald Sharp [Thu, 28 Jan 2021 01:03:03 +0000 (20:03 -0500)]
bgpd: Add `bgp_nexthop_dump_bnc_change_flags` function

Allow us to read what the change flags are instead of having
to look them up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Add bgp_nexthop_dump_bnc_flags
Donald Sharp [Thu, 28 Jan 2021 00:56:13 +0000 (19:56 -0500)]
bgpd: Add bgp_nexthop_dump_bnc_flags

Add a function that allows us to see a string version of the
bnc->flags bit fields.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7953 from mjstapp/fix_more_ntoa
Rafael Zalamena [Fri, 29 Jan 2021 11:01:03 +0000 (08:01 -0300)]
Merge pull request #7953 from mjstapp/fix_more_ntoa

libs, ospfd: remove inet_ntoa

3 years agotests: update evpn vxlan for svi behaviour change
Pat Ruddy [Fri, 22 Jan 2021 11:52:54 +0000 (11:52 +0000)]
tests: update evpn vxlan for svi behaviour change

This test relied on the default addition of SVI MAC in zebra
now this has been fixed the test needs to be updated to work
with the new behaviour.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #7960 from kishorekunal01/bgp_fix_allowas_in
Donatas Abraitis [Fri, 29 Jan 2021 07:17:26 +0000 (09:17 +0200)]
Merge pull request #7960 from kishorekunal01/bgp_fix_allowas_in

BGP: "no neighbor <peer-group> allowas-in" is not resetting the peer-group member allowas_in[afi][safi].

3 years agoMerge pull request #7974 from donaldsharp/more_if_zero
Donatas Abraitis [Fri, 29 Jan 2021 07:14:49 +0000 (09:14 +0200)]
Merge pull request #7974 from donaldsharp/more_if_zero

More if zero

3 years agotests: update snmp topotest api test_oid_walk
Karen Schoener [Thu, 28 Jan 2021 16:30:34 +0000 (11:30 -0500)]
tests: update snmp topotest api test_oid_walk

Update snmp topotest api test_oid_walk to validate a subset
of rows in a mib walk.

Signed-off-by: Karen Schoener <karen@voltanet.io>
3 years agoMerge pull request #7955 from volta-networks/fix_isis_lsp_bit_topotest
Donald Sharp [Thu, 28 Jan 2021 21:58:27 +0000 (16:58 -0500)]
Merge pull request #7955 from volta-networks/fix_isis_lsp_bit_topotest

tests: temporarily remove isis-lsp-bit-topo1 topotest

3 years agoMerge pull request #7967 from ton31337/feature/show_bgp_summary_wide
Donald Sharp [Thu, 28 Jan 2021 21:00:58 +0000 (16:00 -0500)]
Merge pull request #7967 from ton31337/feature/show_bgp_summary_wide

bgpd: Add `show bgp summary wide` command

3 years agoMerge pull request #7968 from ton31337/feature/doc_ebgp_reset_session
Donald Sharp [Thu, 28 Jan 2021 20:41:39 +0000 (15:41 -0500)]
Merge pull request #7968 from ton31337/feature/doc_ebgp_reset_session

doc: ebgp-requires-policy requires manuall session clearing

3 years agoospfd: ospf_nbr_nbma_lookup_next always returns NULL
Donald Sharp [Thu, 28 Jan 2021 19:56:11 +0000 (14:56 -0500)]
ospfd: ospf_nbr_nbma_lookup_next always returns NULL

The calling function of ospf_nbr_nbma_lookup_next calls
this function and then immediately returns when it
gets the NULL.  Just cleanup a bit more code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopbrd: Remove #if 0 code
Donald Sharp [Thu, 28 Jan 2021 19:04:59 +0000 (14:04 -0500)]
pbrd: Remove #if 0 code

I am not even sure what the goal of this code was in any
way shape fashion or form.  But since it's pbr_nht.c
I as the original author should know... But I don't.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: Remove #if 0 code
Donald Sharp [Thu, 28 Jan 2021 19:04:02 +0000 (14:04 -0500)]
lib: Remove #if 0 code

Just some more dead code that has been sitting unused for
a very long time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoeigrpd: Remove #if 0 dead code
Donald Sharp [Thu, 28 Jan 2021 19:00:45 +0000 (14:00 -0500)]
eigrpd: Remove #if 0 dead code

There is some dead code in eigrpd

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobfdd: Remove #if 0
Donald Sharp [Thu, 28 Jan 2021 18:58:34 +0000 (13:58 -0500)]
bfdd: Remove #if 0

We do have a bunch of old code that is never used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Remove #if 0 code
Donald Sharp [Thu, 28 Jan 2021 18:55:31 +0000 (13:55 -0500)]
zebra: Remove #if 0 code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Remove #if 0 code
Donald Sharp [Thu, 28 Jan 2021 18:53:03 +0000 (13:53 -0500)]
bgpd: Remove #if 0 code

Remove all dead #if 0 code from bgpd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: Remove #if 0 code
Donald Sharp [Thu, 28 Jan 2021 18:45:44 +0000 (13:45 -0500)]
isisd: Remove #if 0 code

Looks like the #if 0 code in this place was for ESI support
on solaris.  We do not support solaris anymore.  So let's
remove with prejudice.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>