]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoisisd: fix "no bfd profile" command
Igor Ryzhov [Thu, 6 May 2021 11:54:37 +0000 (14:54 +0300)]
isisd: fix "no bfd profile" command

Instead of setting the profile to an empty string we should destroy the
NB node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: rework BFD integration
Igor Ryzhov [Thu, 6 May 2021 11:44:05 +0000 (14:44 +0300)]
isisd: rework BFD integration

Rewrite the BFD integration code to use the new library.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8581 from qlyoung/bgp-fix-last-reset-buffer-size
Donatas Abraitis [Thu, 6 May 2021 19:31:09 +0000 (22:31 +0300)]
Merge pull request #8581 from qlyoung/bgp-fix-last-reset-buffer-size

bgpd: rework BGP_MAX_PACKET_SIZE & friends

3 years agobgpd: rework BGP_MAX_PACKET_SIZE & friends
Quentin Young [Tue, 27 Apr 2021 20:20:27 +0000 (16:20 -0400)]
bgpd: rework BGP_MAX_PACKET_SIZE & friends

BGP_MAX_PACKET_SIZE no longer represented the absolute maximum BGP
packet size as it did before, instead it was defined as 4096 bytes,
which is the maximum unless extended message capability is negotiated,
in which case the maximum goes to 65k.

That introduced at least one bug - last_reset_cause was undersized for
extended messages, and when sending an extended message > 4096 bytes
back to a peer as part of NOTIFY data would trigger a bounds check
assert.

This patch redefines the macro to restore its previous meaning,
introduces a new macro - BGP_STANDARD_MESSAGE_MAX_PACKET_SIZE - to
represent the 4096 byte size, and renames the extended size to
BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE for consistency. Code locations
that definitely should use the small size have been updated, locations
that semantically always need whatever the max is, no matter what that
is, use BGP_MAX_PACKET_SIZE.

BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE should only be used as a constant
when storing what the negotiated max size is for use at runtime and to
define BGP_MAX_PACKET_SIZE. Unless there is a future standard that
introduces a third valid size it should not be used for any other
purpose.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8638 from ton31337/fix/bgp_doc
Quentin Young [Thu, 6 May 2021 14:24:50 +0000 (14:24 +0000)]
Merge pull request #8638 from ton31337/fix/bgp_doc

doc: Remove trailing whitespaces and fix WARNING: Error in "code-block"

3 years agoMerge pull request #8636 from idryzhov/ospfv3-vrf-support
Rafael Zalamena [Thu, 6 May 2021 11:50:32 +0000 (08:50 -0300)]
Merge pull request #8636 from idryzhov/ospfv3-vrf-support

OSPFv3 VRF support

3 years agodoc: Remove trailing whitespaces and fix WARNING: Error in "code-block"
Donatas Abraitis [Thu, 6 May 2021 11:09:10 +0000 (14:09 +0300)]
doc: Remove trailing whitespaces and fix WARNING: Error in "code-block"

maximum 1 argument(s) allowed, 56 supplied.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8497 from ton31337/feature/bgp_community_alias
Donald Sharp [Thu, 6 May 2021 10:07:07 +0000 (06:07 -0400)]
Merge pull request #8497 from ton31337/feature/bgp_community_alias

bgpd: Create BGP alias names for community/large-community

3 years agodoc: update ospf6d for vrf support
Igor Ryzhov [Wed, 5 May 2021 20:40:13 +0000 (23:40 +0300)]
doc: update ospf6d for vrf support

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agotests: add topotest for ospf6d vrf support
harios_niral [Wed, 5 May 2021 20:19:31 +0000 (23:19 +0300)]
tests: add topotest for ospf6d vrf support

Co-authored-by: Kaushik Nath <kaushiknath.null@gmail.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
3 years agoospf6d: add vty support for multiple vrfs
harios_niral [Wed, 5 May 2021 20:19:01 +0000 (23:19 +0300)]
ospf6d: add vty support for multiple vrfs

Co-authored-by: Kaushik Nath <kaushiknath.null@gmail.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
3 years agoMerge pull request #8635 from pjdruddy/fix_isis_snmp_clang
Igor Ryzhov [Wed, 5 May 2021 21:56:04 +0000 (00:56 +0300)]
Merge pull request #8635 from pjdruddy/fix_isis_snmp_clang

isisd: fix clang-11 warnings in snmp code

3 years agoospf6d: add internal support for multiple vrfs
harios_niral [Wed, 5 May 2021 20:17:01 +0000 (23:17 +0300)]
ospf6d: add internal support for multiple vrfs

Co-authored-by: Kaushik Nath <kaushiknath.null@gmail.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
3 years agoisisd: fix clang-11 warnings in snmp code
Pat Ruddy [Wed, 5 May 2021 16:35:40 +0000 (17:35 +0100)]
isisd: fix clang-11 warnings in snmp code

