]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agodoc: Add `show [ip] bgp version <version>` command
Donatas Abraitis [Fri, 9 Apr 2021 07:30:38 +0000 (10:30 +0300)]
doc: Add `show [ip] bgp version <version>` command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Filter BGP routes by prefix version
Donatas Abraitis [Fri, 9 Apr 2021 06:33:41 +0000 (09:33 +0300)]
bgpd: Filter BGP routes by prefix version

The idea is to find out prefixes including specific BGP table version and
above.

Let's say I have a converged network and suddently I noticed a couple of
prefixes seems hijacked.

I want to look what new prefixes arrived with a specific BGP table version.

```
exit1-debian-9# show ip bgp version 8
BGP table version is 9, local router ID is 192.168.100.1, vrf id 0
Default local pref 100, local AS 65534
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  192.168.2.0/24   192.168.0.2              0             0 65030 ?
*>                  192.168.0.2              0             0 65030 ?
*  192.168.3.0/24   192.168.0.2              0             0 65030 ?
*>                  192.168.0.2              0             0 65030 ?

Displayed  2 routes and 18 total paths
exit1-debian-9#
```

```
exit1-debian-9# show ip bgp version 8 json
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 9,
 "routerId": "192.168.100.1",
 "defaultLocPrf": 100,
 "localAS": 65534,
 "routes": { "192.168.2.0/24": [
  {
    "valid":true,
    "pathFrom":"external",
    "prefix":"192.168.2.0",
    "prefixLen":24,
    "network":"192.168.2.0\/24",
    "version":8,
    "metric":0,
    "weight":0,
    "peerId":"2a02:bbd::2",
    "path":"65030",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.0.2",
        "hostname":"home-spine1.donatas.net",
        "afi":"ipv4",
        "used":true
      }
    ]
  },
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"Neighbor IP",
    "pathFrom":"external",
    "prefix":"192.168.2.0",
    "prefixLen":24,
    "network":"192.168.2.0\/24",
    "version":8,
    "metric":0,
    "weight":0,
    "peerId":"192.168.0.2",
    "path":"65030",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.0.2",
        "hostname":"home-spine1.donatas.net",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
],"192.168.3.0/24": [
  {
    "valid":true,
    "pathFrom":"external",
    "prefix":"192.168.3.0",
    "prefixLen":24,
    "network":"192.168.3.0\/24",
    "version":9,
    "metric":0,
    "weight":0,
    "peerId":"2a02:bbd::2",
    "path":"65030",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.0.2",
        "hostname":"home-spine1.donatas.net",
        "afi":"ipv4",
        "used":true
      }
    ]
  },
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"Neighbor IP",
    "pathFrom":"external",
    "prefix":"192.168.3.0",
    "prefixLen":24,
    "network":"192.168.3.0\/24",
    "version":9,
    "metric":0,
    "weight":0,
    "peerId":"192.168.0.2",
    "path":"65030",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.0.2",
        "hostname":"home-spine1.donatas.net",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
] }  }

```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotests: Add BGP RPKI show header to outputs
Donatas Abraitis [Mon, 12 Apr 2021 07:34:52 +0000 (10:34 +0300)]
tests: Add BGP RPKI show header to outputs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agodoc: Add BGP RPKI show header to some output examples
Donatas Abraitis [Mon, 12 Apr 2021 07:34:36 +0000 (10:34 +0300)]
doc: Add BGP RPKI show header to some output examples

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Show BGP table version which was used for a particular prefix
Donatas Abraitis [Thu, 8 Apr 2021 19:55:00 +0000 (22:55 +0300)]
bgpd: Show BGP table version which was used for a particular prefix

This is useful to go back in the past and check when was that prefix appeared,
changed, etc.

```
exit1-debian-9# show ip bgp 172.16.16.1/32
BGP routing table entry for 172.16.16.1/32, version 6
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  home-spine1.donatas.net(192.168.0.2) home-spine1.donatas.net(2a02:bbd::2)
  65030
    192.168.0.2 from home-spine1.donatas.net(2a02:bbd::2) (172.16.16.1)
      Origin incomplete, metric 0, valid, external
      Last update: Thu Apr  8 20:15:25 2021
  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)
      Last update: Thu Apr  8 20:15:25 2021
exit1-debian-9#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Show RPKI short state in `show bgp <afi> <safi>`
Donatas Abraitis [Sun, 11 Apr 2021 18:27:10 +0000 (21:27 +0300)]
bgpd: Show RPKI short state in `show bgp <afi> <safi>`

Just to be more informant, copying from Cisco.

```
exit1-debian-9# sh ip bgp
BGP table version is 4, local router ID is 192.168.100.1, vrf id 0
Default local pref 100, local AS 65534
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network          Next Hop            Metric LocPrf Weight Path
N*> 10.0.2.0/24      0.0.0.0                  0         32768 ?
N*> 192.168.0.0/24   0.0.0.0                  0         32768 ?
N*> 192.168.10.0/24  0.0.0.0                  0         32768 ?
N*> 192.168.100.1/32 0.0.0.0                  0         32768 ?

