]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 years agostaticd: fix distance processing 8739/head
Igor Ryzhov [Tue, 25 May 2021 12:49:46 +0000 (15:49 +0300)]
staticd: fix distance processing

When the user adds the route + nexthop pair that already exists with a
different distance, we should replace it instead of adding a new one.

Likewise, when the user wants to delete the route + nexthop pair without
explicitly entering the distance, we should delete the route.

Fixes #8695.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8624 from c-po/graceful-restart-7.5
Igor Ryzhov [Wed, 5 May 2021 00:42:53 +0000 (03:42 +0300)]
Merge pull request #8624 from c-po/graceful-restart-7.5

3 years agobgpd: changing graceful-restart parameters should not be considered as error 8624/head
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>
(cherry picked from commit 5b899e99fe25f3edba1fdba2b6686a9aa8c56b6b)

4 years agoMerge pull request #8579 from opensourcerouting/7.5/fixes-20210421
Quentin Young [Thu, 29 Apr 2021 15:57:20 +0000 (15:57 +0000)]
Merge pull request #8579 from opensourcerouting/7.5/fixes-20210421

4 years agolib: correctly exit CLI nodes on file config load 8579/head
David Lamparter [Thu, 8 Apr 2021 11:35:09 +0000 (13:35 +0200)]
lib: correctly exit CLI nodes on file config load

The (legacy) code for reading split configs tries to execute config
commands in parent nodes, but doesn't call the node_exit function when
it goes up to a parent node.  This breaks BGP RPKI setup (and extended
syslog, which is in the next commit.)

Doing this correctly is a slight bit involved since the node_exit
callbacks should only be called if the command is actually executed on a
parent node.

Signed-off-by: David Lamparter <equinox@diac24.net>
(cherry picked from commit e3476061fe43394759668082509a2b15cf23a428)

4 years agolib: fix possible assert() fail in zlog_fd()
David Lamparter [Sat, 10 Apr 2021 19:02:06 +0000 (21:02 +0200)]
lib: fix possible assert() fail in zlog_fd()

If the last message in a batched logging operation isn't printed due to
priority, this skips the code that flushes prepared messages through
writev() and can trigger the assert() at the end of zlog_fd().

Since any logmsg above info priority triggers a buffer flush, running
into this situation requires a log file target configured for info
priority, at least 1 message of info priority buffered, a debug message
buffered after that, and then a buffer flush (explicit or due to buffer
full).

I haven't seen this chain of events happen in the wild, but it needs
fixing anyway.

Signed-off-by: David Lamparter <equinox@diac24.net>
(cherry picked from commit db2baed166581081db692fab0214752dbb121ed3)

4 years agoMerge pull request #8533 from idryzhov/7.5-fix-yang-zebra
David Lamparter [Thu, 22 Apr 2021 11:47:45 +0000 (13:47 +0200)]
Merge pull request #8533 from idryzhov/7.5-fix-yang-zebra

[7.5] yang: fix zebra module

4 years agoyang: fix zebra module 8533/head
Igor Ryzhov [Thu, 22 Apr 2021 09:48:19 +0000 (12:48 +0300)]
yang: fix zebra module

Fixes: #8521
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #8512 from f0o/stable/7.5
Donald Sharp [Tue, 20 Apr 2021 13:07:13 +0000 (09:07 -0400)]
Merge pull request #8512 from f0o/stable/7.5

[7.5] Cherry-picking #8309

4 years agoMerge pull request #8518 from idryzhov/7.5-debian-10-ci
Donald Sharp [Tue, 20 Apr 2021 12:41:20 +0000 (08:41 -0400)]
Merge pull request #8518 from idryzhov/7.5-debian-10-ci

[7.5] fix debian 10 ci

4 years agotests: fix l3mdev config in isis-topo1-vrf topotest 8518/head
David Schweizer [Mon, 5 Apr 2021 07:25:54 +0000 (09:25 +0200)]
tests: fix l3mdev config in isis-topo1-vrf topotest

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
4 years agotests: fix l3mdev config in bgp_vrf_lite_ipv6_rtadv topotest
David Schweizer [Mon, 5 Apr 2021 07:25:53 +0000 (09:25 +0200)]
tests: fix l3mdev config in bgp_vrf_lite_ipv6_rtadv topotest

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
4 years agotests: fix l3mdev config in bgp_l3vpn_to_bgp_vrf topotest
David Schweizer [Mon, 5 Apr 2021 07:25:52 +0000 (09:25 +0200)]
tests: fix l3mdev config in bgp_l3vpn_to_bgp_vrf topotest

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
4 years agotests: fix l3mdev config in bgp_evpn_rt5 topotest
David Schweizer [Mon, 5 Apr 2021 07:25:51 +0000 (09:25 +0200)]
tests: fix l3mdev config in bgp_evpn_rt5 topotest

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
4 years agotests: add l3mdev config helpers for VRF topotests
David Schweizer [Mon, 5 Apr 2021 07:25:50 +0000 (09:25 +0200)]
tests: add l3mdev config helpers for VRF topotests

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
4 years agotools: run `vtysh -b` once for all-startup 8512/head
David Lamparter [Mon, 22 Mar 2021 19:21:19 +0000 (20:21 +0100)]
tools: run `vtysh -b` once for all-startup

As noted by Donald:

When FRR is starting all daemons (or restarting them all) FRR is reading
in the configuration 1 time for each daemon specified to run. This is
not a big deal if you have a very small configuration. But with large
configurations FRR is taking long enough that watchfrr is not
establishing connection to all the daemons and starting some over.

Modify the code so that vtysh is only read in at the end of a all
sequence. If we are restarting an individual daemon allow the read in of
the whole config.