fix a number of SA errors thrown up by the newer clang

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #8630 from donaldsharp/max_port
Igor Ryzhov [Wed, 5 May 2021 16:27:18 +0000 (19:27 +0300)]
Merge pull request #8630 from donaldsharp/max_port

bgpd: Another call path with uninited data

3 years agoMerge pull request #8598 from idryzhov/fix-topotest-bgp-auth
Donald Sharp [Wed, 5 May 2021 15:17:37 +0000 (11:17 -0400)]
Merge pull request #8598 from idryzhov/fix-topotest-bgp-auth

tests: fix bgp-auth topotest

3 years agotests: Check if `bgp community alias NAME ALIAS` commands works
Donatas Abraitis [Wed, 21 Apr 2021 19:35:13 +0000 (22:35 +0300)]
tests: Check if `bgp community alias NAME ALIAS` commands works

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agodoc: Add `bgp community alias NAME ALIAS` command
Donatas Abraitis [Wed, 21 Apr 2021 19:34:44 +0000 (22:34 +0300)]
doc: Add `bgp community alias NAME ALIAS` command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Create BGP alias names for community/large-community
Donatas Abraitis [Wed, 21 Apr 2021 19:34:12 +0000 (22:34 +0300)]
bgpd: Create BGP alias names for community/large-community

Show alias name instead of numerical value in `show bgp <prefix>. E.g.:

```
root@exit1-debian-9:~/frr# vtysh -c 'sh run' | grep 'bgp community alias'
bgp community alias 65001:123 community-1
bgp community alias 65001:123:1 lcommunity-1
root@exit1-debian-9:~/frr#
```

```
exit1-debian-9# sh ip bgp 172.16.16.1/32
BGP routing table entry for 172.16.16.1/32, version 21
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  65030
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (172.16.16.1)
      Origin incomplete, metric 0, valid, external, best (Neighbor IP)
      Community: 65001:12 65001:13 community-1 65001:65534
      Large Community: lcommunity-1 65001:123:2
      Last update: Fri Apr 16 12:51:27 2021
exit1-debian-9#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8619 from donaldsharp/sharp_redistribute
Mark Stapp [Wed, 5 May 2021 12:01:40 +0000 (08:01 -0400)]
Merge pull request #8619 from donaldsharp/sharp_redistribute

sharpd: add v4 redistribute watching

3 years agoMerge pull request #8237 from pguibert6WIND/nhrp_use_zebra_2
Mark Stapp [Wed, 5 May 2021 11:57:04 +0000 (07:57 -0400)]
Merge pull request #8237 from pguibert6WIND/nhrp_use_zebra_2

Nhrp use zebra 2

3 years agobgpd: Another call path with uninited data
Donald Sharp [Wed, 5 May 2021 11:48:55 +0000 (07:48 -0400)]
bgpd: Another call path with uninited data

Prevent another call path that uses uninited data in
bgp_pbr.c

This was found through more clang sa runs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8564 from rameshabhinay/bgp_tcp_mss
Donatas Abraitis [Wed, 5 May 2021 10:45:39 +0000 (13:45 +0300)]
Merge pull request #8564 from rameshabhinay/bgp_tcp_mss

bgpd: Support tcp-mss for bgp neighbors

3 years agoMerge pull request #8459 from taspelund/no_rmac_on_mac_only
Patrick Ruddy [Wed, 5 May 2021 08:48:11 +0000 (09:48 +0100)]
Merge pull request #8459 from taspelund/no_rmac_on_mac_only

bgpd: Fix IP-VRF ext-comm check for MACIP routes

3 years agoMerge pull request #8625 from c-po/graceful-restart
Igor Ryzhov [Wed, 5 May 2021 06:44:25 +0000 (09:44 +0300)]
Merge pull request #8625 from c-po/graceful-restart

3 years agoMerge pull request #8040 from donaldsharp/fix_distribute
Igor Ryzhov [Wed, 5 May 2021 00:40:39 +0000 (03:40 +0300)]
Merge pull request #8040 from donaldsharp/fix_distribute

3 years agoMerge pull request #8551 from donaldsharp/peer_damp_doppleganger
Igor Ryzhov [Wed, 5 May 2021 00:39:40 +0000 (03:39 +0300)]
Merge pull request #8551 from donaldsharp/peer_damp_doppleganger

3 years agoMerge pull request #8618 from Prerana-GB/lcom
Igor Ryzhov [Tue, 4 May 2021 21:46:30 +0000 (00:46 +0300)]
Merge pull request #8618 from Prerana-GB/lcom

bgpd: BGP large community-list configuration with regex is failing.