Displayed  4 routes and 4 total paths
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8440 from qlyoung/doc-describe-acceptable-commit-messages
Jafar Al-Gharaibeh [Sun, 11 Apr 2021 04:07:49 +0000 (23:07 -0500)]
Merge pull request #8440 from qlyoung/doc-describe-acceptable-commit-messages

doc: describe acceptable commit messages

3 years agoMerge pull request #8438 from donaldsharp/doc_on_sleep
Donatas Abraitis [Sat, 10 Apr 2021 16:35:52 +0000 (19:35 +0300)]
Merge pull request #8438 from donaldsharp/doc_on_sleep

doc: Check for convergence, not sleep for convergence

3 years agoMerge pull request #8444 from qlyoung/doc-system-requirements
Donatas Abraitis [Sat, 10 Apr 2021 07:04:42 +0000 (10:04 +0300)]
Merge pull request #8444 from qlyoung/doc-system-requirements

doc: vaguely describe system requirements

3 years agoMerge pull request #8445 from qlyoung/doc-bgp-timers
Donatas Abraitis [Sat, 10 Apr 2021 06:57:39 +0000 (09:57 +0300)]
Merge pull request #8445 from qlyoung/doc-bgp-timers

doc: document BGP neighbor timers

3 years agodoc: document BGP neighbor timers
Quentin Young [Fri, 9 Apr 2021 22:17:15 +0000 (18:17 -0400)]
doc: document BGP neighbor timers

The keepalive, hold, and connect timers were undocumented.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agodoc: vaguely describe system requirements
Quentin Young [Fri, 9 Apr 2021 22:05:42 +0000 (18:05 -0400)]
doc: vaguely describe system requirements

Lame attempt at describing the factors involved in choosing resources
for running FRR

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agopceplib: add missing endian.h and config.h
David Lamparter [Fri, 9 Apr 2021 18:38:56 +0000 (20:38 +0200)]
pceplib: add missing endian.h and config.h

endian.h supplies be*toh() and htobe*() functions.  This fixes the build
on musl libc.  On other systems it seems endian.h comes in transitively
from some other header.

(Also, all .c files should have config.h or zebra.h as the first
include, even if it works without that it's b0rked and only works due to
luck.)

Tested-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoMerge pull request #8429 from donaldsharp/markit
Mark Stapp [Fri, 9 Apr 2021 18:24:22 +0000 (14:24 -0400)]
Merge pull request #8429 from donaldsharp/markit

Markit

3 years agolib, doc: add "route-map NAME optimization" command
Igor Ryzhov [Fri, 9 Apr 2021 16:42:23 +0000 (19:42 +0300)]
lib, doc: add "route-map NAME optimization" command

Currently we have a "route-map optimization" command which is entered
from inside the route-map entry but actually applies to the whole
route-map. In addition, this command is not shown in the running-config
and not stored to the startup-config during "write".

Let's add a new command on the config node level to control this setting
and show it in the running-config to make possible to save it during
"write".

The old command is saved for the backward compatibility but hidden and
marked as deprecated.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8435 from opensourcerouting/ospf-bfd-fix
Igor Ryzhov [Fri, 9 Apr 2021 17:56:06 +0000 (20:56 +0300)]
Merge pull request #8435 from opensourcerouting/ospf-bfd-fix

ospfd: fix crash on interface/vrf removal

3 years agobuild: don't link pathd/path_main.c twice
David Lamparter [Fri, 9 Apr 2021 17:56:05 +0000 (19:56 +0200)]
build: don't link pathd/path_main.c twice

Can't have things duplicate in libpath.a and pathd directly, they'll
crash into eath other on linking.  No idea why this doesn't error out in
our CI builds, but it definitely breaks LTO builds.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agotools: add note to users re: frr.conf overwrite
Quentin Young [Fri, 9 Apr 2021 17:13:45 +0000 (13:13 -0400)]
tools: add note to users re: frr.conf overwrite

Most software doesn't overwrite its own config files; vtysh's 'wr mem'
may be confusing, so add a note to the config file explaining changes
made may be overwritten.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agodebian: install frr.conf to /etc/frr/
Quentin Young [Wed, 7 Apr 2021 20:54:36 +0000 (16:54 -0400)]
debian: install frr.conf to /etc/frr/

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years ago*: remove *.conf.sample files
Quentin Young [Tue, 16 Feb 2021 23:05:38 +0000 (18:05 -0500)]
*: remove *.conf.sample files

Most of these are many, many years out of date. All of them vary
randomly in quality. They show up by default in packages where they
aren't really useful now that we use integrated config. Remove them.

The useful ones have been moved to the docs.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agorpm: install frr.conf by default
Quentin Young [Wed, 7 Apr 2021 19:58:00 +0000 (15:58 -0400)]
rpm: install frr.conf by default

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8427 from mjstapp/fix_pcep_keylen
Quentin Young [Fri, 9 Apr 2021 16:59:05 +0000 (16:59 +0000)]
Merge pull request #8427 from mjstapp/fix_pcep_keylen

