]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
17 months agoMerge pull request #14887 from c-po/stable/7.5 stable/7.5
Donatas Abraitis [Tue, 28 Nov 2023 06:25:55 +0000 (08:25 +0200)]
Merge pull request #14887 from c-po/stable/7.5

bgpd: A couple more bgpd crash fixes for malformed packets (backport #14716)

17 months agobgpd: Treat EOR as withdrawn to avoid unwanted handling of malformed attrs 14887/head
Donatas Abraitis [Fri, 27 Oct 2023 08:56:45 +0000 (11:56 +0300)]
bgpd: Treat EOR as withdrawn to avoid unwanted handling of malformed attrs

Treat-as-withdraw, otherwise if we just ignore it, we will pass it to be
processed as a normal UPDATE without mandatory attributes, that could lead
to harmful behavior. In this case, a crash for route-maps with the configuration
such as:

```
router bgp 65001
 no bgp ebgp-requires-policy
 neighbor 127.0.0.1 remote-as external
 neighbor 127.0.0.1 passive
 neighbor 127.0.0.1 ebgp-multihop
 neighbor 127.0.0.1 disable-connected-check
 neighbor 127.0.0.1 update-source 127.0.0.2
 neighbor 127.0.0.1 timers 3 90
 neighbor 127.0.0.1 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 127.0.0.1 addpath-tx-all-paths
  neighbor 127.0.0.1 default-originate
  neighbor 127.0.0.1 route-map RM_IN in
 exit-address-family
exit
!
route-map RM_IN permit 10
 set as-path prepend 200
exit
```

Send a malformed optional transitive attribute:

```
import socket
import time

OPEN = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
b"\xff\xff\x00\x62\x01\x04\xfd\xea\x00\x5a\x0a\x00\x00\x01\x45\x02"
b"\x06\x01\x04\x00\x01\x00\x01\x02\x02\x02\x00\x02\x02\x46\x00\x02"
b"\x06\x41\x04\x00\x00\xfd\xea\x02\x02\x06\x00\x02\x06\x45\x04\x00"
b"\x01\x01\x03\x02\x0e\x49\x0c\x0a\x64\x6f\x6e\x61\x74\x61\x73\x2d"
b"\x70\x63\x00\x02\x04\x40\x02\x00\x78\x02\x09\x47\x07\x00\x01\x01"
b"\x80\x00\x00\x00")

KEEPALIVE = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
b"\xff\xff\xff\xff\xff\xff\x00\x13\x04")

UPDATE = bytearray.fromhex("ffffffffffffffffffffffffffffffff002b0200000003c0ff00010100eb00ac100b0b001ad908ac100b0b")

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.2', 179))
s.send(OPEN)
data = s.recv(1024)
s.send(KEEPALIVE)
data = s.recv(1024)
s.send(UPDATE)
data = s.recv(1024)
time.sleep(100)
s.close()
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Signed-off-by: Christian Breunig <christian@breunig.cc>
(cherry picked from commit 6814f2e0138a6ea5e1f83bdd9085d9a77999900b)

17 months agobgpd: Ignore handling NLRIs if we received MP_UNREACH_NLRI
Donatas Abraitis [Sun, 29 Oct 2023 20:44:45 +0000 (22:44 +0200)]
bgpd: Ignore handling NLRIs if we received MP_UNREACH_NLRI

If we receive MP_UNREACH_NLRI, we should stop handling remaining NLRIs if
no mandatory path attributes received.

In other words, if MP_UNREACH_NLRI received, the remaining NLRIs should be handled
as a new data, but without mandatory attributes, it's a malformed packet.

In normal case, this MUST not happen at all, but to avoid crashing bgpd, we MUST
handle that.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Signed-off-by: Christian Breunig <christian@breunig.cc>
(cherry picked from commit c37119df45bbf4ef713bc10475af2ee06e12f3bf)

19 months agoMerge pull request #14381 from c-po/stable/7.5
Donatas Abraitis [Sun, 10 Sep 2023 16:11:21 +0000 (19:11 +0300)]
Merge pull request #14381 from c-po/stable/7.5

bgpd: Use treat-as-withdraw for tunnel encapsulation attribute (backport for 7.5)

19 months agobgpd: Use treat-as-withdraw for tunnel encapsulation attribute 14381/head
Donatas Abraitis [Thu, 13 Jul 2023 19:32:03 +0000 (22:32 +0300)]
bgpd: Use treat-as-withdraw for tunnel encapsulation attribute

Before this path we used session reset method, which is discouraged by rfc7606.

Handle this as rfc requires.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Signed-off-by: Christian Breunig <christian@breunig.cc>
(cherry picked from commit bcb6b58d9530173df41d3a3cbc4c600ee0b4b186)

3 years agoMerge pull request #10005 from FRRouting/mergify/bp/stable/7.5/pr-9984
Igor Ryzhov [Mon, 8 Nov 2021 20:01:05 +0000 (23:01 +0300)]
Merge pull request #10005 from FRRouting/mergify/bp/stable/7.5/pr-9984

bgpd: Set afi by default to AFI_IP6 for `show bgp vrf/view all` (backport #9984)

3 years agobgpd: Set afi by default to AFI_IP6 for `show bgp vrf/view detail` 10005/head
Donatas Abraitis [Sat, 6 Nov 2021 13:54:20 +0000 (15:54 +0200)]
bgpd: Set afi by default to AFI_IP6 for `show bgp vrf/view detail`

AFI/SAFI is handled in bgp_vty_find_and_parse_afi_safi_bgp() properly for
IPv4, but not for IPv6. Let's have it enabled for IPv6 by default.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
(cherry picked from commit 458c1475abd2e6a81f59d1e1f83e0d564c101682)

3 years agobgpd: Set afi by default to AFI_IP6 for `show bgp vrf/view all`
Donatas Abraitis [Sat, 6 Nov 2021 13:50:56 +0000 (15:50 +0200)]
bgpd: Set afi by default to AFI_IP6 for `show bgp vrf/view all`

AFI/SAFI is handled in bgp_vty_find_and_parse_afi_safi_bgp() properly for
IPv4, but not for IPv6. Let's have it enabled for IPv6 by default.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
(cherry picked from commit 54d05dea572e923e45e38baec71cc602a3319669)

3 years agoMerge pull request #9991 from ton31337/fix/views_handle_7.5
Igor Ryzhov [Mon, 8 Nov 2021 14:41:39 +0000 (17:41 +0300)]
Merge pull request #9991 from ton31337/fix/views_handle_7.5

bgpd: [7.5] Do not randomly generate a vrf id for -Z

3 years agotests: Use vrf id 0 in bgp_multiview_topo1 tests 9991/head
Donatas Abraitis [Tue, 12 Nov 2019 14:41:50 +0000 (16:41 +0200)]
tests: Use vrf id 0 in bgp_multiview_topo1 tests

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9994 from FRRouting/mergify/bp/stable/7.5/pr-9954
Donald Sharp [Sun, 7 Nov 2021 16:01:07 +0000 (11:01 -0500)]
Merge pull request #9994 from FRRouting/mergify/bp/stable/7.5/pr-9954

zebra: Send up ifindex for redistribution when appropriate (backport #9954)

3 years agozebra: Send up ifindex for redistribution when appropriate 9994/head
Donald Sharp [Thu, 4 Nov 2021 12:01:14 +0000 (08:01 -0400)]
zebra: Send up ifindex for redistribution when appropriate

Currently the NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6 are
not sending up the resolved ifindex for the route.  This
is causing upper level protocols that have something like
this:

route-map FOO permit 10
  match interface swp13
!

router ospf
   redistribute static
!

ip route 4.5.6.7/32 10.10.10.10

where 10.10.10.10 resolves to interface swp13.  The route-map
will never match in this case.

Since FRR has the resolved nexthop interface, FRR might as
well send it up to be selected on by the upper level protocol
as needed.

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

3 years agobgpd: Do not randomly generate a vrf id for -Z
Donald Sharp [Thu, 2 Sep 2021 00:50:31 +0000 (20:50 -0400)]
bgpd: Do not randomly generate a vrf id for -Z

When FRR added the -Z parameter the bgp daemon was setting
a vrf identifier based upon a number starting at 1.  This
caused issues when we upgraded the code to the outgoing
sockets to use vrf_bind always.

FRR should never just randomly select a vrf identifier.
Let's just use VRF_DEFAULT when we are in a -Z environment.
It's a safe bet.

Fixes: #9519
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9428 from FRRouting/mergify/bp/stable/7.5/pr-9385
Martin Winter [Thu, 26 Aug 2021 10:56:00 +0000 (12:56 +0200)]
Merge pull request #9428 from FRRouting/mergify/bp/stable/7.5/pr-9385

bgpd: fix segfault when re-adding "match evpn default-route" rule (backport #9385)

3 years agobgpd: fix segfault when re-adding "match evpn default-route" rule 9428/head
Igor Ryzhov [Thu, 12 Aug 2021 16:07:53 +0000 (19:07 +0300)]
bgpd: fix segfault when re-adding "match evpn default-route" rule

When using "match evpn default-route" rule, match_arg is NULL and strcmp
is not happy with that. There's already a special function named rulecmp
that handles such situations.

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

3 years agoMerge pull request #9334 from FRRouting/mergify/bp/stable/7.5/pr-9214
Donald Sharp [Mon, 9 Aug 2021 11:47:52 +0000 (07:47 -0400)]
Merge pull request #9334 from FRRouting/mergify/bp/stable/7.5/pr-9214

zebra: bugfix of error quit of zebra, due to no nexthop ACTIVE (backport #9214)

3 years agozebra: bugfix of error quit of zebra, due to no nexthop ACTIVE 9334/head
batmancn [Mon, 30 Nov 2020 12:04:44 +0000 (20:04 +0800)]
zebra: bugfix of error quit of zebra, due to no nexthop ACTIVE

There exists some rare situations where fpm will attempt
to send a route update with no valid nexthops.  In that
case an assert would be hit.  This is not good for
trying to keep your routing daemons up and running
when we can safely just recover the situation.

Fixes #7588
Signed-off-by: batmancn <batmanustc@gmail.com>
<fixed commit message, and used zlog_err>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 5306e6cf00c58a4c4558609d623ecbbd79faabf1)

3 years agoMerge pull request #8988 from c-po/frr-7.5-bfdd-backport
Donatas Abraitis [Sat, 31 Jul 2021 17:17:35 +0000 (20:17 +0300)]
Merge pull request #8988 from c-po/frr-7.5-bfdd-backport

frr-reload: FRR 7.5 bfdd backport

3 years agoMerge pull request #9009 from ton31337/fix/handle_es-evi_7.5
Igor Ryzhov [Fri, 9 Jul 2021 10:14:03 +0000 (13:14 +0300)]
Merge pull request #9009 from ton31337/fix/handle_es-evi_7.5

zebra: [7.5] handle "show evpn es-evi" a non-existent VNI

3 years agozebra: handle "show evpn es-evi" a non-existent VNI 9009/head
Anuradha Karuppiah [Tue, 23 Jun 2020 00:01:06 +0000 (17:01 -0700)]
zebra: handle "show evpn es-evi" a non-existent VNI

zebra was crashing when the command was run on a non-existent VNI.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@torm-12:mgmt:~# net show evpn es-evi vni 16777215
VNI 16777215 doesn't exist
root@torm-12:mgmt:~# net show evpn es-evi vni 16777215 detail
VNI 16777215 doesn't exist
root@torm-12:mgmt:~# net show evpn es-evi vni 16777215 json
[
]
root@torm-12:mgmt:~# net show evpn es-evi vni 16777215 detail json
[
]
root@torm-12:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Ticket: CM-30232

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agotools: add bfdd to frr-reload.py daemons list 8988/head
Emanuele Di Pascale [Tue, 22 Dec 2020 17:20:14 +0000 (18:20 +0100)]
tools: add bfdd to frr-reload.py daemons list

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Signed-off-by: Christian Poessinger <christian@poessinger.com>
(cherry picked from commit ee96c52a2828335c698c27ee7f7374204a97d4cb)

3 years agoMerge pull request #8880 from FRRouting/mergify/bp/stable/7.5/pr-8876
Donald Sharp [Sat, 19 Jun 2021 16:16:05 +0000 (12:16 -0400)]
Merge pull request #8880 from FRRouting/mergify/bp/stable/7.5/pr-8876

lib: remove pure attribute from functions that modify memory (backport #8876)

3 years agoMerge pull request #8883 from FRRouting/mergify/bp/stable/7.5/pr-8874
Donald Sharp [Sat, 19 Jun 2021 16:14:47 +0000 (12:14 -0400)]
Merge pull request #8883 from FRRouting/mergify/bp/stable/7.5/pr-8874

ospfd: fix routemap update (backport #8874)

3 years agoospfd: fix routemap update 8883/head
Igor Ryzhov [Thu, 17 Jun 2021 16:31:03 +0000 (19:31 +0300)]
ospfd: fix routemap update

Currently, if the routemap already exists, we delete the pointer to it
when it is updated. We should delete the pointer only if the route-map
is actually deleted.

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

3 years agolib: remove pure attribute from functions that modify memory 8880/head
Igor Ryzhov [Fri, 18 Jun 2021 10:06:13 +0000 (13:06 +0300)]
lib: remove pure attribute from functions that modify memory

Almost all functions currently marked with pure attribute acquire a
route_node lock. By marking them pure we allow compiler to optimize the
code and not call them when it already knows the return value. This is
completely incorrect.

Only two of eleven functions can be marked as pure. And they still won't
be optimized because they are never called from the same function twice.
Let's remove the ext_pure macro completely to reduce the chance of
repeating this mistake in the future.

Fixes #8866, #8809, #8595, #6992.

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

3 years agoMerge pull request #8739 from dmbaturin/7.5-8695
Mark Stapp [Thu, 27 May 2021 15:41:54 +0000 (11:41 -0400)]
Merge pull request #8739 from dmbaturin/7.5-8695

Backport the fix for #8695 to 7.5

3 years agoMerge pull request #8742 from taspelund/fix_pfx-tree_default_7.5
Rafael Zalamena [Thu, 27 May 2021 00:55:53 +0000 (21:55 -0300)]
Merge pull request #8742 from taspelund/fix_pfx-tree_default_7.5

[7.5] lib: fix handling of rmap prefix-tree default node

3 years agolib: fix handling of rmap prefix-tree default node 8742/head
Trey Aspelund [Fri, 21 May 2021 22:04:15 +0000 (22:04 +0000)]
lib: fix handling of rmap prefix-tree default node

Prior to this commit, updating a prefix-list that is referenced by a
route-map clause will unconditionally delete the root node of that
route-map's prefix-tree (used with route-map optimization).
This is problematic because routes not matching a more specific node
in the tree (i.e. other prefix-list sequences) will not fall-back to
the default node, thus they will not hit any route-map sequences.
This commit ensures that an update to a prefix-list will only delete
the default node while adding the first/only seq to the list.

Example config:
========
ip prefix-list peer475-out-pfxlist seq 45 permit 2.138.0.0/16
ip prefix-list peer475-out-pfxlist seq 50 permit 0.0.0.0/0
!
route-map peer475-out permit 5
 match ip address prefix-list peer475-out-pfxlist

Before:
========
ub20# do show route-map peer475-out prefix-table
ZEBRA:

IPv4 Prefix                                           Route-map Index List
_______________                                       ____________________
    0.0.0.0/0 (2)
(P)
                                                      peer475-out seq 5

    2.138.0.0/16 (2)
(P) 0.0.0.0/0

                                                      peer475-out seq 5
IPv6 Prefix                                           Route-map Index List
_______________                                       ____________________
BGP:
IPv4 Prefix                                           Route-map Index List
_______________                                       ____________________
    0.0.0.0/0 (2)
(P)
                                                      peer475-out seq 5
    2.138.0.0/16 (2)
(P) 0.0.0.0/0
                                                      peer475-out seq 5
IPv6 Prefix                                           Route-map Index List
_______________                                       ____________________
ub20# conf t
ub20(config)# ip prefix-list peer475-out-pfxlist seq 45 permit 2.138.0.0/16 le 32
ub20(config)# do show route-map peer475-out prefix-table
ZEBRA:
IPv4 Prefix                                           Route-map Index List
_______________                                       ____________________
    2.138.0.0/16 (2)
(P)
                                                      peer475-out seq 5
IPv6 Prefix                                           Route-map Index List
_______________                                       ____________________
BGP:
IPv4 Prefix                                           Route-map Index List
_______________                                       ____________________
    2.138.0.0/16 (2)
(P)
                                                      peer475-out seq 5
IPv6 Prefix                                           Route-map Index List
_______________                                       ____________________
ub20(config)#

After:
========
ub20(config)# do show route-map peer475-out prefix-table
ZEBRA:

IPv4 Prefix                                           Route-map Index List
_______________                                       ____________________
    0.0.0.0/0 (2)
(P)
                                                      peer475-out seq 5

    2.138.0.0/16 (2)
(P) 0.0.0.0/0

                                                      peer475-out seq 5

IPv6 Prefix                                           Route-map Index List
_______________                                       ____________________

BGP:

IPv4 Prefix                                           Route-map Index List
_______________                                       ____________________
    0.0.0.0/0 (2)
(P)
                                                      peer475-out seq 5

    2.138.0.0/16 (2)
(P) 0.0.0.0/0

                                                      peer475-out seq 5

IPv6 Prefix                                           Route-map Index List
_______________                                       ____________________

ub20(config)# ip prefix-list peer475-out-pfxlist seq 45 permit 2.138.0.0/16 le 32
ub20(config)# do show route-map peer475-out prefix-table
ZEBRA:

IPv4 Prefix                                           Route-map Index List
_______________                                       ____________________
    0.0.0.0/0 (2)
(P)
                                                      peer475-out seq 5

    2.138.0.0/16 (2)
(P) 0.0.0.0/0

                                                      peer475-out seq 5

IPv6 Prefix                                           Route-map Index List
_______________                                       ____________________

BGP:

IPv4 Prefix                                           Route-map Index List
_______________                                       ____________________
    0.0.0.0/0 (2)
(P)
                                                      peer475-out seq 5

    2.138.0.0/16 (2)
(P) 0.0.0.0/0

                                                      peer475-out seq 5

IPv6 Prefix                                           Route-map Index List
_______________                                       ____________________

ub20(config)#

Fixes: 8410
Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
(cherry picked from commit 4718791c8f7101379f99fa7174e8ccaf80573433)

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