3 years agobgpd: changing graceful-restart parameters should not be considered as error
Christian Poessinger [Tue, 4 May 2021 21:19:29 +0000 (23:19 +0200)]
bgpd: changing graceful-restart parameters should not be considered as error

vtysh will return an informational message to the user that changing any
graceful-shutdown related parameter will require a peer reset. This is should
not be treated as an error message (resulting in a return code of 1) but
rather as a simple information to the user.

This fixes GitHub issue https://github.com/FRRouting/frr/issues/8403

$ vtysh -c configure -c 'router bgp 100' -c 'bgp graceful-restart'
Graceful restart configuration changed, reset all peers to take effect
$ echo $?
0

Signed-off-by: Christian Poessinger <christian@poessinger.com>
3 years agobgpd: Consolidate dampening show run output with the rest of that code
Donald Sharp [Fri, 23 Apr 2021 18:31:41 +0000 (14:31 -0400)]
bgpd: Consolidate dampening show run output with the rest of that code

For whatever reason the dampening show run code was outside the normal
loop of code that handles the afi/safi portion.  consolidate it into
the rest of the normal code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: No need to check if we are a dynamic peer or not
Donald Sharp [Fri, 23 Apr 2021 18:15:54 +0000 (14:15 -0400)]
bgpd: No need to check if we are a dynamic peer or not

bgp_config_write_peer_af already checks to see if we are
a dynamic peer.  No need to do so right before we call it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Do not output peer doppleganger dampened output
Donald Sharp [Fri, 23 Apr 2021 17:45:44 +0000 (13:45 -0400)]
bgpd: Do not output peer doppleganger dampened output

When we are cycling through all peers and looking for
dampening data to dump, do not consider non-configed
peers( dopplegangers ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: Fix the rip and ripng `distribute-list ...` commands
Donald Sharp [Mon, 8 Feb 2021 20:23:33 +0000 (15:23 -0500)]
doc: Fix the rip and ripng `distribute-list ...` commands

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: Remove dead code
Donald Sharp [Mon, 8 Feb 2021 16:48:40 +0000 (11:48 -0500)]
lib: Remove dead code

The distribute_list_init command is not used and is setup
code that will never be used because it makes assumptions about
how distribute-lists work that are fundamentally incorrect.

Remove the code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobabeld: Allow babeld to actually register to use distribute-list
Donald Sharp [Mon, 8 Feb 2021 16:44:41 +0000 (11:44 -0500)]
babeld: Allow babeld to actually register to use distribute-list

The `distribute-list` commands were registered but never setup
properly to work.  Put the commands in place.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoeigrpd: fix `distribute-list...` command for EIGRP
Donald Sharp [Mon, 8 Feb 2021 16:39:30 +0000 (11:39 -0500)]
eigrpd: fix `distribute-list...` command for EIGRP

The distribute-list command was being registered but never
setup properly in EIGRP.  Put it into place.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib, ripd, ripngd, vtysh: Move distribute list to `correct` spot
Donald Sharp [Mon, 8 Feb 2021 16:36:05 +0000 (11:36 -0500)]
lib, ripd, ripngd, vtysh: Move distribute list to `correct` spot

Allow the `distribute-list...` command in ripd and ripngd to
work correctly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: Abstract parsing of distribute lists
Donald Sharp [Mon, 8 Feb 2021 14:54:31 +0000 (09:54 -0500)]
lib: Abstract parsing of distribute lists

Abstract the parsing of distribute lists so that we
don't have as much cut-n-paste code.

This is a setup commit for future work.  In effect
current distribute-list handling is all kinds of messed up

a) eigrp and babel both attempt to use distribute-lists, they just plain
don't work.
b) `distribute-list` is only sent to rip.  `ipv6 distribute-list`
is sent to ripngd.  If you use `distribute-list` under `router ripng`
it sends the command to rip but ripd is in the wrong mode and it
never works.
c) Should ripngd care about v4 and v6 specific distribute-lists?
This dichotomy was added for babel but babel has been broke
about this since day 1( see a ).

All in all we need to unwind this whole mess.  Make distribute-list
commands specific to the daemons( so that we can be in the right
sub-mode ).  But the parsing is going to be the same across all
daemons.  So let's provide that functionality in `lib/distribute.c`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8499 from donaldsharp/ospf_what
Rafael Zalamena [Tue, 4 May 2021 17:41:42 +0000 (14:41 -0300)]
Merge pull request #8499 from donaldsharp/ospf_what

Ospf what

3 years agoMerge pull request #8587 from volta-networks/fix_ospf6_message_logs
Russ White [Tue, 4 May 2021 15:53:17 +0000 (11:53 -0400)]
Merge pull request #8587 from volta-networks/fix_ospf6_message_logs

ospf6d: Make debug logs configurable to only display message headers