lib: use platform-neutral value for TCP MD5 signature len

3 years agodoc: describe acceptable commit messages
Quentin Young [Fri, 9 Apr 2021 16:55:33 +0000 (12:55 -0400)]
doc: describe acceptable commit messages

Update workflow.rst to state that commit messages consisting solely of
program output, or that otherwise fail to adequately summarize the
changes being made, are unacceptable.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agotopotests: add standard nhrp test between spoke and hub
Philippe Guibert [Wed, 10 Mar 2021 15:08:55 +0000 (16:08 +0100)]
topotests: add standard nhrp test between spoke and hub

This test establishes a binding between nbma ip of a spoke and its
protocol address. This information is pushed to hub.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agozebra: move neighbor table configuration to dplane contexts
Philippe Guibert [Fri, 26 Feb 2021 09:04:25 +0000 (10:04 +0100)]
zebra: move neighbor table configuration to dplane contexts

Instead of directly configuring the neighbor table after read from zapi
interface, a zebra dplane context is prepared to host the interface and
the family where the neighbor table is updated. Also, some other fields
are hosted: app_probes, ucast_probes, and mcast_probes. More information
on those fields can be found on ip-ntable configuration.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agozebra, lib: handle NEIGH_ADD/DELETE to zebra dataplane framework
Philippe Guibert [Thu, 25 Feb 2021 10:12:34 +0000 (11:12 +0100)]
zebra, lib: handle NEIGH_ADD/DELETE to zebra dataplane framework

EVPN neighbor operations were already done in the zebra dataplane
framework. Now that NHRP is able to use zebra to perform neighbor IP
operations (by programming link IP operations), handle this operation
under dataplane framework:
- assign two new operations NEIGH_IP_INSTALL and NEIGH_IP_DELETE; this
is reserved for GRE like interfaces:
example: ip neigh add A.B.C.D lladdr E.F.G.H
- use 'struct ipaddr' to store and encode the link ip address
- reuse dplane_neigh_info, and create an union with mac address
- reuse the protocol type and use it for neighbor operations; this
permits to store the daemon originating this neighbor operation.
a new route type is created: ZEBRA_ROUTE_NEIGH.
- the netlink level functions will handle a pointer, and a type; the
type indicates the family of the pointer: AF_INET or AF_INET6 if the
link type is an ip address, mac address otherwise.
- to keep backward compatibility with old queries, as no extension was
done, an option NEIGH_NO_EXTENSION has been put in place
- also, 2 new state flags are used: NUD_PERMANENT and NUD_FAILED.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agozebra: handler for configuring neighbor table
Philippe Guibert [Mon, 16 Dec 2019 12:34:00 +0000 (13:34 +0100)]
zebra: handler for configuring neighbor table

neighbor table api in zebra is added. a netlink api is created for that.
the handler is called from the api defined in the previous commit.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agozebra: fixes NDA_DST in netlink_neigh_update() function
Philippe Guibert [Thu, 25 Feb 2021 14:06:23 +0000 (15:06 +0100)]
zebra: fixes NDA_DST in netlink_neigh_update() function

When netlink_neigh_update() is called, the link registration was
failing, due to bad request length.
Also, the query was failing if NDA_DST was an ipv6 address.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agolib: add api to configure neighbor table per interface
Philippe Guibert [Mon, 16 Dec 2019 12:32:28 +0000 (13:32 +0100)]
lib: add api to configure neighbor table per interface

this api is needed for nhrp. the goal is to implement it in zebra, while
other daemon will used it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agonhrp, lib, zebra: add/del neighbor entry possible from nhrp
Philippe Guibert [Fri, 13 Dec 2019 17:09:11 +0000 (18:09 +0100)]
nhrp, lib, zebra: add/del neighbor entry possible from nhrp

a zebra api is extended to offer ability to add or remove neighbor
entry from daemon. Also this extension makes possible to add neigh
entry, not only between IPs and macs, but also between IPs and NBMA IPs.
This API supports configuring ipv6/ipv4 entries with ipv4/ipv6 lladdr.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agonhrpd: link layer registration to notifications
Philippe Guibert [Thu, 12 Dec 2019 15:08:26 +0000 (16:08 +0100)]
nhrpd: link layer registration to notifications

neighbor notifications are done in zebra. so, instead of relying on
nhrp, rely on zebra by using zebra api interface.
Consequently, the code originally used in nhrp for netlink neighor
notification is no more used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agozebra: link layer config and notification, implementation in zebra
Philippe Guibert [Thu, 12 Dec 2019 15:06:59 +0000 (16:06 +0100)]
zebra: link layer config and notification, implementation in zebra

zebra implements zebra api for configuring link layer information. that
can be an arp entry (for ipv4) or ipv6 neighbor discovery entry. This
can also be an ipv4/ipv6 entry associated to an underlay ipv4 address,
as it is used in gre point to multipoint interfaces.
this api will also be used as monitoring. an hash list is instantiated
into zebra (this is the vrf bitmap). each client interested in those entries
in a specific vrf, will listen for following messages: entries added, removed,
or who-has messages.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agolib: link layer neighbor registration and notification, define API msgs
Philippe Guibert [Thu, 12 Dec 2019 15:05:14 +0000 (16:05 +0100)]
lib: link layer neighbor registration and notification, define API msgs