Reported-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #8468 from idryzhov/7.5-fix-acl-delete
Mark Stapp [Fri, 16 Apr 2021 14:53:31 +0000 (10:53 -0400)]
Merge pull request #8468 from idryzhov/7.5-fix-acl-delete

[7.5] lib: fix access-list deletion

4 years agolib: fix access-list deletion 8468/head
Igor Ryzhov [Wed, 14 Apr 2021 10:08:18 +0000 (13:08 +0300)]
lib: fix access-list deletion

Problems with the current implementation:
* Delete hook is called before the deletion of the access-list from the
  master list, which means that daemons processing this hook successfully
  find this access-list, store a pointer to it in their structures, and
  right after that the access-list is freed. Daemons end up having stale
  pointer to the freed structure.
* Route-maps are not notified of the deletion.

This commit fixes both issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #8439 from idryzhov/7.5-fix-interface-nb-stale-pointers
Quentin Young [Tue, 13 Apr 2021 15:26:57 +0000 (15:26 +0000)]
Merge pull request #8439 from idryzhov/7.5-fix-interface-nb-stale-pointers

[7.5] lib: fix interface nb stale pointers

4 years agoMerge pull request #8454 from idryzhov/7.5-fix-dup-acl
Renato Westphal [Mon, 12 Apr 2021 23:20:20 +0000 (20:20 -0300)]
Merge pull request #8454 from idryzhov/7.5-fix-dup-acl

[7.5] lib: fix check for duplicated access-list entries

4 years agolib: fix check for duplicated access-list entries 8454/head
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>
4 years agolib: fix interface nb stale pointers 8439/head
Igor Ryzhov [Thu, 8 Apr 2021 12:43:07 +0000 (15:43 +0300)]
lib: fix interface nb stale pointers

The first change in this commit is the processing of the VRF termination.
When we terminate the VRF, we should not delete the underlying interfaces,
because there may be pointers to them in the northbound configuration. We
should move them to the default VRF instead.

Because of the first change, the VRF interface itself is also not deleted
when deleting the VRF. It should be handled in netlink_link_change. This
is done by the second change.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #8418 from mjstapp/fix_nhrp_bgp_sa_7_5
Jafar Al-Gharaibeh [Thu, 8 Apr 2021 03:16:09 +0000 (22:16 -0500)]
Merge pull request #8418 from mjstapp/fix_nhrp_bgp_sa_7_5

[7.5] bgpd, nhrpd: fix clang static analysis warnings

4 years agoMerge pull request #8416 from mjstapp/fix_nh_labels_cmp_7_5
Jafar Al-Gharaibeh [Thu, 8 Apr 2021 03:15:12 +0000 (22:15 -0500)]
Merge pull request #8416 from mjstapp/fix_nh_labels_cmp_7_5

[7.5] lib: Fix label-stack comparison for nexthops

4 years agobgpd, nhrpd: fix clang static analysis warnings in 7.5 branch 8418/head
Mark Stapp [Wed, 7 Apr 2021 14:42:56 +0000 (10:42 -0400)]
bgpd, nhrpd: fix clang static analysis warnings in 7.5 branch

Clean up a couple of SA warnings in the 7.5 branch.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib: Fix label-stack comparison for nexthops 8416/head
Mark Stapp [Wed, 7 Apr 2021 14:08:46 +0000 (10:08 -0400)]
lib: Fix label-stack comparison for nexthops

Use the correct number of octets in the comparison of
nexthops' label stacks.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #8390 from c-po/backports
Jafar Al-Gharaibeh [Tue, 6 Apr 2021 15:36:47 +0000 (10:36 -0500)]
Merge pull request #8390 from c-po/backports

[7.5] tools: frr-reload fixes for deleting vrf static routes

4 years agoMerge pull request #8393 from idryzhov/7.5-ospf-ignore-dup
Donald Sharp [Tue, 6 Apr 2021 15:35:54 +0000 (11:35 -0400)]
Merge pull request #8393 from idryzhov/7.5-ospf-ignore-dup

[7.5] ospfd: ignore duplicated "ip ospf area" commands

4 years agoMerge pull request #8371 from idryzhov/7.5-filter-fixes
Russ White [Tue, 6 Apr 2021 15:13:10 +0000 (11:13 -0400)]
Merge pull request #8371 from idryzhov/7.5-filter-fixes

[7.5] access-list and prefix-list fixes

4 years agoospfd: ignore duplicated "ip ospf area" commands 8393/head
Igor Ryzhov [Fri, 2 Apr 2021 00:22:24 +0000 (03:22 +0300)]
ospfd: ignore duplicated "ip ospf area" commands

Fixes #8388.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #8359 from idryzhov/7.5-fix-nb-vrf-crash
Mark Stapp [Thu, 1 Apr 2021 20:42:35 +0000 (16:42 -0400)]
Merge pull request #8359 from idryzhov/7.5-fix-nb-vrf-crash

[7.5] *: modify VRF_CONFIGURED flag only in VRF NB layer

4 years agotools: frr-reload fixes for deleting vrf static routes 8390/head
Don Slice [Fri, 19 Mar 2021 19:10:14 +0000 (15:10 -0400)]
tools: frr-reload fixes for deleting vrf static routes

Problems reported that in certain cases, frr-reload.py would
delete vrf static routes inadvertantly due to two different
reasons. First, vrf statics with null0 or Null0 nexthops would
fail the match since rendered as blackholes.  This was already
fixed for non-vrf statics so added for vrf-based.  Second,
frr-reload would fail to match due to different formats for
adding the command. If entered in the old way
"ip route x.x.x.x/x y.y.y.y vrf NAME" and rendered
in the new sway "vrf NAME\nip route x.x.x.x/x y.y.y.y" it would
fail to match do an inadvertant delete.