3 years agoMerge pull request #8620 from donaldsharp/redistribution_and_infinite
Russ White [Tue, 4 May 2021 15:14:35 +0000 (11:14 -0400)]
Merge pull request #8620 from donaldsharp/redistribution_and_infinite

zebra: Allow redistribution for routes selected

3 years agoMerge pull request #8504 from ranjanyash54/link_lsa_priority
Russ White [Tue, 4 May 2021 14:24:45 +0000 (10:24 -0400)]
Merge pull request #8504 from ranjanyash54/link_lsa_priority

ospf6d: Send Link LSAs when interface priority is changed

3 years agoMerge pull request #8506 from ranjanyash54/route_json_change
Russ White [Tue, 4 May 2021 14:24:03 +0000 (10:24 -0400)]
Merge pull request #8506 from ranjanyash54/route_json_change

ospf6d: Change structure of "show ipv6 ospf6 route json" command

3 years agobgpd: BGP large community-list configuration with regex is failing.
prerana [Mon, 3 May 2021 20:03:04 +0000 (13:03 -0700)]
bgpd: BGP large community-list configuration with regex is failing.

frr(config)# bgp large-community-list expanded com1 permit .*
% Malformed community-list value

The check to validate large-community against UINT_MAX is added for
both standard and expanded community. But however it needs to be
validated only for standard community.

Signed-off-by: Prerana-GB <prerana@vmware.com>
3 years agoospfd: Use %pI4 in some places
Donald Sharp [Sat, 17 Apr 2021 23:46:58 +0000 (19:46 -0400)]
ospfd: Use %pI4 in some places

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Fix some deep indentation issues in ospf_asbr.c
Donald Sharp [Sat, 17 Apr 2021 22:11:59 +0000 (18:11 -0400)]
ospfd: Fix some deep indentation issues in ospf_asbr.c

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Fix indentation in ospf_is_type_redistributed
Donald Sharp [Sat, 17 Apr 2021 22:03:46 +0000 (18:03 -0400)]
ospfd: Fix indentation in ospf_is_type_redistributed

clang-format was not happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Do not use `case default` for switches that have enum
Donald Sharp [Sat, 17 Apr 2021 22:01:53 +0000 (18:01 -0400)]
ospfd: Do not use `case default` for switches that have enum

Found a couple spots where FRR was using `case default` when
using a switch over an enum.  In this case we *must* enumerate
all states as part of the switch.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Cleanup some awful deep indentation in ospf_zebra.c
Donald Sharp [Sat, 17 Apr 2021 21:57:25 +0000 (17:57 -0400)]
ospfd: Cleanup some awful deep indentation in ospf_zebra.c

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8514 from donaldsharp/connected_is_limited
Russ White [Tue, 4 May 2021 11:45:33 +0000 (07:45 -0400)]
Merge pull request #8514 from donaldsharp/connected_is_limited

zebra: Allow one connected route per network mask on a interface

3 years agoMerge pull request #8615 from dslicenc/eigrp-asn-check
Russ White [Tue, 4 May 2021 11:43:48 +0000 (07:43 -0400)]
Merge pull request #8615 from dslicenc/eigrp-asn-check

eigrpd: Test for EIGRP AS number and ensure it's the same

3 years agoMerge pull request #8614 from opensourcerouting/msdp-fixes
Donald Sharp [Tue, 4 May 2021 11:21:51 +0000 (07:21 -0400)]
Merge pull request #8614 from opensourcerouting/msdp-fixes

pimd: MSDP trivial fixes

3 years agoMerge pull request #8621 from donaldsharp/bgp_pbr_clang_sa
Igor Ryzhov [Tue, 4 May 2021 11:06:51 +0000 (14:06 +0300)]
Merge pull request #8621 from donaldsharp/bgp_pbr_clang_sa

bgpd: Prevent test against uninited data

3 years agoMerge pull request #8617 from opensourcerouting/pim-bsm-cleanup
Donald Sharp [Tue, 4 May 2021 11:05:24 +0000 (07:05 -0400)]
Merge pull request #8617 from opensourcerouting/pim-bsm-cleanup

lib, pimd: move bsm code to typesafe lists

3 years agobgpd: Support tcp-mss for bgp neighbors
Abhinay Ramesh [Thu, 8 Apr 2021 10:28:35 +0000 (10:28 +0000)]
bgpd: Support tcp-mss for bgp neighbors

Problem Statement:
=================
In scale setup BGP sessions start flapping.

RCA:
====
In virtualized environment there are multiple places where
MTU need to be set. If there are some places were MTU is not set
properly then there is chances that BGP packets get fragmented,
in scale setup this will lead to BGP session flap.

Fix:
====
A new tcp option is provided as part of this implementation,
which can be configured per neighbor and helps to set the TCP
max segment size. User need to derive the path MTU between the BGP
neighbors and set that value as part of tcp-mss setting.