This patch implements new zapi api to get neighbor information that zebra knows
and that other daemons may need to know. Actually, nhrp daemons is
interested in getting the neighbor information on gre interfaces, and
the API will be used for that.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agonhrpd: use CALLOC instead of MALLOC
Philippe Guibert [Tue, 16 Jul 2019 13:04:33 +0000 (15:04 +0200)]
nhrpd: use CALLOC instead of MALLOC

in order to apply a memset to a non initialised structure, use CALLOC
instead of MALLOC

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agonhrpd: lookup appropriate ipsec path
Philippe Guibert [Tue, 16 Jul 2019 13:21:29 +0000 (15:21 +0200)]
nhrpd: lookup appropriate ipsec path

lookup appropriate ipsec path. there are systems where the path where
the charon.vici file is not in standard paths. For that, 'ipsec
--piddir' may help in solving the path.

result of ipsec --piddir is as follow for example:
'
/etc/ike/ipsec.d/run
'

Note that the assumption is done that even if there are several
instances of strongswan across the vrfs, the charon.vici path file is
the same across vrfs. Consequently, as there is a thread per vrf that
performs vici initialisation, and file path retrieval is part of the
vici initialisation procedure, in order to avoid intempestive system
calls, use a boolean 'vici_charon_filepath_done' to avoid doing
unnecessary calls.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agodoc: Check for convergence, not sleep for convergence
Donald Sharp [Fri, 9 Apr 2021 16:06:55 +0000 (12:06 -0400)]
doc: Check for convergence, not sleep for convergence

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: Do not sleep(5) when verifying bgp communities
Donald Sharp [Fri, 9 Apr 2021 16:02:18 +0000 (12:02 -0400)]
tests: Do not sleep(5) when verifying bgp communities

There are better ways of ensuring that the remote side
has your change instead of sleeping

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8432 from ton31337/fix/use_bool_for_use32bit_asn
Quentin Young [Fri, 9 Apr 2021 15:59:38 +0000 (15:59 +0000)]
Merge pull request #8432 from ton31337/fix/use_bool_for_use32bit_asn

bgpd: Use bool type to check if use32bit ASN

3 years agoMerge pull request #8428 from idryzhov/show-memory-daemon
Donald Sharp [Fri, 9 Apr 2021 15:18:25 +0000 (11:18 -0400)]
Merge pull request #8428 from idryzhov/show-memory-daemon

vtysh: add "show memory" for a single daemon

3 years agoMerge pull request #8433 from ton31337/fix/mpls_prd_dead_code
Donald Sharp [Fri, 9 Apr 2021 15:17:49 +0000 (11:17 -0400)]
Merge pull request #8433 from ton31337/fix/mpls_prd_dead_code

bgpd: Remove dead code regarding prefix_rd allocation

3 years agoospfd: fix crash on interface/vrf removal
Rafael Zalamena [Fri, 9 Apr 2021 13:54:23 +0000 (10:54 -0300)]
ospfd: fix crash on interface/vrf removal

The interface parameters deletion must be called before
`route_table_finish` due to the usage of the route data structures to
search neighbors in the same interface. If the route info is removed
before that we get the following crash:

```
 6  0x00007f5c6ed50394 in core_handler at lib/sigevent.c:255
 7  <signal handler called>
 8  ospf_interface_bfd_apply (ifp=<optimized out>) at ospfd/ospf_bfd.c:130
 9  0x000055d4c306d076 in ospf_interface_disable_bfd at ospfd/ospf_bfd.c:159
 10 0x000055d4c3071781 in ospf_del_if_params at ospfd/ospf_interface.c:553
 11 0x000055d4c3071900 in ospf_if_delete_hook at ospfd/ospf_interface.c:704
 12 0x00007f5c6ed17935 in hook_call_if_del at lib/if.c:59
 13 if_delete_retain at lib/if.c:290
 14 0x00007f5c6ed19bc5 in if_delete at lib/if.c:313
 15 0x00007f5c6ed19d88 in if_terminate at lib/if.c:1067
 16 0x00007f5c6ed63a04 in vrf_delete at lib/vrf.c:297
 17 0x00007f5c6ed76784 in zclient_vrf_delete at lib/zclient.c:1974
 18 zclient_read at lib/zclient.c:3686
 19 0x00007f5c6ed60f85 in thread_call at lib/thread.c:1815
 20 0x00007f5c6ed20228 in frr_run at lib/libfrr.c:1149
 21 0x000055d4c306bc70 in main at ospfd/ospf_main.c:233
```

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotests: More black fixups
Donald Sharp [Thu, 8 Apr 2021 17:04:26 +0000 (13:04 -0400)]
tests: More black fixups

