]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agopim: Use INADDR_ANY for current_bsr checking is valid yet
Donald Sharp [Fri, 4 Feb 2022 13:49:39 +0000 (08:49 -0500)]
pim: Use INADDR_ANY for current_bsr checking is valid yet

In all places that pim_nht_bsr_del is called, the code
needs to not unregister if the current_bsr is INADDR_ANY.

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

2 years agopimd: Only remove bsr NHT if we actually have tracked something
Donald Sharp [Fri, 28 Jan 2022 16:17:53 +0000 (11:17 -0500)]
pimd: Only remove bsr NHT if we actually have tracked something

I'm now seeing in my log file:

2022/01/28 11:20:05 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0
2022/01/28 11:20:05 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0
2022/01/28 11:20:06 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0

When I run pimd.  Looking at the code there are 3 places where pim_bsm.c removes the
NHT BSR tracking.  In 2 of them the code ensures that the address is already setup
in 1 place it is not.  Fix.

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

2 years agoMerge pull request #10512 from FRRouting/mergify/bp/dev/8.2/pr-10510
Jafar Al-Gharaibeh [Mon, 7 Feb 2022 17:08:11 +0000 (11:08 -0600)]
Merge pull request #10512 from FRRouting/mergify/bp/dev/8.2/pr-10510