1. CLI Configuration:
[no] neighbor <A.B.C.D|X:X::X:X|WORD> tcp-mss (1-65535)

2. Running config
    frr# show running-config
    router bgp 100
     neighbor 198.51.100.2 tcp-mss 150       => new entry
     neighbor 2001:DB8::2 tcp-mss 400        => new entry

3. Show command
    frr# show bgp neighbors 198.51.100.2
    BGP neighbor is 198.51.100.2, remote AS 100, local AS 100, internal link
    Hostname: frr
      Configured tcp-mss is 150, synced tcp-mss is 138     => new display

4. Show command json output

    frr# show bgp neighbors 2001:DB8::2 json
    {
      "2001:DB8::2":{
        "remoteAs":100,
        "bgpTimerKeepAliveIntervalMsecs":60000,
        "bgpTcpMssConfigured":400,                               => new entry
        "bgpTcpMssSynced":388,                                  => new entry

Risk:
=====
Low - This is a config driven feature and it sets the max segment
size for the TCP session between BGP peers.

Tests Executed:
===============
Have done manual testing with three router topology.
1. Executed basic config and un config scenarios
2. Verified if the config is updated in running config
   during config and no config operation
3. Verified the show command output in both CLI format and
   JSON format.
4. Verified if TCP SYN messages carry the max segment size
   in their initial packets.
5. Verified the behaviour during clear bgp session.
6. done packet capture to see if the new segment size
   takes effect.

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
3 years agoMerge pull request #8606 from donaldsharp/peer_cleanups
Donatas Abraitis [Tue, 4 May 2021 05:47:26 +0000 (08:47 +0300)]
Merge pull request #8606 from donaldsharp/peer_cleanups

Peer cleanups

3 years agobgpd: Prevent test against uninited data
Donald Sharp [Tue, 4 May 2021 01:03:31 +0000 (21:03 -0400)]
bgpd: Prevent test against uninited data

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8613 from opensourcerouting/build-fix-pb-assert
Donald Sharp [Tue, 4 May 2021 00:46:58 +0000 (20:46 -0400)]
Merge pull request #8613 from opensourcerouting/build-fix-pb-assert

build: fix assert() use in .pb-c.c files

3 years agozebra: Allow redistribution for routes selected
Donald Sharp [Mon, 3 May 2021 23:53:12 +0000 (19:53 -0400)]
zebra: Allow redistribution for routes selected

Current code has an inconsistent behavior with redistribute routes.
Suppose you have a kernel route that is being read w/ a distance
of 255:

eva# show ip route kernel
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.161.1, enp39s0, 00:06:39
K>* 4.4.4.4/32 [255/8192] via 192.168.161.1, enp39s0, 00:01:26
eva#

If you have redistribution already turned on for kernel routes
you will be notified of the 4.4.4.4/32 route.  If you turn
on kernel route redistribution watching after the 4.4.4.4/32 route
has been read by zebra you will never learn of it.

There is no need to look for infinite distance in the redistribution
code.  Either we are selected or not.  In other words non kernel routes
with an 255 distance are never installed so the checks were pointless.

So let's just remove the distance checking and tell interested parties
about the 255 kernel route if it exists.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8577 from volta-networks/fix_ldp_broken_lsps
Renato Westphal [Mon, 3 May 2021 23:46:32 +0000 (20:46 -0300)]
Merge pull request #8577 from volta-networks/fix_ldp_broken_lsps

ldpd: make allowing broken-lsps to be installed configurable

3 years agosharpd: add v4 redistribute watching
Donald Sharp [Mon, 3 May 2021 23:35:36 +0000 (19:35 -0400)]
sharpd: add v4 redistribute watching

Add the ability for sharpd to watch v4 redistribution events

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8603 from Fredi-raspall/pr_tilfa_link_fallback
Igor Ryzhov [Mon, 3 May 2021 19:51:38 +0000 (22:51 +0300)]
Merge pull request #8603 from Fredi-raspall/pr_tilfa_link_fallback

Pr tilfa link fallback

3 years agotests: add scapy to topotests Docker
David Lamparter [Mon, 3 May 2021 18:45:43 +0000 (20:45 +0200)]
tests: add scapy to topotests Docker

Not having scapy in the docker image leads to very obtuse failures in
the pim bsm tests (obtuse, as in, it just fails without any hint as to
why...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: kill unused list_filter_out_nodes()
David Lamparter [Mon, 3 May 2021 14:40:09 +0000 (16:40 +0200)]
lib: kill unused list_filter_out_nodes()

pimd was the only user of this function, and that has gone away now.
So just kill the function.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agopimd: cleanup & convert bsm_rpinfo to TS list
David Lamparter [Mon, 3 May 2021 13:07:44 +0000 (15:07 +0200)]
pimd: cleanup & convert bsm_rpinfo to TS list

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agopimd: cleanup & convert bsm_info to TS list
David Lamparter [Mon, 3 May 2021 12:29:43 +0000 (14:29 +0200)]
pimd: cleanup & convert bsm_info to TS list

Just some cleanup before I touch this code;  switching to typesafe list
macros & putting the data directly inline.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agopimd: remove unused sz_timer
David Lamparter [Mon, 3 May 2021 12:00:53 +0000 (14:00 +0200)]
pimd: remove unused sz_timer

... yes we may need it later, but if and when that happens we can put it
back there.  No point carrying around unused things.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: add *_swap_all to typesafe containers
David Lamparter [Mon, 3 May 2021 14:30:30 +0000 (16:30 +0200)]
lib: add *_swap_all to typesafe containers

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoeigrpd: Test for EIGRP AS number and ensure it's the same
Don Slice [Mon, 3 May 2021 11:57:29 +0000 (07:57 -0400)]
eigrpd: Test for EIGRP AS number and ensure it's the same

When receiving a packet, ensure that the AS number is the same.

Fixes: 8515
Signed-off-by: Don Slice <dslice@nvidia.com>
3 years agobuild: fix assert() use in .pb-c.c files
David Lamparter [Mon, 3 May 2021 16:47:32 +0000 (18:47 +0200)]
build: fix assert() use in .pb-c.c files

The .pb-c.c files pick up our assert() override, but that needs config.h
to be included too, and that needs to go at the very top of the file...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agodoc: improve PIM documentation
Rafael Zalamena [Mon, 3 May 2021 16:38:21 +0000 (13:38 -0300)]
doc: improve PIM documentation

Remove duplicates and explain MSDP better.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agopimd: show MSDP configuration
Rafael Zalamena [Mon, 3 May 2021 15:30:40 +0000 (12:30 -0300)]
pimd: show MSDP configuration

Display the MSDP peer configuration in `show running-config` so it can
be saved on configuration write.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agopimd: reduce code duplication
Rafael Zalamena [Tue, 20 Apr 2021 17:53:49 +0000 (14:53 -0300)]
pimd: reduce code duplication

Standardize a function to get the current VRF node name.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: document link-fallback ti-lfa option
Fredi Raspall [Fri, 23 Apr 2021 17:33:34 +0000 (19:33 +0200)]
doc: document link-fallback ti-lfa option

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
3 years agoisisd: link protection optional fallback in ti-lfa
Fredi Raspall [Fri, 23 Apr 2021 16:33:43 +0000 (18:33 +0200)]
isisd: link protection optional fallback in ti-lfa

The current implementation of TI-LFA computes link-protecting
repair paths (even when node protection is enabled) to have repair
paths to all destinations when no node-protecting repair has been
found. This may be desired or not. E.g. the link-protecting paths
may use the protected node and be, therefore, useless if the node
fails. Also, computing link-protecting repairs incurs extra
calculations.

With this patch, when node protection is enabled, link protecting
repair paths are only computed if "link-fallback" is specified in
the configuration, on a per interface and IS-IS level.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
3 years agoMerge pull request #8545 from opensourcerouting/assert-our-own
Mark Stapp [Mon, 3 May 2021 15:17:36 +0000 (11:17 -0400)]
Merge pull request #8545 from opensourcerouting/assert-our-own

*: make our own assert() actually work

3 years agoMerge pull request #8605 from donaldsharp/libyang_version
Igor Ryzhov [Mon, 3 May 2021 13:55:11 +0000 (16:55 +0300)]
Merge pull request #8605 from donaldsharp/libyang_version

build: Limit libyang version to under 2.0

3 years agoMerge pull request #8571 from donaldsharp/ifp_speed
Mark Stapp [Mon, 3 May 2021 13:39:41 +0000 (09:39 -0400)]
Merge pull request #8571 from donaldsharp/ifp_speed

zebra: Allow interface up events to read speed

3 years agozebra: Allow one connected route per network mask on a interface
Donald Sharp [Mon, 19 Apr 2021 23:23:45 +0000 (19:23 -0400)]
zebra: Allow one connected route per network mask on a interface

Currently FRR reads the kernel for interface state and FRR
creates a connected route per address on an interface.  If
you are in a situation where you have multiple addresses
on an interface just create 1 connected route for them:

sharpd@eva:/tmp/topotests$ vtysh -c "show int dummy302"
Interface dummy302 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  vrf: default
  index 3279 metric 0 mtu 1500 speed 0
  flags: <UP,BROADCAST,RUNNING,NOARP>
  Type: Ethernet
  HWaddr: aa:4a:ed:95:9f:18
  inet 10.4.1.1/24
  inet 10.4.1.2/24 secondary
  inet 10.4.1.3/24 secondary
  inet 10.4.1.4/24 secondary
  inet 10.4.1.5/24 secondary
  inet6 fe80::a84a:edff:fe95:9f18/64
  Interface Type Other
  Interface Slave Type None
  protodown: off

sharpd@eva:/tmp/topotests$ vtysh -c "show ip route connected"
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

C>* 10.4.1.0/24 is directly connected, dummy302, 00:10:03
C>* 192.168.161.0/24 is directly connected, enp39s0, 00:10:03

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoldpd: make allowing broken-lsps to be installed with pop operation configurable
lynne [Tue, 27 Apr 2021 16:21:54 +0000 (12:21 -0400)]
ldpd: make allowing broken-lsps to be installed with pop operation configurable

If LDP is miss configured in a setup and the router has LSPs with no remote
label, this code installs the LSP with a pop instruction of the top-level
label so the packet can be forwarded using IP.   This is a best-effort
attempt to deliver labeled IP packets to their final destination instead of
dropping them.    If this config is turned off the code will only install
LSPs that have a valid remote label.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
3 years agoMerge pull request #8566 from rubensfig/isis_metricstyle
David Lamparter [Mon, 3 May 2021 11:30:35 +0000 (13:30 +0200)]
Merge pull request #8566 from rubensfig/isis_metricstyle

doc: isis: document default value for metric-style

3 years agoMerge pull request #8599 from Jafaral/old-doc
David Lamparter [Mon, 3 May 2021 08:45:38 +0000 (10:45 +0200)]
Merge pull request #8599 from Jafaral/old-doc

doc: remove obsolete Netlink discussion, fix svi cmd doc

3 years agoMerge pull request #8479 from mjstapp/zlog_immediate
David Lamparter [Mon, 3 May 2021 08:40:54 +0000 (10:40 +0200)]
Merge pull request #8479 from mjstapp/zlog_immediate

3 years agoMerge pull request #8607 from donaldsharp/better_reasoning
David Lamparter [Mon, 3 May 2021 08:07:43 +0000 (10:07 +0200)]
Merge pull request #8607 from donaldsharp/better_reasoning

lib: Provide some better error handling for operator

3 years agoospf6d: Send Link LSAs when interface priority is changed
Yash Ranjan [Fri, 9 Apr 2021 07:51:00 +0000 (00:51 -0700)]
ospf6d: Send Link LSAs when interface priority is changed

As per the ospfv3 conformance test 24.3

SETUP: Configure DIface-0 with priority set to <hprty>.
ANVL: Establish full adjacency with DUT for neighbor Rtr-0-A on DIface-0.
DUT: Exchange all the <OSPF-DD> packets, during adjacency establish- ment.
ANVL: Verify that the received <OSPF-DD> packets contain: • one header of Link-LSA, originated by DUT.
ANVL: Send <OSPF-LSR> packet from neighbor Rtr-0-A to DIface-0 con- taining:
• One Request Tuple for Link-LSA originated by DUT.
ANVL: Listen (for upto 2 * <RxmtInterval> seconds) on DIface-0. DUT: Send <OSPF-LSU> packet.
ANVL: Verify that the received <OSPF-LSU> packet contains:
• •
one Link-LSA, originated by DUT, contains: Rtr Pri field set to <hprty>.
----------
When interface priority is changed Link LSAs should be tranmitted
with the priority set.

When the link priorty chanages, the drbdr algorithm is called, which
can change the state of the interface. But if the state does not
changes then LINK LSAs are not transmitted.

This PR fixes this issue. If the state is changed, then LINK LSAs
will anyways be tranmitted. But in case the state is not changed,
even in that case Link LSAs are tranmitted.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agolib: fix random C++ compat problem w/ printfrr
David Lamparter [Tue, 16 Mar 2021 10:03:50 +0000 (11:03 +0100)]
lib: fix random C++ compat problem w/ printfrr

These hoops to get warnings for mis-printing `uint64_t` are apparently
breaking some C++ bits...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agotests: fix assert.h header change fallout
David Lamparter [Fri, 23 Apr 2021 10:16:47 +0000 (12:16 +0200)]
tests: fix assert.h header change fallout

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: rework how we "override" assert()
David Lamparter [Tue, 16 Mar 2021 10:03:44 +0000 (11:03 +0100)]
lib: rework how we "override" assert()

The previous method, using zassert.h and hoping nothing includes
assert.h (which, on glibc at least, just does "#undef assert" and puts
its own definition in...) was fragile - and actually broke undetected.

Just provide our own assert.h and control overriding by putting it in a
separate directory to add to the include path (or not.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: Provide some better error handling for operator
Donald Sharp [Sun, 2 May 2021 11:39:36 +0000 (07:39 -0400)]
lib: Provide some better error handling for operator

When an operator encounters a situation where the number
of FD's open is greater than what we have been configured
to legitimately handle via uname or the `--limit-fds` command
line, abort with a message that they should be able to
debug and figure out what is going on.

Fixes: #8596
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Delay setting peer data until after decision to allow open
Donald Sharp [Fri, 30 Apr 2021 23:24:40 +0000 (19:24 -0400)]
bgpd: Delay setting peer data until after decision to allow open

Delay setting local data about a remote peer until after BGP
has decided to allow an open connection to proceed.

Modifying local peer data structures based upon what is
received from a peer should not be done until after BGP
has decided that the open is allowed to proceed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Cleanup bgp_collision_detect indentation
Donald Sharp [Fri, 30 Apr 2021 23:08:27 +0000 (19:08 -0400)]
bgpd: Cleanup bgp_collision_detect indentation

The bgp_collision_detect function is heavily indented.
Perform some cleanup to make it easier to read.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: listener thread pointer is already NULL
Donald Sharp [Fri, 30 Apr 2021 18:10:31 +0000 (14:10 -0400)]
bgpd: listener thread pointer is already NULL

FRR in thread.c clears the passed in double pointer when
we pull it off the ready queue and pass it back to
the calling function via thread_fetch().

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Allow interface up events to read speed
Donald Sharp [Tue, 27 Apr 2021 11:15:26 +0000 (07:15 -0400)]
zebra: Allow interface up events to read speed

Initially the reading of the speed of an interface happened
upon interface creation and happened until the speed of a link
settled down to a single value.  The speed of an interface
can also change as that a new optic can be inserted that
changes the speed, in which case FRR would see a interface
down (optic removal) and then a interface up (optic insertion).

In this case FRR would not treat this as an event that changed
the speed.  Let's expand the checking a bit more.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8601 from Fredi-raspall/pr_fix_lfa_debug
Renato Westphal [Sun, 2 May 2021 00:28:07 +0000 (21:28 -0300)]
Merge pull request #8601 from Fredi-raspall/pr_fix_lfa_debug

isisd: fix show LFA debug in show debugging cmd

3 years agoMerge pull request #8602 from Fredi-raspall/pr_fix_lfa_mem_leak
Renato Westphal [Sun, 2 May 2021 00:27:40 +0000 (21:27 -0300)]
Merge pull request #8602 from Fredi-raspall/pr_fix_lfa_mem_leak

isisd: fix memory leak for non-freed spftrees

3 years agobuild: Limit libyang version to under 2.0
Donald Sharp [Sat, 1 May 2021 22:38:26 +0000 (18:38 -0400)]
build: Limit libyang version to under 2.0

Ensure that master is not built with libyang version 2 or greater
since we'll fail.

Fixes: #8524
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: fix show LFA debug in show debugging cmd
Fredi Raspall [Wed, 28 Apr 2021 09:16:51 +0000 (11:16 +0200)]
isisd: fix show LFA debug in show debugging cmd

When enabling 'debug isis lfa', the option was correctly enabled
but not displayed by 'show debugging' command.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
3 years agoisisd: fix memory leak for non-freed spftrees
Fredi Raspall [Fri, 23 Apr 2021 22:01:41 +0000 (00:01 +0200)]
isisd: fix memory leak for non-freed spftrees

When enabling TI-LFA the forward SPF for neighbors adjacent to the
PLR is computed. Later, when computing the PQ spaces, the reverse
SPF trees for those adjacent neighbors affected by the protected
interface are computed.

When node protection is enabled, TI-LFA link protection is run
immediately afterwards to compute repairs in case no
node-protecting backup path exists. In this second run, the
existing code tries to compute the reverse SPF tree for the same
node, without freeing the SPF tree of the prior run.

This patch fixes this by not computing the reverse SPF again, thus
avoiding a memory leak and an unnecessary SPF run.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
3 years agodoc: remove obsolete Netlink discussion, fix svi cmd doc
Jafar Al-Gharaibeh [Fri, 30 Apr 2021 23:08:34 +0000 (18:08 -0500)]
doc: remove obsolete Netlink discussion, fix svi cmd doc

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agotests: fix bgp-auth topotest
Igor Ryzhov [Fri, 30 Apr 2021 22:31:26 +0000 (01:31 +0300)]
tests: fix bgp-auth topotest

Individual tests must not depend on each other. In particular, a test
can't be sure that the previous test config is applied or cleared.
It is definitely not true when a single test is executed, for example:
`test_bgp_auth.py::test_prefix_peer_remove_passwords`.

This commit makes all tests independent of each other. It also adds a
call to check_all_peers_established at the start of "remove_passwords"
tests to make sure that we not only block new peers with an incorrect
password, but also clean the existing peers.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>