Just another round of fixups found by running black on the code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: Add some more pytest marks for bgpd
Donald Sharp [Thu, 8 Apr 2021 17:03:36 +0000 (13:03 -0400)]
tests: Add some more pytest marks for bgpd

Just another round of trying to add pytest.mark.bgpd.  Not finished yet just
what I could stand doing for a few minutes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8422 from idryzhov/fix-show-ip-ospf
Donald Sharp [Fri, 9 Apr 2021 12:14:17 +0000 (08:14 -0400)]
Merge pull request #8422 from idryzhov/fix-show-ip-ospf

ospfd: fix crash on "show ip ospf neighbor detail"

3 years agolib: use platform-neutral value for TCP MD5 signature len
Mark Stapp [Thu, 8 Apr 2021 12:56:32 +0000 (08:56 -0400)]
lib: use platform-neutral value for TCP MD5 signature len

Use a pcep-specific value for MD5SIG_MAXLEN, use the OS value if
present.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agobgpd: Remove dead code regarding prefix_rd allocation
Donatas Abraitis [Fri, 9 Apr 2021 07:52:36 +0000 (10:52 +0300)]
bgpd: Remove dead code regarding prefix_rd allocation

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Use bool type to check if use32bit ASN
Donatas Abraitis [Fri, 9 Apr 2021 07:43:11 +0000 (10:43 +0300)]
bgpd: Use bool type to check if use32bit ASN

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8430 from ton31337/fix/revert_0b6d35324ef3fd2b4d5997103795cad73eb...
Patrick Ruddy [Fri, 9 Apr 2021 11:25:21 +0000 (12:25 +0100)]
Merge pull request #8430 from ton31337/fix/revert_0b6d35324ef3fd2b4d5997103795cad73eb72954

Revert "bgpd: BGP session not established for ipv6 link local address…

3 years agodoc: add "show memory [DAEMON]"
Igor Ryzhov [Fri, 9 Apr 2021 08:30:49 +0000 (11:30 +0300)]
doc: add "show memory [DAEMON]"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospfd: fix crash on "show ip ospf neighbor detail"
Igor Ryzhov [Wed, 7 Apr 2021 23:14:34 +0000 (02:14 +0300)]
ospfd: fix crash on "show ip ospf neighbor detail"

Fixes #8419.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8424 from taspelund/allow_no_advertise_evpn
Donatas Abraitis [Fri, 9 Apr 2021 07:55:11 +0000 (10:55 +0300)]
Merge pull request #8424 from taspelund/allow_no_advertise_evpn

bgpd: always allow no advertise-svi-ip/default-gw

3 years agoRevert "bgpd: BGP session not established for ipv6 link local address with vrf config"
Donatas Abraitis [Fri, 9 Apr 2021 07:14:32 +0000 (10:14 +0300)]
Revert "bgpd: BGP session not established for ipv6 link local address with vrf config"

This reverts commit 0b6d35324ef3fd2b4d5997103795cad73eb72954.

3 years agovtysh: add "show memory" for a single daemon
Igor Ryzhov [Thu, 8 Apr 2021 15:47:43 +0000 (18:47 +0300)]
vtysh: add "show memory" for a single daemon

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8402 from opensourcerouting/debian10-topotest-fix
Patrick Ruddy [Thu, 8 Apr 2021 13:54:54 +0000 (14:54 +0100)]
Merge pull request #8402 from opensourcerouting/debian10-topotest-fix

tests: fix for l3mdev topotests on kernel 4.19

3 years agobgpd: always allow no advertise-svi-ip/default-gw
Trey Aspelund [Thu, 8 Apr 2021 07:25:22 +0000 (07:25 +0000)]
bgpd: always allow no advertise-svi-ip/default-gw

Current behavior has an EVPN_ENABLED check for both standard and 'no'
forms of 'advertise-svi-ip' and 'advertise-default-gw'. This prevents a
user from removing either command from running config if
'advertise-all-vni' is not present.
This commit removes/adjusts the EVPN_ENABLED checks to always allow the
'no' command so config doesn't get stuck.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
3 years agoMerge pull request #7434 from sudhanshukumar22/bgp-link-local-address
Donatas Abraitis [Thu, 8 Apr 2021 06:26:55 +0000 (09:26 +0300)]
Merge pull request #7434 from sudhanshukumar22/bgp-link-local-address

bgpd: BGP session not established for ipv6 link local address with vrf config

3 years agopython: fix 32-bit pointers in xrelfo container_of
David Lamparter [Wed, 7 Apr 2021 22:00:27 +0000 (00:00 +0200)]
python: fix 32-bit pointers in xrelfo container_of

This was mistakenly using the host platform's pointer size rather than
the ELF file's.  Only noticeable when cross compiling...

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add DT_REL to elf_py/clippy ELF code
David Lamparter [Wed, 7 Apr 2021 21:55:21 +0000 (23:55 +0200)]
lib: add DT_REL to elf_py/clippy ELF code

ARM (32-bit) needs DT_REL... and here I was hoping I could avoid the
trouble.