Ticket: 2570270
Signed-off-by: Don Slice <dslice@nvidia.com>
(cherry picked from commit 00302a580c57fce0bb45d3fd6af9d4408a417ceb)

4 years agoMerge pull request #8386 from idryzhov/7.5-fix-no-bfd
Mark Stapp [Thu, 1 Apr 2021 16:52:09 +0000 (12:52 -0400)]
Merge pull request #8386 from idryzhov/7.5-fix-no-bfd

[7.5] Fix "no bfd" crash

4 years agobfdd: fix profiles autocompletion 8386/head
Igor Ryzhov [Thu, 1 Apr 2021 12:48:24 +0000 (15:48 +0300)]
bfdd: fix profiles autocompletion

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobbfd: clear nb config entries when removing bfd node
Igor Ryzhov [Thu, 1 Apr 2021 12:42:53 +0000 (15:42 +0300)]
bbfd: clear nb config entries when removing bfd node

When bfd node is removed, we must clear all NB entries set by its
children - sessions and profiles. Let's store some fake data as an entry
for the bfd node to be able to unset it later.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobfdd: remove profiles when removing bfd node
Igor Ryzhov [Thu, 1 Apr 2021 12:29:18 +0000 (15:29 +0300)]
bfdd: remove profiles when removing bfd node

Fixes #8379.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agolib: fix checking for duplicated prefix-list entries 8371/head
Igor Ryzhov [Mon, 29 Mar 2021 21:37:52 +0000 (00:37 +0300)]
lib: fix checking for duplicated prefix-list entries

Restore the behavior that was before the NB conversion.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agolib: fix checking for duplicated access-list entries
Igor Ryzhov [Mon, 29 Mar 2021 18:26:28 +0000 (21:26 +0300)]
lib: fix checking for duplicated access-list entries

Restore the behavior that was before the NB conversion.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #8363 from idryzhov/7.5-fix-ospf-cli-count
Mark Stapp [Tue, 30 Mar 2021 13:38:38 +0000 (09:38 -0400)]
Merge pull request #8363 from idryzhov/7.5-fix-ospf-cli-count

[7.5] ospfd: fix counting of "ip ospf area" commands

4 years agoospfd: fix counting of "ip ospf area" commands 8363/head
Igor Ryzhov [Mon, 29 Mar 2021 11:47:43 +0000 (14:47 +0300)]
ospfd: fix counting of "ip ospf area" commands

Instead of trying to maintain if_ospf_cli_count, let's directly count
the number of configured interfaces when it is needed. Current approach
sometimes leads to an incorrect counter.

Fixes #8321.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years ago*: modify VRF_CONFIGURED flag only in VRF NB layer 8359/head
Igor Ryzhov [Sun, 28 Mar 2021 21:49:13 +0000 (00:49 +0300)]
*: modify VRF_CONFIGURED flag only in VRF NB layer

This is to fix the crash reproduced by the following steps:

* ip link add red type vrf table 1

  Creates VRF.

* vtysh -c "conf" -c "vrf red"

  Creates VRF NB node and marks VRF as configured.

* ip route 1.1.1.0/24 2.2.2.2 vrf red
* no ip route 1.1.1.0/24 2.2.2.2 vrf red
  (or similar l3vni set/unset in zebra)

  Marks VRF as NOT configured.

* ip link del red

  VRF is deleted, because it is marked as not configured, but NB node
  stays.

Subsequent attempt to configure something in the VRF leads to a crash
because of the stale pointer in NB layer.

Fixes #8357.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #8328 from idryzhov/7.5-backports-2021-03-24
Donald Sharp [Thu, 25 Mar 2021 12:05:47 +0000 (08:05 -0400)]
Merge pull request #8328 from idryzhov/7.5-backports-2021-03-24

7.5 backports

4 years agozebra: fix duplicated definitions 8328/head
Igor Ryzhov [Sun, 14 Feb 2021 02:39:23 +0000 (05:39 +0300)]
zebra: fix duplicated definitions

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agozebra: fix vni configuration in default vrf
Igor Ryzhov [Sun, 14 Feb 2021 02:39:00 +0000 (05:39 +0300)]
zebra: fix vni configuration in default vrf

VNI configuration is done without NB layer in default VRF. It leads to
the following problems:

```
vtysh -c "conf" -c "vni 1"
vtysh -c "conf" -c "vrf default" -c "no vni"
```
Second command does nothing, because the NB node is not created by the
first command.

```
vtysh -c "conf" -c "vrf default" -c "vni 1"
vtysh -c "conf" -c "no vni 1"
```
Second command doesn't delete the NB node created by the first command.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoospf6d: fix warning message when interfae disabled
ckishimo [Tue, 16 Mar 2021 23:14:26 +0000 (00:14 +0100)]
ospf6d: fix warning message when interfae disabled

When removing an interface from an existing area,
the warning message we get is not correct

  interface r1-r2-eth0
   ipv6 address 2013:12::1/64
   ipv6 ospf6 dead-interval 4
   ipv6 ospf6 hello-interval 1
  !
  interface dummy
   ipv6 ospf6 dead-interval 4
   ipv6 ospf6 hello-interval 1
   ipv6 ospf6 network point-to-point
  !
  router ospf6
   ospf6 router-id 1.1.1.1
   interface r1-r2-eth0 area 0.0.0.0
  !

  r1(config-if)# router ospf6
  r1(config-ospf6)# no interface dummy area 0.0.0.0
  No such Area-ID: 0.0.0.0   <--- area 0.0.0.0 exists

This is fixing the error message

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
4 years agoospf6d: remove interface prefix when area is removed
ckishimo [Tue, 16 Mar 2021 23:01:19 +0000 (00:01 +0100)]
ospf6d: remove interface prefix when area is removed