bgpd: Flush temporary attributes after route-map apply (backport #10510)

2 years agobgpd: Print route-map name for filtred outgoing prefixes
Donatas Abraitis [Mon, 7 Feb 2022 10:04:10 +0000 (12:04 +0200)]
bgpd: Print route-map name for filtred outgoing prefixes

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

2 years agobgpd: Flush temporary attributes after route-map apply
Donatas Abraitis [Mon, 7 Feb 2022 08:50:33 +0000 (10:50 +0200)]
bgpd: Flush temporary attributes after route-map apply

Fixes crash:

```
Received signal 6 at 1644222173 (si_addr 0x6f000012d2, PC 0x7f79274cbfb7); aborting...
/usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(zlog_backtrace_sigsafe+0x6d) [0x7f79282e079d]
/usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(zlog_signal+0xf3) [0x7f79282e0993]
/usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(+0xbd881) [0x7f792830b881]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980) [0x7f7927890980]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7) [0x7f79274cbfb7]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141) [0x7f79274cd921]
/lib/x86_64-linux-gnu/libc.so.6(+0x89967) [0x7f7927516967]
/lib/x86_64-linux-gnu/libc.so.6(+0x909da) [0x7f792751d9da]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x620) [0x7f7927525050]
/usr/lib/frr/bgpd(+0x1e7c1c) [0x55b5c53b1c1c]
/usr/lib/frr/bgpd(aspath_free+0x28) [0x55b5c53b1c78]
/usr/lib/frr/bgpd(bgp_attr_flush+0x245) [0x55b5c52abc15]
/usr/lib/frr/bgpd(subgroup_announce_check+0x1137) [0x55b5c530c5d7]
```

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

2 years agoMerge pull request #10508 from FRRouting/mergify/bp/dev/8.2/pr-10432
Donatas Abraitis [Mon, 7 Feb 2022 06:05:11 +0000 (08:05 +0200)]
Merge pull request #10508 from FRRouting/mergify/bp/dev/8.2/pr-10432

pbrd: pbr route maps get addr family of nhgs (backport #10432)

2 years agopbrd: pbr route maps get addr family of nhgs
Stephen Worley [Thu, 27 Jan 2022 17:41:49 +0000 (12:41 -0500)]
pbrd: pbr route maps get addr family of nhgs

When adding a nhg to a route map, make sure to specify the `family`
of the rm by looking at the contents of the nhg. Installation in the
kernel (for DSCP rules in particular) relies on this being specified in
the netlink message.

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
Signed-off-by: Stephen Worley <sworley@nvidia.com>
(cherry picked from commit 9a7ea213c072a24aa2059e04cb51502a3e956705)

2 years agoMerge pull request #10497 from FRRouting/mergify/bp/dev/8.2/pr-10473
Donatas Abraitis [Fri, 4 Feb 2022 15:39:54 +0000 (17:39 +0200)]
Merge pull request #10497 from FRRouting/mergify/bp/dev/8.2/pr-10473

ospfd: Core in ospf_if_down during shutdown. (backport #10473)

2 years agoospfd: Core in ospf_if_down during shutdown.
Tomi Salminen [Wed, 2 Feb 2022 09:19:09 +0000 (11:19 +0200)]
ospfd: Core in ospf_if_down during shutdown.

Skip marking routes as changed in ospf_if_down if there's now
new_table present, which might be the case when the instance is
being finished

The backtrace for the core was:

  raise (sig=sig@entry=11) at ../sysdeps/unix/sysv/linux/raise.c:50
  core_handler (signo=11, siginfo=0x7fffffffe170, context=<optimized out>) at lib/sigevent.c:262
  <signal handler called>
  route_top (table=0x0) at lib/table.c:401
  ospf_if_down (oi=oi@entry=0x555555999090) at ospfd/ospf_interface.c:849
  ospf_if_free (oi=0x555555999090) at ospfd/ospf_interface.c:339
  ospf_finish_final (ospf=0x55555599c830) at ospfd/ospfd.c:749
  ospf_deferred_shutdown_finish (ospf=0x55555599c830) at ospfd/ospfd.c:578
  ospf_deferred_shutdown_check (ospf=<optimized out>) at ospfd/ospfd.c:627
  ospf_finish (ospf=<optimized out>) at ospfd/ospfd.c:683
  ospf_terminate () at ospfd/ospfd.c:653
  sigint () at ospfd/ospf_main.c:109
  quagga_sigevent_process () at lib/sigevent.c:130
  thread_fetch (m=m@entry=0x5555556e45e0, fetch=fetch@entry=0x7fffffffe9b0) at lib/thread.c:1709
  frr_run (master=0x5555556e45e0) at lib/libfrr.c:1174
  main (argc=9, argv=0x7fffffffecb8) at ospfd/ospf_main.c:254

Signed-off-by: Tomi Salminen <tsalminen@forcepoint.com>
(cherry picked from commit d4e66f14854d1cc5bdb8b8209613fd596f8c1775)

2 years agoMerge pull request #10488 from FRRouting/mergify/bp/dev/8.2/pr-10485
Donatas Abraitis [Thu, 3 Feb 2022 08:05:17 +0000 (10:05 +0200)]
Merge pull request #10488 from FRRouting/mergify/bp/dev/8.2/pr-10485

bgpd: strncmp -> strcmp in community hash foo (backport #10485)

2 years agobgpd: strncmp -> strcmp in community hash foo
Quentin Young [Wed, 2 Feb 2022 21:34:03 +0000 (16:34 -0500)]
bgpd: strncmp -> strcmp in community hash foo

buffers are null terminated

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
(cherry picked from commit c975f1a5e405f7a74d45519862388cd9ea8ce782)

2 years agoMerge pull request #10463 from idryzhov/bgp-memcmp
Jafar Al-Gharaibeh [Wed, 2 Feb 2022 18:38:54 +0000 (12:38 -0600)]
Merge pull request #10463 from idryzhov/bgp-memcmp

[8.2] bgpd: Fixing memcmp to avoid coverity issue

2 years agoMerge pull request #10476 from FRRouting/mergify/bp/dev/8.2/pr-10409
Mark Stapp [Wed, 2 Feb 2022 17:53:07 +0000 (12:53 -0500)]
Merge pull request #10476 from FRRouting/mergify/bp/dev/8.2/pr-10409

zebra: fix cleanup of meta queues on vrf disable (backport #10409)

2 years agozebra: fix cleanup of meta queues on vrf disable
Igor Ryzhov [Sun, 23 Jan 2022 17:22:42 +0000 (20:22 +0300)]
zebra: fix cleanup of meta queues on vrf disable

Current code treats all metaqueues as lists of route_node structures.
However, some queues contain other structures that need to be cleaned up
differently. Casting the elements of those queues to struct route_node
and dereferencing them leads to a crash. The crash may be seen when
executing bgp_multi_vrf_topo2.

Fix the code by using the proper list element types.

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

2 years agoMerge pull request #10466 from idryzhov/8.2-ospf-aggr-timer
Donatas Abraitis [Tue, 1 Feb 2022 19:26:11 +0000 (21:26 +0200)]
Merge pull request #10466 from idryzhov/8.2-ospf-aggr-timer

[8.2] ospfd: fix missing "aggregation timer" in running configuration

2 years agoospfd: fix missing "aggregation timer" in running configuration
anlan_cs [Wed, 19 Jan 2022 13:42:02 +0000 (08:42 -0500)]
ospfd: fix missing "aggregation timer" in running configuration

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agobgpd: Fixing memcmp to avoid coverity issue
Iqra Siddiqui [Tue, 18 Jan 2022 08:36:13 +0000 (00:36 -0800)]
bgpd: Fixing memcmp to avoid coverity issue

Description:
Replacing memcmp at certain places,
to avoid the coverity issues caused by it.

Co-authored-by: Kantesh Mundargi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2 years agoMerge pull request #10451 from donaldsharp/route_tag_ntohl
Igor Ryzhov [Mon, 31 Jan 2022 19:50:48 +0000 (22:50 +0300)]
Merge pull request #10451 from donaldsharp/route_tag_ntohl

ospfd: Convert output to host order from network order for route_tag

2 years agoMerge pull request #10448 from ton31337/fix/zebra_ospf6d_json_leak
Donald Sharp [Mon, 31 Jan 2022 17:58:19 +0000 (12:58 -0500)]
Merge pull request #10448 from ton31337/fix/zebra_ospf6d_json_leak

ospf6d: Fix memory leak for `show ipv6 ospf6 zebra json`

2 years agoospfd: Convert output to host order from network order for route_tag
Donald Sharp [Mon, 31 Jan 2022 17:49:55 +0000 (12:49 -0500)]
ospfd: Convert output to host order from network order for route_tag

FRR stores the route_tag in network byte order.  Bug filed indicates
that the `show ip ospf route` command shows the correct value.
Every place route_tag is dumped in ospf_vty.c the ntohl function
is used first.

Fixes: #10450
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospf6d: Fix memory leak for `show ipv6 ospf6 zebra json`
Donatas Abraitis [Mon, 31 Jan 2022 13:56:56 +0000 (15:56 +0200)]
ospf6d: Fix memory leak for `show ipv6 ospf6 zebra json`

$ for x in $(seq 1 10000); do vtysh -c 'show ipv6 ospf6 zebra json' >/dev/null; done

Before:
```
$ vtysh -c 'show memory ospf6d' | grep 'Total heap allocated'
  Total heap allocated:  26 MiB
```

After:
```
$ vtysh -c 'show memory ospf6d' | grep 'Total heap allocated'
  Total heap allocated:  2256 KiB
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #9869 from leonshaw/fix/evpn-queue
Mark Stapp [Fri, 28 Jan 2022 16:58:43 +0000 (11:58 -0500)]
Merge pull request #9869 from leonshaw/fix/evpn-queue

zebra: Fix EVPN route nexthop config order

2 years agoMerge pull request #10357 from ton31337/fix/peer_address_self_check_relax
Russ White [Fri, 28 Jan 2022 16:12:45 +0000 (11:12 -0500)]
Merge pull request #10357 from ton31337/fix/peer_address_self_check_relax

bgpd: Relax peer to be on the same host

2 years agozebra: Fix EVPN route nexthop config order
Xiao Liang [Fri, 22 Oct 2021 07:45:33 +0000 (15:45 +0800)]
zebra: Fix EVPN route nexthop config order

EVPN route add should be queued to preserve the config order.
In particular, against deletion in rib_delete().

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2 years agoMerge pull request #10408 from idryzhov/no-opaque-by-default
Donatas Abraitis [Fri, 28 Jan 2022 10:54:16 +0000 (12:54 +0200)]
Merge pull request #10408 from idryzhov/no-opaque-by-default

*: do not send opaque data to zebra by default

2 years agoMerge pull request #10159 from taspelund/retain-peer-asn
Donatas Abraitis [Fri, 28 Jan 2022 07:22:06 +0000 (09:22 +0200)]
Merge pull request #10159 from taspelund/retain-peer-asn

bgpd: retain peer asn even with remove-private-AS

2 years agoMerge pull request #10389 from gromit1811/bugfix_9720_ecmp_inter_area
Donatas Abraitis [Fri, 28 Jan 2022 07:09:51 +0000 (09:09 +0200)]
Merge pull request #10389 from gromit1811/bugfix_9720_ecmp_inter_area

ospf6d: Fix ECMP inter-area route nexthop update

2 years agoMerge pull request #10420 from donaldsharp/zebra_multicast_vrf_cleanup
Donatas Abraitis [Fri, 28 Jan 2022 06:55:12 +0000 (08:55 +0200)]
Merge pull request #10420 from donaldsharp/zebra_multicast_vrf_cleanup

zebra: Actually delete the table we are looking for

2 years agoMerge pull request #10433 from idryzhov/vrrp-ip-addr-is-zero
Quentin Young [Thu, 27 Jan 2022 21:08:15 +0000 (16:08 -0500)]
Merge pull request #10433 from idryzhov/vrrp-ip-addr-is-zero

2 years agoMerge pull request #10434 from idryzhov/isis-attached-bit
Mark Stapp [Thu, 27 Jan 2022 20:54:59 +0000 (15:54 -0500)]
Merge pull request #10434 from idryzhov/isis-attached-bit

isisd: remove deprecated command

2 years agoisisd: remove deprecated command
Igor Ryzhov [Thu, 27 Jan 2022 18:12:22 +0000 (21:12 +0300)]
isisd: remove deprecated command

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agovrrpd: use ipaddr_is_zero when needed
Igor Ryzhov [Thu, 27 Jan 2022 18:05:40 +0000 (21:05 +0300)]
vrrpd: use ipaddr_is_zero when needed

Replace custom implementation or call to ipaddr_isset with a call to
ipaddr_is_zero.

ipaddr_isset is not fully correct, because it's fine to have some
non-zero bytes at the end of the struct in case of IPv4 and the function
doesn't allow that.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9880 from louis-oui/maximum-prefix-out
Donatas Abraitis [Thu, 27 Jan 2022 06:49:31 +0000 (08:49 +0200)]
Merge pull request #9880 from louis-oui/maximum-prefix-out

bgpd: fixes maximum prefix out

2 years agotopotests: set bgp peer-group with maximum-prefix-out
Louis Scalbert [Mon, 25 Oct 2021 11:25:35 +0000 (13:25 +0200)]
topotests: set bgp peer-group with maximum-prefix-out

Set different combinations of bgp peer-group with a maximum-prefix-out
value.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agobgpd: fix peer-group with maximum-prefix-out
Louis Scalbert [Mon, 25 Oct 2021 11:25:19 +0000 (13:25 +0200)]
bgpd: fix peer-group with maximum-prefix-out

When setting maximum-prefix-out on peer-group, the applied value on
member is 0.

Fix usage of maximum-prefix-out on peer-group.

The peer_maximum_prefix_out_(un)set functions are derived from
peer_maximum_prefix_(un)set.

Fixes: fde246e8353a ("bgpd: Add an option to limit outgoing prefixes")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agotopotests: bgp no neighbor X.X.X.X maximum-prefix-out Y
Louis Scalbert [Mon, 25 Oct 2021 11:24:09 +0000 (13:24 +0200)]
topotests: bgp no neighbor X.X.X.X maximum-prefix-out Y

Test the ability to use the following configure command with a Y value:

no neighbor X.X.X.X maximum-prefix-out Y

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agobgpd: allow no neighbor X.X.X.X maximum-prefix-out [(1-4294967295)]
Louis Scalbert [Mon, 25 Oct 2021 11:23:38 +0000 (13:23 +0200)]
bgpd: allow no neighbor X.X.X.X maximum-prefix-out [(1-4294967295)]

Specifying a number is not possible with command no neighbor X.X.X.X
maximum-prefix-out

> frr(config-router-af)# no neighbor 192.168.1.2 maximum-prefix-out 1
> % Unknown command: no neighbor 192.168.1.2 maximum-prefix-out 1

This patch allows it.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agoMerge pull request #10425 from ckishimo/ospf6d_nssa
Donald Sharp [Wed, 26 Jan 2022 14:56:34 +0000 (09:56 -0500)]
Merge pull request #10425 from ckishimo/ospf6d_nssa

ospf6d: show if area is NSSA

2 years agozebra: Don't double delete the table we are cleaning up
Donald Sharp [Mon, 24 Jan 2022 20:37:54 +0000 (15:37 -0500)]
zebra: Don't double delete the table we are cleaning up

vrf_disable is always called first before
vrf_delete.  The rnh_table and rnh_table_multicast tables
are already deleted as part of vrf_disable.  No need
to do it again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospf6d: show if area is NSSA
ckishimo [Tue, 25 Jan 2022 17:49:27 +0000 (18:49 +0100)]
ospf6d: show if area is NSSA

This PR will include if the area is NSSA in the output of "show ipv6 ospf"

    r2# show ipv6 ospf
     ...
     Area 0.0.0.0
         Number of Area scoped LSAs is 8
         Interface attached to this area: r2-eth1
         SPF last executed 20.46717s ago
     Area 0.0.0.1[Stub]
         Number of Area scoped LSAs is 9
         Interface attached to this area: r2-eth0
         SPF last executed 20.46911s ago
     Area 0.0.0.2[NSSA]
         Number of Area scoped LSAs is 14
         Interface attached to this area: r2-eth2
         SPF last executed 20.46801s ago

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: fix indentation in show ipv6 ospf area
ckishimo [Tue, 25 Jan 2022 17:47:47 +0000 (18:47 +0100)]
ospf6d: fix indentation in show ipv6 ospf area

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoMerge pull request #10410 from idryzhov/pim-memleaks
Quentin Young [Tue, 25 Jan 2022 16:41:09 +0000 (11:41 -0500)]
Merge pull request #10410 from idryzhov/pim-memleaks

2 years agoMerge pull request #10411 from idryzhov/if-config-vrf-name
Russ White [Tue, 25 Jan 2022 16:34:59 +0000 (11:34 -0500)]
Merge pull request #10411 from idryzhov/if-config-vrf-name

*: do not print vrf name for interface config when using vrf-lite

2 years agoMerge pull request #10395 from qlyoung/fix-pim-xpath-buffer-sizes
David Lamparter [Tue, 25 Jan 2022 16:22:39 +0000 (17:22 +0100)]
Merge pull request #10395 from qlyoung/fix-pim-xpath-buffer-sizes

2 years agoMerge pull request #10419 from qlyoung/fix-logrotate-staticd-typo
Igor Ryzhov [Tue, 25 Jan 2022 13:58:12 +0000 (16:58 +0300)]
Merge pull request #10419 from qlyoung/fix-logrotate-staticd-typo

redhat: logrotate file has typo for staticd

2 years agotests: add topotest for remove-private-AS
Trey Aspelund [Thu, 20 Jan 2022 22:40:13 +0000 (22:40 +0000)]
tests: add topotest for remove-private-AS

Introduces a topotest to validate proper AS-Path manipulation when using
"neighbor ... remove-private-AS".

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2 years agobgpd: retain peer asn even with remove-private-AS
Trey Aspelund [Tue, 16 Nov 2021 21:11:26 +0000 (21:11 +0000)]
bgpd: retain peer asn even with remove-private-AS

In situations where remove-private-AS is configured for eBGP peers
residing in a private ASN, the peer's ASN was not being retained
in the AS-Path which can allow loops to occur. This was addressed
in a prior commit but it only addressed cases where the "replace-AS"
keyword was configured.
This commit ensures we retain the peer's ASN when using
"remove-private-AS" for eBGP peers in a private ASN regardless of other
keywords.

Setup:
=========
router bgp 4200000002
 neighbor enp1s0 interface v6only remote-as external
 neighbor enp6s0 interface v6only remote-as external
 !
 address-family ipv4 unicast
  neighbor enp6s0 remove-private-AS
 exit-address-family

ub18# show ip bgp sum | include 420000
BGP router identifier 100.64.0.111, local AS number 4200000002 vrf-id 0    <<<<< local asn 4200000002
ub20(enp1s0)    4 4200000001        22        22        0    0    0 00:00:57            1        1
ub20(enp6s0)    4 4200000001        21        22        0    0    0 00:00:57            0        1   <<<< peer asn 4200000001

ub18# show ip bgp | include 0.2
Default local pref 100, local AS 4200000002
*> 100.64.0.2/32    enp1s0                   0             0 4200000001 4200000004 4200000005 4200000001 i

Before ("remote-private-AS" only):
=========
ub18# show ip bgp neighbors enp6s0 advertised-routes | include 100.64.0.2
*> 100.64.0.2/32    ::                                     0 i     <<<<<  empty as-path, no way to prevent loop

After ("remote-private-AS" only):
=========
ub18# show ip bgp neighbors enp6s0 advertised-routes | include 100.64.0.2
*> 100.64.0.2/32    ::                                     0 4200000001 4200000001 i    <<<< retain peer's asn, breaks loop

Ticket: 2857047
Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2 years agoredhat: logrotate file has typo for staticd
Quentin Young [Mon, 24 Jan 2022 20:05:48 +0000 (15:05 -0500)]
redhat: logrotate file has typo for staticd

s/static/staticd

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years ago*: do not send opaque data to zebra by default
Igor Ryzhov [Sun, 23 Jan 2022 13:08:46 +0000 (16:08 +0300)]
*: do not send opaque data to zebra by default

Opaque data takes up a lot of memory when there are a lot of routes on
the box. Given that this is just a cosmetic info, I propose to disable
it by default to not shock people who start using FRR for the first time
or upgrades from an old version.

Fixes #10101.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agopimd: fix interface info memory leak
Igor Ryzhov [Sun, 23 Jan 2022 21:17:48 +0000 (00:17 +0300)]
pimd: fix interface info memory leak

When the interface is deleted from the system, its info must be freed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agopimd: move iface lib initialization to a proper place
Igor Ryzhov [Sun, 23 Jan 2022 21:16:59 +0000 (00:16 +0300)]
pimd: move iface lib initialization to a proper place

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agopimd: fix misuse of xpath buf size constants
Quentin Young [Thu, 20 Jan 2022 22:24:30 +0000 (17:24 -0500)]
pimd: fix misuse of xpath buf size constants

XPATH_MAXLEN denotes the maximum length of an XPATH. It does not make
sense to allocate a buffer intended to contain an XPATH with a size
larger than the maximum allowable size of an XPATH. Consequently this PR
removes buffers that do this. Prints into these buffers are now checked
for overflow.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agoMerge pull request #10374 from opensourcerouting/bgp-reset-counters
Russ White [Mon, 24 Jan 2022 12:52:11 +0000 (07:52 -0500)]
Merge pull request #10374 from opensourcerouting/bgp-reset-counters

bgpd: Reset message statistics with clear command

2 years agoMerge pull request #10380 from ton31337/feature/show_graceful_restart_timer_per_prefix
Russ White [Mon, 24 Jan 2022 12:51:19 +0000 (07:51 -0500)]
Merge pull request #10380 from ton31337/feature/show_graceful_restart_timer_per_prefix

bgpd: Show Graceful Restart seconds remaining per prefix

2 years agoMerge pull request #10381 from idryzhov/drop-gw-addr
Russ White [Mon, 24 Jan 2022 12:50:20 +0000 (07:50 -0500)]
Merge pull request #10381 from idryzhov/drop-gw-addr

BGP EVPN overlay index fixes and improvements

2 years agoMerge pull request #10402 from ton31337/fix/capability_extended-nexthop_cli_hidden
Russ White [Mon, 24 Jan 2022 12:35:21 +0000 (07:35 -0500)]
Merge pull request #10402 from ton31337/fix/capability_extended-nexthop_cli_hidden

bgpd: Show negative form of capability extended-nexthop for interface…

2 years agoMerge pull request #10407 from idryzhov/ospf-opaque-crash
Russ White [Mon, 24 Jan 2022 12:34:30 +0000 (07:34 -0500)]
Merge pull request #10407 from idryzhov/ospf-opaque-crash

ospfd: fix crash on "ospf send-extra-data zebra"

2 years agoMerge pull request #10412 from idryzhov/zebra-vrf-delete
Russ White [Mon, 24 Jan 2022 12:33:53 +0000 (07:33 -0500)]
Merge pull request #10412 from idryzhov/zebra-vrf-delete

zebra: fix vrf deletion

2 years ago*: do not print vrf name for interface config when using vrf-lite
Igor Ryzhov [Sun, 23 Jan 2022 21:07:20 +0000 (00:07 +0300)]
*: do not print vrf name for interface config when using vrf-lite

VRF name should not be printed in the config since 574445ec. The update
was done for NB config output but I missed it for regular vty output.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #10406 from idryzhov/zebra-opaque-memleak
Donatas Abraitis [Mon, 24 Jan 2022 07:38:54 +0000 (09:38 +0200)]
Merge pull request #10406 from idryzhov/zebra-opaque-memleak

zebra: fix opaque data memleak

2 years agoMerge pull request #10318 from donaldsharp/redistribution
Russ White [Mon, 24 Jan 2022 03:30:24 +0000 (22:30 -0500)]
Merge pull request #10318 from donaldsharp/redistribution

OSPF Redistribution

2 years agoMerge pull request #10352 from ton31337/fix/autocomplete_neighbor_peergroup
Russ White [Mon, 24 Jan 2022 03:29:44 +0000 (22:29 -0500)]
Merge pull request #10352 from ton31337/fix/autocomplete_neighbor_peergroup

bgpd: Add peer-groups to neighbor autocomplete

2 years agoMerge pull request #10348 from ton31337/fix/gr_dynamic_neighbors2
Russ White [Mon, 24 Jan 2022 03:28:34 +0000 (22:28 -0500)]
Merge pull request #10348 from ton31337/fix/gr_dynamic_neighbors2

bgpd: Graceful-restart / LLGR with dynamic peers

2 years agozebra: fix vrf deletion
Igor Ryzhov [Sun, 23 Jan 2022 22:51:10 +0000 (01:51 +0300)]
zebra: fix vrf deletion

VRF deletion code must be called after the corresponding interface
deletion code.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoospfd: fix crash on "ospf send-extra-data zebra"
Igor Ryzhov [Sun, 23 Jan 2022 13:10:55 +0000 (16:10 +0300)]
ospfd: fix crash on "ospf send-extra-data zebra"

`ospf->new_table` is NULL if the OSPF instance has no routes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agozebra: fix opaque data memleak
Igor Ryzhov [Sun, 23 Jan 2022 12:39:04 +0000 (15:39 +0300)]
zebra: fix opaque data memleak

Opaque data should be freed together with route entry in case of errors.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agobgpd: Show negative form of capability extended-nexthop for interface peers
Donatas Abraitis [Fri, 21 Jan 2022 21:31:58 +0000 (23:31 +0200)]
bgpd: Show negative form of capability extended-nexthop for interface peers

```
exit1-debian-11(config-router)# neighbor 192.168.100.3 remote-as external
exit1-debian-11(config-router)# do sh run | include extended
exit1-debian-11(config-router)# neighbor 192.168.100.3 capability extended-nexthop
exit1-debian-11(config-router)# do sh run | include extended
 neighbor 192.168.100.3 capability extended-nexthop
exit1-debian-11(config-router)# no neighbor 192.168.100.3 capability extended-nexthop
exit1-debian-11(config-router)# do sh run | include extended
exit1-debian-11(config-router)# neighbor eth0 interface remote-as external
exit1-debian-11(config-router)# do sh run | include extended
exit1-debian-11(config-router)# neighbor eth0 capability extended-nexthop
exit1-debian-11(config-router)# do sh run | include extended
exit1-debian-11(config-router)# no neighbor eth0 capability extended-nexthop
exit1-debian-11(config-router)# do sh run | include extended
 no neighbor eth0 capability extended-nexthop
exit1-debian-11(config-router)#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10398 from patrasar/pim_debug_fix
Quentin Young [Fri, 21 Jan 2022 19:08:48 +0000 (14:08 -0500)]
Merge pull request #10398 from patrasar/pim_debug_fix

2 years agoMerge pull request #8011 from donaldsharp/starvation
Jafar Al-Gharaibeh [Fri, 21 Jan 2022 15:01:42 +0000 (09:01 -0600)]
Merge pull request #8011 from donaldsharp/starvation

lib: Figure out if we are being starved for cpu

2 years agopimd: debug pim fixes
sarita patra [Fri, 21 Jan 2022 11:02:16 +0000 (03:02 -0800)]
pimd: debug pim fixes

Enable debug commands "debug pim packetdump send" and
"debug pim packetdump receive" in config mode.

Display "debug pim nht rp" in show running config.

Signed-off-by: sarita patra <saritap@vmware.com>
2 years agoMerge pull request #10392 from pguibert6WIND/isis_vrf_change
Igor Ryzhov [Thu, 20 Jan 2022 17:47:33 +0000 (20:47 +0300)]
Merge pull request #10392 from pguibert6WIND/isis_vrf_change

2 years agotopotests: apply bgp maximum-prefix-out without clearing the neighbor
Louis Scalbert [Thu, 21 Oct 2021 14:54:23 +0000 (16:54 +0200)]
topotests: apply bgp maximum-prefix-out without clearing the neighbor

The current maximum-prefix-out topo-test starts a configuration with a
maximum-prefix-out.

Test the application of new maximum-prefix-out value without clearing
the neighbor.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agobgpd: apply maximum-prefix-out without clearing the neighbor
Louis Scalbert [Wed, 20 Oct 2021 14:26:30 +0000 (16:26 +0200)]
bgpd: apply maximum-prefix-out without clearing the neighbor

Abstract:
- The command "neighbor PEER maximum-prefix-out NUMBER" cannot be applied
  without clearing the BGP neighbor.
- Apply the maximum-prefix-out value as soon as it is modified without
  clearing the neighbor.

subgroup_update_packet() and subgroup_withdraw_packet() respectively
manages the announcement and withdrawal BGP message to the peer.
subgrp->scount counter counts the number of sent prefixes.

Before the patch, the maximum out prefix limitation was applied in
subgroup_update_packet() in order that subgrp->scount never exceeds the
limit. Setting a limit inferior to the effective number of sent prefix
did not result in sending any withdrawal message to reduce the number of
sent prefixes. Without clearing the BGP neighbor, the limitation only
applied to the announcement of new prefixes when the limitation was
over.

With the patch, the limitation is checked in subgroup_announce_check().
The function is intended to say whether a prefix has to be announced in
regards to the prefix-list, route-map... Now when a maximum-prefix-out
value is changed/removed, the neighbor AFI/SAFI table is re-parsed in
the same way as for the application of route-map, prefix-lists...

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agobgpd: fix calculation of update-group hash with maximum-prefix-out
Louis Scalbert [Wed, 20 Oct 2021 14:15:22 +0000 (16:15 +0200)]
bgpd: fix calculation of update-group hash with maximum-prefix-out

Take into account the maximum-prefix-out value when calculating the
update-group hash.

Fixes: fde246e8353a ("bgpd: Add an option to limit outgoing prefixes")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agolib, zebra: Add ability to tell thread system to ignore late timers
Donald Sharp [Wed, 19 Jan 2022 19:56:25 +0000 (14:56 -0500)]
lib, zebra: Add ability to tell thread system to ignore late timers

Add a thread_ignore_late_timer(struct thread *thread) function
that allows thread.c to ignore when timers are late to the party.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Figure out if we are being starved for cpu
Donald Sharp [Wed, 3 Feb 2021 14:13:59 +0000 (09:13 -0500)]
lib: Figure out if we are being starved for cpu

If a thread timer should have popped CPU_CONSUMED_CHECK
seconds in the past, and we are only handling it now.  Consider
the thread starved and notice it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotopotests: isis vrf config changed
Philippe Guibert [Thu, 20 Jan 2022 15:07:22 +0000 (16:07 +0100)]
topotests: isis vrf config changed

Use vrf keyword for interface, and directly configure isis under
that interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoospf6d: Fix ECMP inter-area route nexthop update
Martin Buck [Mon, 17 Jan 2022 12:54:02 +0000 (13:54 +0100)]
ospf6d: Fix ECMP inter-area route nexthop update

Fixes #9720. When updating an ECMP inter-area route, we compute
a new route and check whether that already exists. If so, we keep the old
route and only update its nexthops. Previously, we merged the new route's
nexthops into the old one's, but this way, it's impossible to remove
nexthops from the old route, resulting in stale nexthops.

This commit fixes this by first removing all nexthops from the old route and
then copying all nexthops from the new route into it. If the new route has
fewer nexthops, the old one will have as well afterwards.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2 years agobgpd: replace custom union gw_addr with struct ipaddr
Igor Ryzhov [Wed, 19 Jan 2022 20:06:45 +0000 (23:06 +0300)]
bgpd: replace custom union gw_addr with struct ipaddr

BGP EVPN custom `union gw_addr` is basically the same thing as a common
`struct ipaddr` but it lacks the address family which is needed in some
cases.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agobgpd: fix populating the attribute
Igor Ryzhov [Wed, 19 Jan 2022 20:02:11 +0000 (23:02 +0300)]
bgpd: fix populating the attribute

This code is populating a temporary variable `add` instead of the attr.
Initially this variable was later copied to the attr but the copying was
erroneously deleted by 0a50c2481. Directly populate the attr to restore
the correct behavior.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agobgpd: remove wrong overlay index comparison
Igor Ryzhov [Wed, 19 Jan 2022 19:55:44 +0000 (22:55 +0300)]
bgpd: remove wrong overlay index comparison

Here we try to compare the new attr with the existing one but this call
compares the existing index with zero instead. attrhash_cmp already
compares indexes using overlay_index_same so this call is both wrong and
useless.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agobgpd: Add an empty line after new variable assignment
Donatas Abraitis [Wed, 19 Jan 2022 17:03:42 +0000 (19:03 +0200)]
bgpd: Add an empty line after new variable assignment

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Show Graceful Restart seconds remaining per prefix
Donatas Abraitis [Wed, 19 Jan 2022 17:02:01 +0000 (19:02 +0200)]
bgpd: Show Graceful Restart seconds remaining per prefix

```
exit1-debian-11# sh ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 14
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  65000, (stale)
    192.168.0.2 from 192.168.0.2 (0.0.0.0)
      Origin incomplete, metric 0, valid, external, best (First path received)
      Last update: Wed Jan 19 17:13:51 2022
      Time until Graceful Restart stale route deleted: 117
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10360 from opensourcerouting/clippy-rel-endian
Mark Stapp [Wed, 19 Jan 2022 13:58:12 +0000 (08:58 -0500)]
Merge pull request #10360 from opensourcerouting/clippy-rel-endian

lib/clippy: don't endian-convert twice

2 years agodoc: Update clear bgp command doc with message-stats option
David Schweizer [Wed, 19 Jan 2022 13:24:19 +0000 (14:24 +0100)]
doc: Update clear bgp command doc with message-stats option

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2 years agobgpd: Reset message statistics with clear command
David Schweizer [Wed, 19 Jan 2022 13:24:18 +0000 (14:24 +0100)]
bgpd: Reset message statistics with clear command

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2 years agotests: Lower keepalive/hold/connect timers for BGP LLGR test
Donatas Abraitis [Tue, 18 Jan 2022 09:47:27 +0000 (11:47 +0200)]
tests: Lower keepalive/hold/connect timers for BGP LLGR test

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Print function name for `(dynamic neighbor) deleted` debug messages
Donatas Abraitis [Sat, 15 Jan 2022 21:44:26 +0000 (23:44 +0200)]
bgpd: Print function name for `(dynamic neighbor) deleted` debug messages

Just sometimes to properly understand where this is coming from.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agotests: Check if LLGR works with dynamic peers as well
Donatas Abraitis [Sat, 15 Jan 2022 21:38:00 +0000 (23:38 +0200)]
tests: Check if LLGR works with dynamic peers as well

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Do not delete BGP dynamic peers if graceful restart kicks in
Donatas Abraitis [Sat, 15 Jan 2022 21:16:15 +0000 (23:16 +0200)]
bgpd: Do not delete BGP dynamic peers if graceful restart kicks in

```
~# vtysh -c 'show bgp ipv4 unicast summary' | grep 192.168.10.17
*donatas-pc(192.168.10.17)           4      65002         8        12        0    0    0 00:01:35            2       14 N/A
```

Before shutting down 192.168.10.17:

```
~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32'
BGP routing table entry for 100.100.100.100/32, version 7
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  home-spine1.donatas.net(192.168.0.2)
  65002, (stale)
    192.168.10.17 from donatas-pc(192.168.10.17) (0.0.0.0)
      Origin incomplete, valid, external
      Last update: Sat Jan 15 21:45:47 2022
  65001
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (2.2.2.2)
      Origin incomplete, metric 0, valid, external, best (Older Path)
      Last update: Sat Jan 15 21:25:19 2022
```

After 192.168.10.17 is down:

```
~# vtysh -c 'show bgp ipv4 unicast summary' | grep 192.168.10.17
donatas-pc(192.168.10.17)            4      65002         5         9        0    0    0 00:00:12       Active        0 N/A

~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32'
BGP routing table entry for 100.100.100.100/32, version 7
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  home-spine1.donatas.net(192.168.0.2)
  65002, (stale)
    192.168.10.17 from donatas-pc(192.168.10.17) (0.0.0.0)
      Origin incomplete, valid, external
      Community: llgr-stale
      Last update: Sat Jan 15 21:49:01 2022
      Time until Long-lived stale route deleted: 16
  65001
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (2.2.2.2)
      Origin incomplete, metric 0, valid, external, best (First path received)
      Last update: Sat Jan 15 21:25:19 2022
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10362 from mobash-rasool/fixes
Stephen Worley [Wed, 19 Jan 2022 05:39:17 +0000 (00:39 -0500)]
Merge pull request #10362 from mobash-rasool/fixes

pimd: remove redundant header include

2 years agoMerge pull request #10363 from anlancs/bfd-move-counter
Santosh P K [Wed, 19 Jan 2022 05:34:28 +0000 (11:04 +0530)]
Merge pull request #10363 from anlancs/bfd-move-counter

bfdd: fix the possibly wrong counter of control packets

2 years agoMerge pull request #10369 from donaldsharp/isis_fixes
Santosh P K [Wed, 19 Jan 2022 05:23:47 +0000 (10:53 +0530)]
Merge pull request #10369 from donaldsharp/isis_fixes

Isis fixes

2 years agoMerge pull request #10351 from mobash-rasool/topotest-ci-fix
Stephen Worley [Tue, 18 Jan 2022 21:47:39 +0000 (16:47 -0500)]
Merge pull request #10351 from mobash-rasool/topotest-ci-fix

tests: Fix random failure in test_PIM_hello_tx_rx_p1

2 years agoisisd: Ensure structure is defined for compilation
Donald Sharp [Tue, 18 Jan 2022 19:07:21 +0000 (14:07 -0500)]
isisd: Ensure structure is defined for compilation

lib/zclient.h was missing from #includes so compiler
was rightly complaining about undefined structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoisisd: Log messages should not have newlines in them.
Donald Sharp [Tue, 18 Jan 2022 19:06:38 +0000 (14:06 -0500)]
isisd: Log messages should not have newlines in them.

Fixes the compile failing because log messages were introduced
with newlines where in them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10355 from opensourcerouting/noisy-startup
Russ White [Tue, 18 Jan 2022 16:30:13 +0000 (11:30 -0500)]
Merge pull request #10355 from opensourcerouting/noisy-startup

lib, zebra: make startup less noisy

2 years agoMerge pull request #9938 from Orange-OpenSource/isis_ls
Russ White [Tue, 18 Jan 2022 15:12:08 +0000 (10:12 -0500)]
Merge pull request #9938 from Orange-OpenSource/isis_ls

isisd: Add Link State Traffic Engineering support

2 years agoMerge pull request #9644 from opensourcerouting/ospf-opaque-attrs
Russ White [Tue, 18 Jan 2022 14:08:38 +0000 (09:08 -0500)]
Merge pull request #9644 from opensourcerouting/ospf-opaque-attrs

OSPF opaque route attributes

2 years agozebra: Add table and instance data to debugs for redistribute_delete
Donald Sharp [Fri, 14 Jan 2022 18:16:17 +0000 (13:16 -0500)]
zebra: Add table and instance data to debugs for redistribute_delete

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