Fixes: #8355
Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agonhrpd: Change sockunion2str to %pSU in a few places
Reuben Dowle [Wed, 7 Apr 2021 20:30:57 +0000 (08:30 +1200)]
nhrpd: Change sockunion2str to %pSU in a few places

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agoMerge pull request #8365 from aldobrrrr/fix_parse_topology_function_in_isis_topo1_vrf...
Mark Stapp [Wed, 7 Apr 2021 19:01:12 +0000 (15:01 -0400)]
Merge pull request #8365 from aldobrrrr/fix_parse_topology_function_in_isis_topo1_vrf_test

topotests: fix 'parse_topology' function in test_isis_topo1_vrf.py

3 years agodoc: update docs for `find REGEX...` command
Quentin Young [Thu, 18 Mar 2021 19:42:36 +0000 (15:42 -0400)]
doc: update docs for `find REGEX...` command

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agolib, vtysh: re-add support for spaces in 'find'
Quentin Young [Thu, 18 Mar 2021 19:31:35 +0000 (15:31 -0400)]
lib, vtysh: re-add support for spaces in 'find'

Lost ability to handle them in the regex patch

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8415 from mjstapp/fix_ospf_keyid_config
Igor Ryzhov [Wed, 7 Apr 2021 12:16:47 +0000 (15:16 +0300)]
Merge pull request #8415 from mjstapp/fix_ospf_keyid_config

ospfd: permit over-write of message-digest-key

3 years agobgpd: vrf route leaking, fix vpn router id update
Abhinay Ramesh [Thu, 1 Apr 2021 05:39:57 +0000 (05:39 +0000)]
bgpd: vrf route leaking, fix vpn router id update

Description:
Route leaking from default vrf to non-default vrf stops after frr restart.

If the interface comes up after route leaking is configured,
in the case of vpn router id update, we delete the ecommunity value
and never reconfigure the rtlist.
This results in skipping route leak to non-default vrfs (vpn to vrf).

Router-id change that is not explicitly configured
(a change from zebra, frr restart) should not replace a configured vpn RD/RT.
Added few helpful debugs as well.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
3 years agoVRF-Lite: Fix export of withdraw-in-progress routes
Abhinay Ramesh [Thu, 1 Apr 2021 05:22:23 +0000 (05:22 +0000)]
VRF-Lite: Fix export of withdraw-in-progress routes

Problem:
Stale routes are seen in the bgp table(ipv4 and ipv6)
RCA:
Scenario1:
Interface down and withdraw is in-progress.
Router bgp config leading to re-leaking.
Now, withdraw-in-progress routes,
       are again leaked to bgp vrf instance(s) importing routes.
Whenever we see an interface down
and corresponding address delete,
while withdrawal of exported routes is in-progress,
routes are marked as being removed and put into work queue.
‘router bgp’ config is updated, which triggers
bgp_vpn_leak_export; which exports routes from configured bgp vrf to VPN.
So withdraw-in-progress routes,
are again leaked to bgp vrf instance(s) importing routes; leading to stale routes.
Scenario2:
- 'no import vrf non-default-vrf’ [in the default vrf]
- bgp update from the peer withdrawing prefix [non-default vrf]
- 'import vrf non-default-vrf’ [configured in the default vrf]
While withdrawal of exported routes is in-progress,
routes are marked as being removed and put into work queue,
In the meantime, if import vrf is configured,
which exports routes from configured bgp vrf to VPN.
So withdraw-in-progress new routes,
are again leaked to bgp vrf instance(s) importing routes; leading to stale routes.
Fix:
Whenever leaking routes (leak_update),
for already existing routes,
skip the routes with bgp_path_info
marked as being removed.
Also added the log message for the return.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
3 years agobgpd: vrf route leaking, fix vrf redistribute
Abhinay Ramesh [Thu, 1 Apr 2021 05:17:54 +0000 (05:17 +0000)]
bgpd: vrf route leaking, fix vrf redistribute

Description:
After FRR restart, routes are not getting redistributed;
when routes added first and then 'redistribute static' cmd is issued.

During the frr restart, vrf_id will be unknown,
so irrespective of redistribution, we set the redistribute vrf bitmap.
Later, when we add a route and then issue 'redistribute' cmd,
we check the redistribute vrf bitmap and return CMD_WARNING;
zebra_redistribute_add also checks the redistribute vrf bitmap and returns.

Instead of checking the redistribute vrf bitmap, always set it anyways.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
3 years agobgpd: vrf route leaking, fix vrf delete
Abhinay Ramesh [Wed, 31 Mar 2021 11:32:57 +0000 (11:32 +0000)]
bgpd: vrf route leaking, fix vrf delete

Description:
Imported/leak-from routes do not get withdrawn/removed
even if the source VRF is deleted.
Deleting and re-adding a tenant vrf, does not refresh the RIB.