This bug was first reported in PR#7717. When removing an interface
from the area, the interface prefix is still shown

  r1# sh ipv6 ospf6 interface prefix
  *N IA 2013:12::/64       ::1      r1-r2-eth0 00:00:12

  r1# conf t
  r1(config)# router ospf6
  r1(config-ospf6)# no interface r1-r2-eth0 area 0.0.0.0
  r1(config-ospf6)# exit

  r1# sh ipv6 ospf6 interface prefix
  *N IA 2013:12::/64       ::1      r1-r2-eth0 00:00:22

This fix will check if the interface is disabled so the
prefix is not shown

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
4 years agoospf6d: fix iface commands lost when removing from area
ckishimo [Tue, 16 Mar 2021 22:47:18 +0000 (23:47 +0100)]
ospf6d: fix iface commands lost when removing from area

In OSPFv3 when removing the interface from an area, all ospf6
interface commands are lost, so when changing the area you need
to reconfigure all ospf6 interface commands again

  r1# sh run
  interface r1-r2-eth0
   ipv6 address 2013:12::1/64
   ipv6 ospf6 dead-interval 4
   ipv6 ospf6 hello-interval 1
   ipv6 ospf6 network point-to-point
  !
  router ospf6
   ospf6 router-id 1.1.1.1
   interface r1-r2-eth0 area 0.0.0.0
  !

  r1# conf t
  r1(config)# router ospf6
  r1(config-ospf6)# no interface r1-r2-eth0 area 0.0.0.0
  r1(config-ospf6)# exit

  r1# sh run
  interface r1-r2-eth0
   ipv6 address 2013:12::1/64
  !                            <----- missing all ipv6 ospf6 commands
  router ospf6
   ospf6 router-id 1.1.1.1
  !