Whenever VRF is deleted (bgp_vrf_disable),
currently we are withdrawing leak-from-vrf and
leak-to-vrf routes from vpn table for the vrf,
which is deleted.
But we are currently not withdrawing routes from leak-to vrfs.
We should also withdraw leak-to routes
from leak-to vrfs (calling vpn_leak_to_vrf_withdraw).

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
3 years agobgpd: vrf route leaking, fix the bgp instance delete and re-add
Abhinay Ramesh [Wed, 31 Mar 2021 11:05:56 +0000 (11:05 +0000)]
bgpd: vrf route leaking, fix the bgp instance delete and re-add

Description:
FRR doesn't re-install the routes, imported from a tenant VRF,
when bgp instance for source vrf is deleted and re-added again.
When bgp instance is removed and re-added, when import statement is already there,
then route leaking stops between two VRFs.

Every 'router bgp' command should trigger re-export of all the routes
to the importing bgp vrf instances.
When a router bgp is configured, there could be bgp vrf instance(s) importing routes from
this newly configured bgp vrf instance.
We need to export routes from configured bgp vrf to VPN.
This can impact performance, whenever we are testing scale from vrf route-leaking perspective.
We should not trigger re-export for already existing bgp vrf instances.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
3 years agoMerge pull request #8413 from mjstapp/zebra_doc_debugs
Quentin Young [Tue, 6 Apr 2021 22:11:50 +0000 (22:11 +0000)]
Merge pull request #8413 from mjstapp/zebra_doc_debugs

docs: add zebra debug docs

3 years agolib: delete empty access-lists
Igor Ryzhov [Tue, 6 Apr 2021 18:58:56 +0000 (21:58 +0300)]
lib: delete empty access-lists

We should delete the access-list when the last entry and remark is
deleted. This is already done for prefix-lists.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: fix deletion of empty prefix-lists
Igor Ryzhov [Tue, 6 Apr 2021 18:26:09 +0000 (21:26 +0300)]
lib: fix deletion of empty prefix-lists

We delete the prefix-list when its last entry is deleted, but the check
is missed when we delete the description.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: fix usage of operational data in CLI
Igor Ryzhov [Tue, 6 Apr 2021 18:09:50 +0000 (21:09 +0300)]
lib: fix usage of operational data in CLI

CLI must never use operational data, because this won't work in
transactional mode. Rework search for prefix-list/access-list entries
using only candidate config.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8411 from donaldsharp/nhrp_really
Jafar Al-Gharaibeh [Tue, 6 Apr 2021 20:00:57 +0000 (15:00 -0500)]
Merge pull request #8411 from donaldsharp/nhrp_really

nhrpd: Fixup tab usage and sockunion2str usage

3 years agoospfd: permit over-write of message-digest-key
Mark Stapp [Tue, 6 Apr 2021 19:26:51 +0000 (15:26 -0400)]
ospfd: permit over-write of message-digest-key

Allow over-write of message-digest-key interface config. Most
attributes handle multi-instance by ... ignoring instances,
and tolerating repeated config: do the same for md5 auth.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agodocs: add zebra debug docs
Mark Stapp [Tue, 6 Apr 2021 18:18:18 +0000 (14:18 -0400)]
docs: add zebra debug docs

Add docs for the zebra debug commands.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agolib: fix check for duplicated access-list entries
Igor Ryzhov [Tue, 6 Apr 2021 17:35:33 +0000 (20:35 +0300)]
lib: fix check for duplicated access-list entries

The correct string representation for "empty" type is an empty string.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: convert route-map optimization to NB
Igor Ryzhov [Thu, 1 Apr 2021 16:28:24 +0000 (19:28 +0300)]
lib: convert route-map optimization to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8405 from mjstapp/skip_backup_lsps
Russ White [Tue, 6 Apr 2021 15:11:52 +0000 (11:11 -0400)]
Merge pull request #8405 from mjstapp/skip_backup_lsps

zebra: don't process LSPs with backups immediately

3 years agoMerge pull request #8407 from ton31337/fix/nexthop_should_not_be_changed_if_peer_shar...
Russ White [Tue, 6 Apr 2021 15:02:19 +0000 (11:02 -0400)]
Merge pull request #8407 from ton31337/fix/nexthop_should_not_be_changed_if_peer_shares_common_subnet

tests: Nexthop should not be changed if peer X shares a common subnet

3 years agonhrpd: Fixup tab usage and sockunion2str usage
Donald Sharp [Tue, 6 Apr 2021 14:09:48 +0000 (10:09 -0400)]
nhrpd: Fixup tab usage and sockunion2str usage

For some reason the usage of tabs in a string snuck in as well
as using a sockunion2str instead of %pSU.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8295 from opensourcerouting/ospf6-topo-stabilize
Mark Stapp [Tue, 6 Apr 2021 13:48:45 +0000 (09:48 -0400)]
Merge pull request #8295 from opensourcerouting/ospf6-topo-stabilize

topotest: stabilize OSPFv3 topology

3 years agoMerge pull request #8360 from kuldeepkash/bgp_graceful_restart
Martin Winter [Tue, 6 Apr 2021 12:09:52 +0000 (14:09 +0200)]
Merge pull request #8360 from kuldeepkash/bgp_graceful_restart