This is because the interface is being deleted instead of disabled
(see PR#7717) I believe the interface should be left as disabled
(not deleted) when removing the interface from the area

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
4 years agolib: fix a crash in plist update
Chirag Shah [Mon, 25 Jan 2021 19:44:56 +0000 (11:44 -0800)]
lib: fix a crash in plist update

Problem:
Prefix-list with mulitiple rules, an update to
a rule/sequence with different prefix/prefixlen
reset prefix-list next-base pointer to avoid
having stale value.

In some case the old next-bast's reference leads
to an assert in tri (trie_install_fn ) add.

bt:
(object=0x55576a4c8a00, updptr=0x55576a4b97e0) at lib/plist.c:560
(plist=0x55576a4a1770, pentry=0x55576a4c8a00) at lib/plist.c:585
(ple=0x55576a4c8a00) at lib/plist.c:745
(args=0x7fffe04beb50) at lib/filter_nb.c:1181

Solution:
Reset prefix-list next-base pointer whenver a
sequence/rule is updated.

Ticket:CM-33109
Testing Done:

Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: fix starting echo receive timer
Igor Ryzhov [Tue, 9 Mar 2021 22:17:47 +0000 (01:17 +0300)]
bfdd: fix starting echo receive timer

Currently this timer is only started when we receive the first echo
packet. If we never receive the packet, the timer is never started and
the user falsely assumes that echo function is working.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobgpd: Attempting to activate unicast and labeled-unicast
Donald Sharp [Wed, 17 Mar 2021 02:21:05 +0000 (22:21 -0400)]
bgpd: Attempting to activate unicast and labeled-unicast

Should return an actual useful error message.
Commit: 055679e915fc826fe13abdd8d60a22a0ca35c8c6 messed this error message
up.

Fixes: #8246
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoeigrpd: fix dependency on operational state in cli
Igor Ryzhov [Fri, 12 Mar 2021 23:09:34 +0000 (02:09 +0300)]
eigrpd: fix dependency on operational state in cli

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoeigrpd: fix xpaths
Igor Ryzhov [Fri, 12 Mar 2021 22:50:08 +0000 (01:50 +0300)]
eigrpd: fix xpaths

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobgpd: handle socket read errors in the main pthread
Mark Stapp [Tue, 9 Mar 2021 16:13:41 +0000 (11:13 -0500)]
bgpd: handle socket read errors in the main pthread

Add a handler for socket errors that runs in the main pthread,
rather than the io pthread. When the io pthread encounters a
read error, capture the error and schedule a task for the main
pthread.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agobfdd: make sessions administratively up by default
Igor Ryzhov [Wed, 10 Mar 2021 19:11:19 +0000 (22:11 +0300)]
bfdd: make sessions administratively up by default

Current behavior is inconsistent. When the session is created by another
daemon, it is up by default. When we later configure peer in bfdd, the
session is still up, but the NB layer thinks that it is down.

More than that, even when the session is created in bfdd using peer
command, it is created in DOWN state, not ADM_DOWN. And it actually
starts sending and receiving packets. The sessions is marked with
SHUTDOWN flag only when we try to reconfigure some parameter. This
behavior is also very unexpected.

Fixes #7780.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agolib: fix crash when iterating over nb operational data
Igor Ryzhov [Fri, 26 Feb 2021 16:17:28 +0000 (19:17 +0300)]
lib: fix crash when iterating over nb operational data

Example:
```
show yang operational-data /frr-routing:routing/control-plane-protocols/control-plane-protocol[type='frr-staticd:staticd'][name='staticd'][vrf='default'] staticd
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobfdd: fix detect timeout
Igor Ryzhov [Tue, 9 Mar 2021 20:08:41 +0000 (23:08 +0300)]
bfdd: fix detect timeout

RFC 5880 Section 6.8.4:

In Asynchronous mode, the Detection Time calculated in the local
system is equal to the value of Detect Mult received from the remote
system, multiplied by the agreed transmit interval of the remote
system (the greater of bfd.RequiredMinRxInterval and the last
received Desired Min TX Interval).

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #8306 from c-po/isis-backports
Igor Ryzhov [Wed, 24 Mar 2021 15:53:18 +0000 (18:53 +0300)]
Merge pull request #8306 from c-po/isis-backports

isisd backports from master

4 years agoisisd: fix extra space after "ip router isis" 8306/head
Igor Ryzhov [Wed, 24 Mar 2021 07:30:36 +0000 (10:30 +0300)]
isisd: fix extra space after "ip router isis"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 2ba0884a65c3146676fac3357fe6b8b86b636256)

4 years agoospf6d: fix setting NOAUTOCOST flag
Emanuele Di Pascale [Wed, 3 Mar 2021 09:56:51 +0000 (10:56 +0100)]
ospf6d: fix setting NOAUTOCOST flag

ospf6 keeps a flag to remember whether the cost for an interface
was manually added via config or computed automatically, but if
the configured value matches the auto-computed one we were not
setting this flag, meaning that the config would not show up in
the config.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agobfdd: fix echo configuration in profile
Igor Ryzhov [Thu, 4 Mar 2021 18:17:20 +0000 (21:17 +0300)]
bfdd: fix echo configuration in profile

It's not currently possible to configure echo mode in profile node:
```
(config)# bfd
(config-bfd)# profile test
(config-bfd-profile)# echo-mode
% Echo mode is only available for single hop sessions.
(config-bfd-profile)# echo-interval 20
% Echo mode is only available for single hop sessions.
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobfdd: session specific command type checks
Rafael Zalamena [Tue, 1 Dec 2020 11:01:37 +0000 (08:01 -0300)]
bfdd: session specific command type checks

Replace the unclear error message:

```
% Failed to edit configuration.

YANG error(s):
 Schema node not found.
 YANG path: /frr-bfdd:bfdd/bfd/sessions/single-hop[dest-addr='192.168.253.6'][interface=''][vrf='default']/minimum-ttl
```

With:

```
frr(config-bfd-peer)# minimum-ttl 250
% Minimum TTL is only available for multi hop sessions.

! or

frr(config-bfd-peer)# echo
% Echo mode is only available for single hop sessions.
frr(config-bfd-peer)# echo-interval 300
% Echo mode is only available for single hop sessions.
```

Reported-by: Trae Santiago
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: require local-address when using multihop
Igor Ryzhov [Wed, 3 Mar 2021 16:38:38 +0000 (19:38 +0300)]
bfdd: require local-address when using multihop

If local-address is not supplied, then an incorrect xpath is generated
which is not expected by NB CLI.

Fixes #7465.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobgpd: fix bgp statistics for l2vpn evpn
Trey Aspelund [Thu, 4 Mar 2021 02:05:56 +0000 (02:05 +0000)]
bgpd: fix bgp statistics for l2vpn evpn

'show bgp l2vpn evpn statistics' was returning 0 for all stats
because bgp_table_stats_walker bailed out if afi != AFI_IP or AFI_IP6.
Add case condition to catch AFI_L2VPN.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
4 years agodoc: fix link for python2 get-pip.py
Igor Ryzhov [Wed, 3 Mar 2021 21:13:44 +0000 (00:13 +0300)]
doc: fix link for python2 get-pip.py

Script by the current link doesn't work with Python 2 anymore:
```
ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.6.
Please use https://bootstrap.pypa.io/2.7/get-pip.py instead.
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agolib: print NULL for NULL nexthops
Mark Stapp [Mon, 1 Mar 2021 13:51:13 +0000 (08:51 -0500)]
lib: print NULL for NULL nexthops

Instead of crashing, print "NULL" when printfrr callback for
nexthops is called for a NULL nexthop argument.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoisisd: Fix spelling mistake
Donald Sharp [Sat, 20 Mar 2021 23:52:38 +0000 (19:52 -0400)]
isisd: Fix spelling mistake

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit ec7b142568648950cfe151a19ee747d0cfe6a20e)

4 years agoisisd: Fix extra space after `router isis FOO`
Donald Sharp [Sun, 21 Mar 2021 17:12:41 +0000 (13:12 -0400)]
isisd: Fix extra space after `router isis FOO`

Fix places where we are outputing an extra space.  This was
because it was prepping for vrf but we may not have a vrf.

Fixes: #8300
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 31200a2963e02642323c592990469861d0cdbc9d)

4 years agoMerge pull request #8314 from mjstapp/fix_bgp_td_spec
David Lamparter [Tue, 23 Mar 2021 18:27:42 +0000 (19:27 +0100)]
Merge pull request #8314 from mjstapp/fix_bgp_td_spec

bgpd: fix a format spec in 7.5 branch

4 years agobgpd: fix format spec in 7.5 branch 8314/head
Mark Stapp [Tue, 23 Mar 2021 15:44:16 +0000 (11:44 -0400)]
bgpd: fix format spec in 7.5 branch

Fix a bad format-spec in a log message in bgpd

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #8277 from c-po/backports-7.5
Donatas Abraitis [Wed, 17 Mar 2021 19:52:05 +0000 (21:52 +0200)]
Merge pull request #8277 from c-po/backports-7.5

bgpd: If we have a SAFI conflict do not allow labeled unicast to reset

4 years agobgpd: If we have a SAFI conflict do not allow labeled unicast to reset 8277/head
Donald Sharp [Wed, 17 Mar 2021 02:28:29 +0000 (22:28 -0400)]
bgpd: If we have a SAFI conflict do not allow labeled unicast to reset

If we have a SAFI conflict, ie we are trying to activate safi's
UNICAST and LABELED_UNICAST at the same time, we should not
cause bestpath to be rerun and we should not try to put
labels on everything.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 0f3ac8198ac082cc86b1e544054da0cb1dcfed36)

4 years agoMerge pull request #8272 from mjstapp/fix_netlink_backport_7_5
David Lamparter [Wed, 17 Mar 2021 06:14:14 +0000 (07:14 +0100)]
Merge pull request #8272 from mjstapp/fix_netlink_backport_7_5

[7.5] zebra: backport some netlink cleanups

4 years agozebra: backport 7.5 netlink cleanups 8272/head
Mark Stapp [Tue, 16 Mar 2021 19:52:14 +0000 (15:52 -0400)]
zebra: backport 7.5 netlink cleanups

Backport some cleanups to a couple of log messages and debugs
from master to 7.5 - especially to quiet a couple of unprotected
debugs.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoFRRouting Release 7.5.1 frr-7.5.1
Martin Winter [Thu, 4 Mar 2021 02:14:50 +0000 (03:14 +0100)]
FRRouting Release 7.5.1

This is a maintenance release with the following fixes:
  BABEL
    Fix connected route leak on change
  BFD
    Session lookup was sometimes wrong
    Memory leak and handling cleanups
    In some situations handle vrf appropriately when receiving packets
  BGP
    Peer Group Inheritance Fixes
    Dissallow attempt to peer peers reachable via blackholes
    Send BMP down message when reachability fails
    Cleanup handling of aggregator data when the AGG AS is 0
    Handle `neighbor <peer-group allowas-in` config changes properly
    Properly parse community and lcommunity values in some circumstances
    Allow peer-groups to configure `ttl-security hops`
    Prevent v6 routes with v4 nexthops from being installed
    Allow `default-originate` to be cleared from a peer group
    Fix evpn route-map vni filter at origin
    local routes were using non-default distance
    Properly track if the nexthop was updated in some circumstances
    Cleanup `show running` when running bgp with `-e X` values
    Various Memory leaks in show commands
    Properly withdraw exported routes when deleting a VRF
    Avoid resetting ebgp-multihop if peer setting is the same as peer-group
    Properly encode flowspec rules to zebra in some rare circumstances
    Generate statistics for routes in bgp when we have exactly 1 route
    Properly apply route-map for the default-originate command
  EIGRP
    Properly set MTU for eigrp packets sent
    Various memory leaks and using uninited data fixes
  ISIS
    When last area address is removed, resign if we were the DR
    Various memory leaks and using uninited data fixes
  LDP
    Various memory leaks and using uninited data fixes
  NHRP
    Use onlink routes when prefix == nh
    Shortcut routes are installed with proper nexthop
  OSPF
    Prevent duplicate packet read in multiple vrf situation
    Fix area removal at interface level
    Restore Point to MultiPoint interface types
    Correctly handle MTU change on startup
    Multi Instance initialization sometimes was not successful
    NSSA translate-always was not working properly
  OSPFv3
    Don't send hellos on loopback interfaces
    Handle ECMP better when a sub-path is removed
    Memory leak and handling fixes
    Fix Link LSA not updating when router priority is modified
    Some output from show commands was wrong
    Intra area remote connected prefixes sometimes not installed
  PBR
    Various memory leaks and using uninited data fixes
  PIM
    SGRpt prune received during prune didn't override holdtime
    Various memory leaks and using uninited data fixes
  STATIC
    Fix VRF and usage on startup in some instances
    Tableid was being mishandled in some cases
  VTYSH
    Disable bracketed paste in readline.
  WATCHFRR
    Various memory leaks and using uninited data fixes
  ZEBRA
    Always install blackhole routes using kernel routes instead of nexthops
    Various memory leaks and using uninited data fixes
    Dissallow resolution to duplicate nexthops that created infinite nexthops
    Apply the route-map delay-timer globally
    Some routes were stuck in Queued state when using the FPM
    Better handle vrf creation when using namespaces
    Set NUD_NOARP on sticky mac entries in addtion to NTF_STICKY
    Allow `set src X` to work on startup
  FRR Library
    Fix a variety of memory leaks
    Fix VRF Creation in some instances
    RPKI context editing was not properly handled in reload situations
    routemap code was not properly handling modification of CLI in some instances
  SNAPCRAFT
    Update to using rtrlib 0.7.0
    Fix passthrough path for Libyang 1.x
  ALPINE
    Remove old docker deps

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoMerge pull request #8187 from opensourcerouting/rpmfixes-75
Lou Berger [Thu, 4 Mar 2021 01:43:30 +0000 (20:43 -0500)]
Merge pull request #8187 from opensourcerouting/rpmfixes-75

[7.5] CentOS Doc Fixes

4 years agoMerge pull request #8193 from mjstapp/fix_signals_7_5
Donald Sharp [Wed, 3 Mar 2021 21:04:07 +0000 (16:04 -0500)]
Merge pull request #8193 from mjstapp/fix_signals_7_5

[7.5] lib: fix signal-handling race in main event loop

4 years agolib: avoid signal-handling race with event loop poll call 8193/head
Mark Stapp [Mon, 21 Sep 2020 19:57:59 +0000 (15:57 -0400)]
lib: avoid signal-handling race with event loop poll call

Manage the main pthread's signal mask to avoid a signal-handling
race. Before entering poll, check for pending signals that the
application needs to handle. Use ppoll() to re-enable those
signals during the poll call.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib: add debug output for signal mask
Mark Stapp [Mon, 21 Sep 2020 20:02:06 +0000 (16:02 -0400)]
lib: add debug output for signal mask

Add an api that debugs the signals in a sigset.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib: add sigevent_check api
Mark Stapp [Wed, 2 Sep 2020 20:25:00 +0000 (16:25 -0400)]
lib: add sigevent_check api

Add an api that blocks application-handled signals (SIGINT,
SIGTERM, e.g.) then tests whether any signals have been received.
This helps to manage a race between signal reception and the poll
call in the main event loop.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agodoc: Fix CentOS 7 Documentation 8187/head
Martin Winter [Wed, 3 Mar 2021 02:55:33 +0000 (03:55 +0100)]
doc: Fix CentOS 7 Documentation

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoMerge pull request #8064 from donaldsharp/foo
Mark Stapp [Wed, 3 Mar 2021 13:32:11 +0000 (08:32 -0500)]
Merge pull request #8064 from donaldsharp/foo

[7.5]bgpd: When deleting a neighbor from a peer-group the PGNAME is optional

4 years agoredhat: Fix changelog incorrect date format
Martin Winter [Wed, 3 Mar 2021 02:54:41 +0000 (03:54 +0100)]
redhat: Fix changelog incorrect date format

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoMerge pull request #8181 from idryzhov/7.5-zebra-blackhole
Mark Stapp [Tue, 2 Mar 2021 20:37:18 +0000 (15:37 -0500)]
Merge pull request #8181 from idryzhov/7.5-zebra-blackhole

[7.5] zebra: don't use kernel nexthops for blackhole routes

4 years agozebra: don't use kernel nexthops for blackhole routes 8181/head
Igor Ryzhov [Thu, 25 Feb 2021 15:28:51 +0000 (18:28 +0300)]
zebra: don't use kernel nexthops for blackhole routes

Fixes #6522 and #8149.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobgpd: When deleting a neighbor from a peer-group the PGNAME is optional 8064/head
Donald Sharp [Thu, 11 Feb 2021 18:18:15 +0000 (13:18 -0500)]
bgpd: When deleting a neighbor from a peer-group the PGNAME is optional

Currently when deleting a neighbor from a peer-group:
no neighbor A.B.C.D peer-group FOO

We must specify FOO, while A.B.C.D is sufficient enough of an
identifier to know what to do.

Make PGNAME optional on this command and just delete the peer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #8161 from mjstapp/fix_sa_7_5_backports
Donatas Abraitis [Sun, 28 Feb 2021 17:53:30 +0000 (19:53 +0200)]
Merge pull request #8161 from mjstapp/fix_sa_7_5_backports

[7.5]lib: Fix SA backports to 7.5

4 years agoMerge pull request #8156 from idryzhov/7.5-backports-2021-02-26
Mark Stapp [Fri, 26 Feb 2021 20:22:46 +0000 (15:22 -0500)]
Merge pull request #8156 from idryzhov/7.5-backports-2021-02-26

7.5 backports

4 years agolib: Free memory leak in error path in clippy 8161/head
Mark Stapp [Fri, 26 Feb 2021 16:21:04 +0000 (11:21 -0500)]
lib: Free memory leak in error path in clippy

When running clippy, the main function in it's
error path could leak the memory pointed to by name.
Fix this.  This was/is reported by clang SA.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agolib: use right type for wconv() return val
Mark Stapp [Fri, 26 Feb 2021 16:19:45 +0000 (11:19 -0500)]
lib: use right type for wconv() return val

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agolib: fix some misc SA warnings
Mark Stapp [Fri, 26 Feb 2021 16:16:09 +0000 (11:16 -0500)]
lib: fix some misc SA warnings

- clippy.c: fix valid memleak
- defun_lex.l: suppress warnings in generated code
- northbound_cli.c: suppress warning in eldritch libyang macro

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agolib: register dependency between control plane protocol and vrf nb nodes 8156/head
Igor Ryzhov [Tue, 16 Feb 2021 09:57:01 +0000 (12:57 +0300)]
lib: register dependency between control plane protocol and vrf nb nodes

When the control plane protocol is created, the vrf structure is
allocated, and its address is stored in the northbound node.
The vrf structure may later be deleted by the user, which will lead to
a stale pointer stored in this node.

Instead of this, allow daemons that use the vrf pointer to register the
dependency between the control plane protocol and vrf nodes. This will
guarantee that the nodes will always be created and deleted together, and
there won't be any stale pointers.

Add such registration to staticd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agolib: add definitions for vrf xpaths
Igor Ryzhov [Tue, 16 Feb 2021 09:57:30 +0000 (12:57 +0300)]
lib: add definitions for vrf xpaths

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agolib: add ability to register dependencies between northbound nodes
Igor Ryzhov [Tue, 16 Feb 2021 09:49:25 +0000 (12:49 +0300)]
lib: add ability to register dependencies between northbound nodes

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobgpd: Bgp peer group issue
sudhanshukumar22 [Wed, 27 Jan 2021 04:08:40 +0000 (20:08 -0800)]
bgpd: Bgp peer group issue

Description:
Holdtime and keepalive parameters weren't copied from
    peer-group to peer-group members.  Fixed the issue by copying holdtime
    and keepalive parameters from peer-group to its members.
Problem Description/Summary :
Holdtime and keepalive parameters weren't copied from
    peer-group to peer-group members.  Fixed the issue by copying holdtime
    and keepalive parameters from peer-group to its members.
Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
4 years agobgpd: upon bgp deletion, do not systematically ask to remove main bgp
Philippe Guibert [Wed, 4 Nov 2020 09:52:11 +0000 (09:52 +0000)]
bgpd: upon bgp deletion, do not systematically ask to remove main bgp

Dependencies between bgp instances is necessary only when it comes to
configure some specific services like ipv4-vpn, ipv6-vpn or l2vpn-evpn.
The list of config possibilities is listed, and an error is returned if
one of the above services is configured on the bgp vrf instance.

There may be some missingn services not covered. For clarification, here
are services configured on bgp vrf instances, while trying to delete
main bgp instance:
- if evpn main instance is the main bgp instance, and if evpn rt5
service is configured (with advertise command)
- if a vni is configured in the vrf instance
- if l3vpn import/export commands are solicitated for
importing/exporting entries from a vpnv4/6 network located on main bgp
instance. (in l3vpn, the main bgp instance is the location where vpnv4/6
sits).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agobgpd: Fix crash when we don't have a nexthop
Donald Sharp [Thu, 18 Feb 2021 11:55:29 +0000 (06:55 -0500)]
bgpd: Fix crash when we don't have a nexthop

Recent changes to allow bgpd to handle v6 LL slightly
differently in the nexthop tracking code has not
interacted well with the blackhole nexthop change
for peers.  Modify the code to do the right thing

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agofrr-reload: rpki context exiting uses exit and not end
Runar Borge [Fri, 22 Jan 2021 23:15:41 +0000 (00:15 +0100)]
frr-reload: rpki context exiting uses exit and not end

Issue:
The rpki subcontext uses exit instead of end to exit.
This makes issues with frr-reload in the way that frr-reload never exits
rpki context until it reaches the next end statement. this also happens when
parsing the configuration from vtysh.

Fixes: #7887
Signed-off-by: Runar Borge <runar@borge.nu>
4 years agobgpd: Blackhole nexthops are not reachable
Donald Sharp [Thu, 11 Feb 2021 14:54:34 +0000 (09:54 -0500)]
bgpd: Blackhole nexthops are not reachable

When bgp registers for a nexthop that is not reachable due
to the nexthop pointing to a blackhole, bgp is never going
to be able to reach it when attempting to open a connection.

Broken behavior:

<show bgp nexthop>
 192.168.161.204 valid [IGP metric 0], #paths 0, peer 192.168.161.204
  blackhole
  Last update: Thu Feb 11 09:46:10 2021

eva# show bgp ipv4 uni summ fail
BGP router identifier 10.10.3.11, local AS number 3235 vrf-id 0
BGP table version 40
RIB entries 78, using 14 KiB of memory
Peers 2, using 54 KiB of memory

Neighbor             EstdCnt DropCnt ResetTime Reason
192.168.161.204            0       0     never Waiting for peer OPEN

The log file fills up with this type of message:
2021-02-09T18:53:11.653433+00:00 nq-sjc6c-cor-01 bgpd[6548]: can't connect to 24.51.27.241 fd 26 : Invalid argument
2021-02-09T18:53:21.654005+00:00 nq-sjc6c-cor-01 bgpd[6548]: can't connect to 24.51.27.241 fd 26 : Invalid argument
2021-02-09T18:53:31.654381+00:00 nq-sjc6c-cor-01 bgpd[6548]: can't connect to 24.51.27.241 fd 26 : Invalid argument
2021-02-09T18:53:41.654729+00:00 nq-sjc6c-cor-01 bgpd[6548]: can't connect to 24.51.27.241 fd 26 : Invalid argument
2021-02-09T18:53:51.655147+00:00 nq-sjc6c-cor-01 bgpd[6548]: can't connect to 24.51.27.241 fd 26 : Invalid argument

As that the connect to a blackhole is correctly rejected by the kernel

Fixed behavior:

eva# show bgp ipv4 uni summ
BGP router identifier 10.10.3.11, local AS number 3235 vrf-id 0
BGP table version 40
RIB entries 78, using 14 KiB of memory
Peers 2, using 54 KiB of memory
Neighbor             V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
annie(192.168.161.2) 4      64539    126264        39        0    0    0 00:01:36           38       40 N/A
192.168.161.178      4          0         0         0        0    0    0    never       Active        0 N/A
Total number of neighbors 2
eva# show bgp ipv4 uni summ fail
BGP router identifier 10.10.3.11, local AS number 3235 vrf-id 0
BGP table version 40
RIB entries 78, using 14 KiB of memory
Peers 2, using 54 KiB of memory
Neighbor             EstdCnt DropCnt ResetTime Reason
192.168.161.178            0       0     never Waiting for NHT
Total number of neighbors 2
eva# show bgp nexthop
Current BGP nexthop cache:
 192.168.161.2 valid [IGP metric 0], #paths 38, peer 192.168.161.2
  if enp39s0
  Last update: Thu Feb 11 09:52:05 2021
 192.168.161.131 valid [IGP metric 0], #paths 0, peer 192.168.161.131
  if enp39s0
  Last update: Thu Feb 11 09:52:05 2021
 192.168.161.178 invalid, #paths 0, peer 192.168.161.178
  Must be Connected
  Last update: Thu Feb 11 09:53:37 2021
eva#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agostaticd: fix vrf enabling
Igor Ryzhov [Wed, 17 Feb 2021 12:06:20 +0000 (15:06 +0300)]
staticd: fix vrf enabling

When enabling the VRF, we should not install the nexthops that rely on
non-existent VRF.

For example, if we have route "1.1.1.0/24 2.2.2.2 vrf red nexthop-vrf blue",
and VRF red is enabled, we should not install it if VRF blue doesn't exist.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agostaticd: fix nexthop creation and installation
Igor Ryzhov [Wed, 17 Feb 2021 11:19:40 +0000 (14:19 +0300)]
staticd: fix nexthop creation and installation

Currently, staticd creates a VRF for the nexthop it is trying to install.
Later, when this nexthop is deleted, the VRF stays in the system and can
not be deleted by the user because "no vrf" command doesn't work for this
VRF because it was not created through northbound code.

There is no need to create the VRF. Just set nh_vrf_id to VRF_UNKNOWN
when the VRF doesn't exist.

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