tests: Fix for BGP_GR test failures

3 years agoospfd: fix output of dead-interval in show running
Alexander Chernavin [Fri, 2 Apr 2021 12:55:05 +0000 (08:55 -0400)]
ospfd: fix output of dead-interval in show running

When you set OSPF hello-interval for an interface and dead-interval is
not set for this interface, dead-interval will be calculated and set
automatically. "show running-config" will contain an invalid command:

    test(config)# interface vpp1
    test(config-if)# ip ospf area 0
    test(config-if)# ip ospf hello-interval 1
    test(config-if)# exit
    test(config)#
    test(config)# do show running-config
    ...
    interface if1
     ip ospf area 0
     ip ospf dead-interval minimal hello-multiplier 0
     ip ospf hello-interval 1
    !
    ...

It causes frr-reload.py to fail because of this:

    # vtysh -c "show running-config no-header" | vtysh -m -f -
    line 9: % Unknown command:  ip ospf dead-interval minimal hello-multiplier 0
    ...

With this change, output "ip ospf dead-interval" only if it has value
configured explicitly.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
3 years agotests: Nexthop should not be changed if peer X shares a common subnet
Donatas Abraitis [Tue, 6 Apr 2021 06:51:21 +0000 (09:51 +0300)]
tests: Nexthop should not be changed if peer X shares a common subnet

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #8391 from idryzhov/fix-bgp-nb-prefix-list
Renato Westphal [Tue, 6 Apr 2021 04:10:41 +0000 (01:10 -0300)]
Merge pull request #8391 from idryzhov/fix-bgp-nb-prefix-list

bgpd: prefix-list and route-map nb fixes

3 years agoMerge pull request #8384 from volta-networks/fix_no_srb_block
Quentin Young [Tue, 6 Apr 2021 03:44:25 +0000 (03:44 +0000)]
Merge pull request #8384 from volta-networks/fix_no_srb_block

tools: do in-place SRGB/SRLB changes

3 years agonhrpd: Fix style issues
Reuben Dowle [Thu, 1 Apr 2021 01:28:25 +0000 (14:28 +1300)]
nhrpd: Fix style issues

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Add missing semicolon
Reuben Dowle [Wed, 24 Mar 2021 19:08:08 +0000 (08:08 +1300)]
nhrpd: Add missing semicolon

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Improve debug message for multicast interception
Reuben Dowle [Sun, 21 Mar 2021 20:49:47 +0000 (09:49 +1300)]
nhrpd: Improve debug message for multicast interception

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agoospfd: Suppress spurious write message when using ip nhrp map multicast
Reuben Dowle [Thu, 18 Mar 2021 02:40:09 +0000 (15:40 +1300)]
ospfd: Suppress spurious write message when using ip nhrp map multicast

When ip nhrp map multicast is being used, this is usually accompanied by an
iptables rule to block the original multicast packet. This causes sendmsg to
return EPERM.

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agoospfd: changes for PMP network /32 prefix length
Amol Lad [Thu, 7 Jan 2021 08:04:00 +0000 (13:34 +0530)]
ospfd: changes for PMP network /32 prefix length

Operation with PMP network on /32 prefix is needed for DMVPN

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Cleanup multicast nflog handler function
Reuben Dowle [Tue, 16 Mar 2021 22:33:53 +0000 (11:33 +1300)]
nhrpd: Cleanup multicast nflog handler function

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Introduce new - nflog mutlicast-nflog-group (1-65535) - command
Amol Lad [Thu, 17 Dec 2020 08:08:06 +0000 (13:38 +0530)]
nhrpd: Introduce new - nflog mutlicast-nflog-group (1-65535) - command

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Use ethertype defines instead of hard-coded values
Reuben Dowle [Tue, 9 Mar 2021 01:00:45 +0000 (14:00 +1300)]
nhrpd: Use ethertype defines instead of hard-coded values

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Document how to block redirected multicast packets
Reuben Dowle [Tue, 9 Mar 2021 00:52:23 +0000 (13:52 +1300)]
nhrpd: Document how to block redirected multicast packets

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Use strlcpy not unsafe strncpy
Reuben Dowle [Thu, 4 Mar 2021 01:03:07 +0000 (14:03 +1300)]
nhrpd: Use strlcpy not unsafe strncpy

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Fix style violation issues
Reuben Dowle [Tue, 2 Mar 2021 03:34:15 +0000 (16:34 +1300)]
nhrpd: Fix style violation issues

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Use correct printf format specifier
Reuben Dowle [Thu, 25 Feb 2021 23:00:24 +0000 (12:00 +1300)]
nhrpd: Use correct printf format specifier

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agoospfd: Document option to support dmvpn networks
Reuben Dowle [Thu, 25 Feb 2021 22:12:49 +0000 (11:12 +1300)]
ospfd: Document option to support dmvpn networks

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
3 years agonhrpd: Document multicast functionality
Reuben Dowle [Thu, 25 Feb 2021 21:10:48 +0000 (10:10 +1300)]
nhrpd: Document multicast functionality

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>