]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 years agobgpd: Turn off thread when running `no bmp targets X` 10871/head
Donatas Abraitis [Thu, 24 Mar 2022 10:00:57 +0000 (12:00 +0200)]
bgpd: Turn off thread when running `no bmp targets X`

Avoid use-after-free and prevent from crashing:

```
(gdb) bt
0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
1  0x00007f2a15c2c30d in core_handler (signo=11, siginfo=0x7fffb915e630, context=<optimized out>) at lib/sigevent.c:261
2  <signal handler called>
3  0x00007f2a156201e4 in bmp_stats (thread=<optimized out>) at bgpd/bgp_bmp.c:1330
4  0x00007f2a15c3d553 in thread_call (thread=thread@entry=0x7fffb915ebf0) at lib/thread.c:2001
5  0x00007f2a15bfa570 in frr_run (master=0x55c43a393ae0) at lib/libfrr.c:1196
6  0x000055c43930627c in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:519
(gdb)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 4008aa1a24f8175831e2b4917555aaa71d5ebddd)

3 years agoMerge pull request #10563 from FRRouting/mergify/bp/stable/8.1/pr-10552
Donatas Abraitis [Fri, 11 Feb 2022 05:56:24 +0000 (07:56 +0200)]
Merge pull request #10563 from FRRouting/mergify/bp/stable/8.1/pr-10552

tools: fix frr-reload context keywords (backport #10552)

3 years agotools: fix frr-reload context keywords 10563/head
Igor Ryzhov [Wed, 9 Feb 2022 23:51:49 +0000 (02:51 +0300)]
tools: fix frr-reload context keywords

There are singline-line commands inside `router bgp` that start with
`vnc ` or `bmp `. Those commands are currently treated as node-entering
commands. We need to specify such commands more precisely.

Fixes #10548.

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

3 years agoMerge pull request #10554 from FRRouting/mergify/bp/stable/8.1/pr-10551
Donald Sharp [Thu, 10 Feb 2022 13:11:26 +0000 (08:11 -0500)]
Merge pull request #10554 from FRRouting/mergify/bp/stable/8.1/pr-10551

bgpd: fix a couple of memleaks (backport #10551)

3 years agobgpd: fix aspath memleak on error in vnc_direct_bgp_add_nve 10554/head
Igor Ryzhov [Wed, 9 Feb 2022 22:23:41 +0000 (01:23 +0300)]
bgpd: fix aspath memleak on error in vnc_direct_bgp_add_nve

bgp_attr_default_set creates a new empty aspath. If family error happens,
this aspath is not freed. Move attr initialization after we checked the
family.

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

3 years agobgpd: fix aspath memory leak in aggr_suppress_map_test
Igor Ryzhov [Wed, 9 Feb 2022 22:20:03 +0000 (01:20 +0300)]
bgpd: fix aspath memory leak in aggr_suppress_map_test

aspth_empty a couple of lines earlier creates an aspath and it must be
freed.

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

3 years agobgpd: fix missing bgp_attr_flush on errors in bgp_update
Igor Ryzhov [Wed, 9 Feb 2022 22:15:57 +0000 (01:15 +0300)]
bgpd: fix missing bgp_attr_flush on errors in bgp_update

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

3 years agoMerge pull request #10535 from FRRouting/mergify/bp/stable/8.1/pr-10531
Jafar Al-Gharaibeh [Wed, 9 Feb 2022 03:23:45 +0000 (21:23 -0600)]
Merge pull request #10535 from FRRouting/mergify/bp/stable/8.1/pr-10531

bgpd: avoid memcmp comparison of struct nexthop (backport #10531)

3 years agobgpd: avoid memcmp comparison of struct nexthop 10535/head
Igor Ryzhov [Tue, 8 Feb 2022 17:34:28 +0000 (20:34 +0300)]
bgpd: avoid memcmp comparison of struct nexthop

Using memcmp is wrong because struct nexthop may contain unitialized
padding bytes that should not be compared.

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

3 years agoMerge pull request #10513 from FRRouting/mergify/bp/stable/8.1/pr-10510
Donald Sharp [Tue, 8 Feb 2022 18:30:15 +0000 (13:30 -0500)]
Merge pull request #10513 from FRRouting/mergify/bp/stable/8.1/pr-10510

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

3 years agobgpd: Print route-map name for filtred outgoing prefixes 10513/head
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)

3 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)

3 years agoMerge pull request #10499 from FRRouting/mergify/bp/stable/8.1/pr-10473
Donatas Abraitis [Fri, 4 Feb 2022 16:04:01 +0000 (18:04 +0200)]
Merge pull request #10499 from FRRouting/mergify/bp/stable/8.1/pr-10473

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

3 years agoMerge pull request #10489 from FRRouting/mergify/bp/stable/8.1/pr-10485
Donald Sharp [Fri, 4 Feb 2022 12:47:22 +0000 (07:47 -0500)]
Merge pull request #10489 from FRRouting/mergify/bp/stable/8.1/pr-10485

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

3 years agoospfd: Core in ospf_if_down during shutdown. 10499/head
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)

3 years agoMerge pull request #10479 from mjstapp/fix_meta_q_cleanup_8_1
Donatas Abraitis [Thu, 3 Feb 2022 06:48:31 +0000 (08:48 +0200)]
Merge pull request #10479 from mjstapp/fix_meta_q_cleanup_8_1

[8.1] zebra: fix cleanup of meta queues on vrf disable

3 years agobgpd: strncmp -> strcmp in community hash foo 10489/head
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)

3 years agoMerge pull request #10483 from mjstapp/fix_clang_format_8_1
Donatas Abraitis [Thu, 3 Feb 2022 06:02:32 +0000 (08:02 +0200)]
Merge pull request #10483 from mjstapp/fix_clang_format_8_1

[8.1] tools: tweak clang format to match master

3 years agotools: clang-format break after operators 10483/head
Mark Stapp [Mon, 6 Dec 2021 15:50:43 +0000 (10:50 -0500)]
tools: clang-format break after operators

Break after binary operators, rather than before.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
3 years agozebra: fix cleanup of meta queues on vrf disable 10479/head
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)

3 years agoMerge pull request #10467 from FRRouting/mergify/bp/stable/8.1/pr-9869
Igor Ryzhov [Wed, 2 Feb 2022 07:49:58 +0000 (10:49 +0300)]
Merge pull request #10467 from FRRouting/mergify/bp/stable/8.1/pr-9869

zebra: Fix EVPN route nexthop config order (backport #9869)

3 years agozebra: Fix EVPN route nexthop config order 10467/head
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>
(cherry picked from commit 8244ba34aa479cbf32b48f0ffc7dbda16601fb77)

3 years agoMerge pull request #10454 from ton31337/fix/memory_leak_ipv6_zebra_json_8.1
Igor Ryzhov [Tue, 1 Feb 2022 10:33:01 +0000 (13:33 +0300)]
Merge pull request #10454 from ton31337/fix/memory_leak_ipv6_zebra_json_8.1

ospf6d: [8.1] Fix memory leak for show ipv6 ospf6 zebra json

3 years agoospf6d: Fix memory leak for show ipv6 ospf6 zebra json 10454/head
Donatas Abraitis [Mon, 31 Jan 2022 19:12:53 +0000 (21:12 +0200)]
ospf6d: Fix memory leak for show ipv6 ospf6 zebra json

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #10377 from FRRouting/mergify/bp/stable/8.1/pr-10360
Mark Stapp [Wed, 19 Jan 2022 21:35:13 +0000 (16:35 -0500)]
Merge pull request #10377 from FRRouting/mergify/bp/stable/8.1/pr-10360

lib/clippy: don't endian-convert twice (backport #10360)

3 years agolib/clippy: don't endian-convert twice 10377/head
David Lamparter [Tue, 18 Jan 2022 08:50:25 +0000 (09:50 +0100)]
lib/clippy: don't endian-convert twice

elf_getdata_rawchunk() already endian-converts; doing it again is, uh,
counterproductive.

Fixes: #10051
Reported-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit cfc45e911e21820bc8b703b37e947a6a7e5d798a)

3 years agoMerge pull request #10354 from FRRouting/mergify/bp/stable/8.1/pr-10350
Donatas Abraitis [Mon, 17 Jan 2022 07:44:14 +0000 (09:44 +0200)]
Merge pull request #10354 from FRRouting/mergify/bp/stable/8.1/pr-10350

enable to transition to `SEGMENT_ROUTING_NODE` when pathd is disabled (backport #10350)

3 years agozebra: fix `segment-routing` command not found error with `--disable-pathd` 10354/head
Yamato Sugawara [Sun, 16 Jan 2022 04:08:47 +0000 (04:08 +0000)]
zebra: fix `segment-routing` command not found error with `--disable-pathd`

Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
(cherry picked from commit 1b3aea985e0cf1f7fdbc329cea204abcfcf80743)

3 years agoMerge pull request #10347 from FRRouting/mergify/bp/stable/8.1/pr-10343
Donald Sharp [Sat, 15 Jan 2022 23:10:00 +0000 (18:10 -0500)]
Merge pull request #10347 from FRRouting/mergify/bp/stable/8.1/pr-10343

bgpd: fix advertisedRoutes json key (backport #10343)

3 years agobgpd: fix advertisedRoutes json key 10347/head
Trey Aspelund [Fri, 14 Jan 2022 21:57:32 +0000 (21:57 +0000)]
bgpd: fix advertisedRoutes json key

'show bgp ... neighbor [routes|received-routes]' both incorrectly
used a json key of 'advertisedRoutes'.
This corrects the key to be 'receivedRoutes' for commands where
the displayed routes were received, not advertised.

before:
unet> r3 show ip bgp neigh 10.2.30.2 received-routes json | include Routes
  "advertisedRoutes":{

after:
ub18# show ip bgp neighbors enp1s0 received-routes json | include Routes
  "receivedRoutes":{
ub18# show ip bgp neighbors enp1s0 advertised-routes json | include Routes
  "advertisedRoutes":{

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

3 years agoMerge pull request #10329 from FRRouting/mergify/bp/stable/8.1/pr-10266
Donald Sharp [Thu, 13 Jan 2022 14:55:58 +0000 (09:55 -0500)]
Merge pull request #10329 from FRRouting/mergify/bp/stable/8.1/pr-10266

bgpd: fix aggregate route unsuppression bug (backport #10266)

3 years agobgpd: fix aggregate route unsuppression bug 10329/head
Rafael Zalamena [Mon, 27 Dec 2021 18:10:30 +0000 (15:10 -0300)]
bgpd: fix aggregate route unsuppression bug

Unsuppress route part of the aggregation when route-map configuration
is removed before the aggregation itself.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 92b175bd4037222e26be1f2639837bee1e200630)

3 years agoMerge pull request #10332 from FRRouting/mergify/bp/stable/8.1/pr-10294
Donatas Abraitis [Thu, 13 Jan 2022 10:53:53 +0000 (12:53 +0200)]
Merge pull request #10332 from FRRouting/mergify/bp/stable/8.1/pr-10294

topotests: require Linux 5.0 for NHRP (backport #10294)

3 years agotopotests: require Linux 5.0 for NHRP 10332/head
David Lamparter [Wed, 5 Jan 2022 19:59:38 +0000 (20:59 +0100)]
topotests: require Linux 5.0 for NHRP

It fails on 4.19, so let's go minimum 5.0 for the time being.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit fbfdb4f23a893de546e63a8be5305023203a81c8)

3 years agoMerge pull request #10270 from FRRouting/mergify/bp/stable/8.1/pr-9964
Russ White [Wed, 5 Jan 2022 15:02:12 +0000 (10:02 -0500)]
Merge pull request #10270 from FRRouting/mergify/bp/stable/8.1/pr-9964

zebra: remove ifp reference against the macs before deleting the ifp-… (backport #9964)

3 years agoMerge pull request #10280 from opensourcerouting/8.1/clipy-elf-tls
Donald Sharp [Wed, 5 Jan 2022 12:18:16 +0000 (07:18 -0500)]
Merge pull request #10280 from opensourcerouting/8.1/clipy-elf-tls

[8.1] backport lib: fix elf_py TLS section handling

3 years agolib: fix elf_py TLS section handling 10280/head
David Lamparter [Wed, 10 Nov 2021 14:30:07 +0000 (15:30 +0100)]
lib: fix elf_py TLS section handling

... need to ignore TLS sections, their address is effectively
meaningless but can overlap other sections we actually need to access.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 3942ee1f7bc754dd0dd9ae79f89d0f2635be334f)

3 years agozebra: remove ifp reference against the macs before deleting the ifp->mac_list 10270/head
Anuradha Karuppiah [Thu, 4 Nov 2021 18:15:10 +0000 (11:15 -0700)]
zebra: remove ifp reference against the macs before deleting the ifp->mac_list

Fix this crash seen in our topotests:

root@eva:/var/tmp/frr/zebra.928140# more crashlog
ZEBRA: Received signal 11 at 1636047065 (si_addr 0x0, PC 0x7fc01495a7a5); aborting...
ZEBRA: zlog_signal+0x18c                  7fc01496419a     7ffd595e1f50 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: core_handler+0xe3                  7fc0149a205e     7ffd595e2070 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: funlockfile+0x50                   7fc014841140     7ffd595e21c0 /lib/x86_64-linux-gnu/libpthread.so.0 (mapped at 0x7fc01482d000)
ZEBRA:     ---- signal ----
ZEBRA: list_delete_node+0x3c              7fc01495a7a5     7ffd595e2750 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: zebra_evpn_mac_ifp_unlink+0x9f     5600718b6518     7ffd595e2770 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: zebra_evpn_mac_clear_fwd_info+0x18     5600718b6654     7ffd595e27a0 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: zebra_evpn_mac_del+0x110           5600718b90b5     7ffd595e27c0 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: zebra_evpn_mac_del_hash_entry+0xef     5600718b93a7     7ffd595e28f0 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: hash_iterate+0x57                  7fc014949fa8     7ffd595e2920 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: zebra_evpn_mac_del_all+0x6d        5600718b9418     7ffd595e2970 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: zebra_evpn_cleanup_all+0x5a        5600718b5322     7ffd595e29e0 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: zebra_evpn_vxlan_cleanup_all+0x88     5600719106ff     7ffd595e2a10 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: hash_iterate+0x57                  7fc014949fa8     7ffd595e2a50 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: zebra_vxlan_cleanup_tables+0x3a     56007191a230     7ffd595e2aa0 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: zebra_vrf_disable+0x187            5600718fd656     7ffd595e2ad0 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: vrf_disable+0x8b                   7fc0149bc88f     7ffd595e2b40 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: vrf_delete+0x5b                    7fc0149bc65e     7ffd595e2b60 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: vrf_terminate_single+0x38          7fc0149bcd71     7ffd595e2b80 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: vrf_terminate+0xe5                 7fc0149bce59     7ffd595e2ba0 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: sigint+0x1de                       560071883117     7ffd595e2bc0 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: quagga_sigevent_process+0x73       7fc0149a1e6c     7ffd595e2c10 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: thread_fetch+0x4f                  7fc0149b8884     7ffd595e2c30 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: frr_run+0x230                      7fc01495980c     7ffd595e2cb0 /lib/libfrr.so.0 (mapped at 0x7fc0148b3000)
ZEBRA: main+0x3e4                         5600718835b3     7ffd595e2dc0 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: __libc_start_main+0xea             7fc01468cd0a     7ffd595e2e90 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x7fc014666000)
ZEBRA: _start+0x2a                        56007186a46a     7ffd595e2f60 /usr/lib/frr/zebra (mapped at 0x5600717ef000)
ZEBRA: no thread information available
root@eva:/var/tmp/frr/zebra.928140#

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 51aa26938bee458244617a1d9810fc935f00210e)

3 years agoMerge pull request #10253 from FRRouting/mergify/bp/stable/8.1/pr-10228
Donatas Abraitis [Wed, 22 Dec 2021 07:49:46 +0000 (09:49 +0200)]
Merge pull request #10253 from FRRouting/mergify/bp/stable/8.1/pr-10228

bgpd: fix aggregate route AS Path attribute (backport #10228)

3 years agobgpd: fix aggregate route AS Path attribute 10253/head
Rafael Zalamena [Mon, 13 Dec 2021 20:21:56 +0000 (17:21 -0300)]
bgpd: fix aggregate route AS Path attribute

Always free the locally allocated attribute not the one we are using for
return. This fixes a memory leak and a crash when AS Path is set with
route-map.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 8bd0d3b1db2eeaeaf9c6f5eedc9b7779233ad8df)

3 years agoMerge pull request #10233 from FRRouting/mergify/bp/stable/8.1/pr-10213
Donatas Abraitis [Mon, 20 Dec 2021 13:16:40 +0000 (15:16 +0200)]
Merge pull request #10233 from FRRouting/mergify/bp/stable/8.1/pr-10213

isisd: fix use after free (backport #10213)

3 years agoMerge pull request #10217 from FRRouting/mergify/bp/stable/8.1/pr-10214
Igor Ryzhov [Sat, 18 Dec 2021 10:08:40 +0000 (13:08 +0300)]
Merge pull request #10217 from FRRouting/mergify/bp/stable/8.1/pr-10214

bgpd: fix BGP ORF Prefix-length matching (backport #10214)

3 years agoisisd: fix use after free 10233/head
Igor Ryzhov [Tue, 14 Dec 2021 13:28:08 +0000 (16:28 +0300)]
isisd: fix use after free

Pointers to the adjacency must be cleared only when the adjacency is
deleted. Otherwise, when the ISIS router is deleted later, the adjacency
is not deleted and a crash happens because of UAF.

Fixes #10209.

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

3 years agobgpd: fix BGP ORF Prefix-length matching 10217/head
Martin Winter [Tue, 14 Dec 2021 13:53:53 +0000 (14:53 +0100)]
bgpd: fix BGP ORF Prefix-length matching

BGP ORF Prefix list incorrectly rejected list with a GE or LE to match the actual
prefix.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
(cherry picked from commit e574b842a1584a245e8dbd6bf4e418bfd78ec7b7)

3 years agoMerge pull request #10189 from FRRouting/mergify/bp/stable/8.1/pr-10120
Donatas Abraitis [Fri, 10 Dec 2021 15:27:19 +0000 (17:27 +0200)]
Merge pull request #10189 from FRRouting/mergify/bp/stable/8.1/pr-10120

bfdd: fix detection timeout update (backport #10120)

3 years agobfdd: fix detection timeout update 10189/head
Igor Ryzhov [Wed, 24 Nov 2021 12:01:41 +0000 (15:01 +0300)]
bfdd: fix detection timeout update

Per RFC 5880 section 6.8.12, the use of a Poll Sequence is not necessary
when the Detect Multiplier is changed. Currently, we update the Detection
Timeout only when a Poll Sequence is terminated, therefore we ignore the
Detect Multiplier change if it's not accompanied with RX/TX timer change.
To fix the problem, we should update the Detection Timeout on every
received packet.

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

3 years agoMerge pull request #10184 from FRRouting/mergify/bp/stable/8.1/pr-10144
Igor Ryzhov [Tue, 7 Dec 2021 10:48:54 +0000 (13:48 +0300)]
Merge pull request #10184 from FRRouting/mergify/bp/stable/8.1/pr-10144

bgpd: Handle Delete status when peers flapping for BMP (backport #10144)

3 years agobgpd: Handle Delete status when peers flapping for BMP 10184/head
Donatas Abraitis [Mon, 29 Nov 2021 15:35:54 +0000 (17:35 +0200)]
bgpd: Handle Delete status when peers flapping for BMP

Memory leak when doing quickly: clear ip bgp * or [no] neighbor X shutdown.

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

3 years agoMerge pull request #10140 from FRRouting/mergify/bp/stable/8.1/pr-10137
Donatas Abraitis [Tue, 30 Nov 2021 06:21:46 +0000 (08:21 +0200)]
Merge pull request #10140 from FRRouting/mergify/bp/stable/8.1/pr-10137

vtysh: add missing rpki node when showing config (backport #10137)

3 years agovtysh: add missing rpki node when showing config 10140/head
Igor Ryzhov [Sun, 28 Nov 2021 18:55:06 +0000 (21:55 +0300)]
vtysh: add missing rpki node when showing config

Before:
```
frr version 8.2-dev
frr defaults traditional
hostname frr
rpki
 rpki polling_period 20
 rpki cache 192.0.2.1 8080 preference 1
service integrated-vtysh-config
!
```

After:
```
frr version 8.2-dev
frr defaults traditional
hostname frr
service integrated-vtysh-config
!
rpki
 rpki polling_period 20
 rpki cache 192.0.2.1 8080 preference 1
exit
!
```

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

3 years agoMerge pull request #10108 from FRRouting/mergify/bp/stable/8.1/pr-10057
Donald Sharp [Wed, 24 Nov 2021 00:52:55 +0000 (19:52 -0500)]
Merge pull request #10108 from FRRouting/mergify/bp/stable/8.1/pr-10057

bgpd: Do not send LLA for route-server-client peers (backport #10057)

3 years agobgpd: Do not send LLA for route-server-client peers 10108/head
Donatas Abraitis [Mon, 15 Nov 2021 06:51:26 +0000 (08:51 +0200)]
bgpd: Do not send LLA for route-server-client peers

We should send only 16bytes next hop, no need for 32bytes, third party
next hops kinda for LLA does not work here.

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

3 years agoMerge pull request #10066 from FRRouting/mergify/bp/stable/8.1/pr-10047
Donatas Abraitis [Wed, 17 Nov 2021 06:59:59 +0000 (08:59 +0200)]
Merge pull request #10066 from FRRouting/mergify/bp/stable/8.1/pr-10047

bgpd: fix source-address for BFD sessions when using update-source IFNAME (backport #10047)

3 years agobgpd: fix source-address for BFD sessions when using update-source IFNAME 10066/head
Igor Ryzhov [Fri, 12 Nov 2021 16:32:06 +0000 (19:32 +0300)]
bgpd: fix source-address for BFD sessions when using update-source IFNAME

When "update-source IFNAME" is used for the neighbor, p->update_source
is set to NULL, so we can't use it as a source address and should use
the address from p->su_local.

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

3 years agoMerge pull request #10038 from FRRouting/mergify/bp/stable/8.1/pr-10035
Igor Ryzhov [Fri, 12 Nov 2021 14:57:38 +0000 (17:57 +0300)]
Merge pull request #10038 from FRRouting/mergify/bp/stable/8.1/pr-10035

ospfd: Prevent use after free on shutdown (backport #10035)

3 years agoospfd: Prevent use after free on shutdown 10038/head
Donald Sharp [Thu, 11 Nov 2021 18:25:35 +0000 (13:25 -0500)]
ospfd: Prevent use after free on shutdown

Running ospf_topo_vrf1 leads us to this valgrind issue:

==2386518== Invalid read of size 8
==2386518==    at 0x4971520: route_top (table.c:401)
==2386518==    by 0x181F08: ospf_interface_bfd_apply (ospf_bfd.c:126)
==2386518==    by 0x182069: ospf_interface_disable_bfd (ospf_bfd.c:158)
==2386518==    by 0x18BF51: ospf_del_if_params (ospf_interface.c:557)
==2386518==    by 0x18C584: ospf_if_delete_hook (ospf_interface.c:712)
==2386518==    by 0x490CA0B: hook_call_if_del (if.c:61)
==2386518==    by 0x490D1F3: if_delete_retain (if.c:286)
==2386518==    by 0x490D337: if_delete (if.c:309)
==2386518==    by 0x490CDED: if_destroy_via_zapi (if.c:200)
==2386518==    by 0x49940A9: zclient_interface_delete (zclient.c:2237)
==2386518==    by 0x4998062: zclient_read (zclient.c:3969)
==2386518==    by 0x4979529: thread_call (thread.c:1908)
==2386518==    by 0x4919918: frr_run (libfrr.c:1164)
==2386518==    by 0x181AC7: main (ospf_main.c:235)
==2386518==  Address 0x5df39a0 is 0 bytes inside a block of size 56 free'd
==2386518==    at 0x48399AB: free (vg_replace_malloc.c:538)
==2386518==    by 0x492A03E: qfree (memory.c:141)
==2386518==    by 0x4970C6F: route_table_free (table.c:141)
==2386518==    by 0x4970A36: route_table_finish (table.c:61)
==2386518==    by 0x18C543: ospf_if_delete_hook (ospf_interface.c:708)
==2386518==    by 0x490CA0B: hook_call_if_del (if.c:61)
==2386518==    by 0x490D1F3: if_delete_retain (if.c:286)
==2386518==    by 0x490D337: if_delete (if.c:309)
==2386518==    by 0x490CDED: if_destroy_via_zapi (if.c:200)
==2386518==    by 0x49940A9: zclient_interface_delete (zclient.c:2237)
==2386518==    by 0x4998062: zclient_read (zclient.c:3969)
==2386518==    by 0x4979529: thread_call (thread.c:1908)
==2386518==    by 0x4919918: frr_run (libfrr.c:1164)
==2386518==    by 0x181AC7: main (ospf_main.c:235)
==2386518==  Block was alloc'd at
==2386518==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
==2386518==    by 0x4929EFC: qcalloc (memory.c:116)
==2386518==    by 0x49709F8: route_table_init_with_delegate (table.c:53)
==2386518==    by 0x49717F4: route_table_init (table.c:528)
==2386518==    by 0x18C328: ospf_if_new_hook (ospf_interface.c:659)
==2386518==    by 0x490C97D: hook_call_if_add (if.c:60)
==2386518==    by 0x490CE85: if_create_name (if.c:223)
==2386518==    by 0x490DF32: if_get_by_name (if.c:622)
==2386518==    by 0x4993F73: zclient_interface_add (zclient.c:2186)
==2386518==    by 0x4998062: zclient_read (zclient.c:3969)
==2386518==    by 0x4979529: thread_call (thread.c:1908)
==2386518==    by 0x4919918: frr_run (libfrr.c:1164)
==2386518==    by 0x181AC7: main (ospf_main.c:235)
==2386518==

Fix the ordering to do the individual node tree cleanup after we delete
the data we care about.

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

3 years agoMerge pull request #10003 from FRRouting/mergify/bp/stable/8.1/pr-9984
Donald Sharp [Wed, 10 Nov 2021 00:48:17 +0000 (19:48 -0500)]
Merge pull request #10003 from FRRouting/mergify/bp/stable/8.1/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` 10003/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 agoFRR Release 8.1 docker/8.1.0 frr-8.1
Jafar Al-Gharaibeh [Thu, 4 Nov 2021 19:40:38 +0000 (14:40 -0500)]
FRR Release 8.1

FRR 8.1 brings a long list of enhancements and fixes with 1200 commits from
75 developers. Thanks to all contributers.

* New Features

- Lua hooks are now feature complete, with one hook available for use
  (http://docs.frrouting.org/en/latest/scripting.html)
- Improvements to SRv6 (Segment Routing over IPv6)
  (http://docs.frrouting.org/en/latest/zebra.html#segment-routing-ipv6)
- Improvements to Prefix-SID (Type 5)
- EVPN route type-5 gateway IP overlay Index
  (http://docs.frrouting.org/en/latest/bgp.html#evpn-overlay-index-gateway-ip)
- OSPFv3 NSSA and NSSA totally stub areas
  (http://docs.frrouting.org/en/latest/ospf6d.html#ospf6-area)
- OSPFv3 ASBR summarization
  (http://docs.frrouting.org/en/latest/ospf6d.html#asbr-summarisation-support-in-ospfv3)
- OSPFv3 Graceful Restart
  (http://docs.frrouting.org/en/latest/ospf6d.html#graceful-restart)
- OSPFv2 Graceful Restart (restarting mode added, helper was already implemented)
  (http://docs.frrouting.org/en/latest/ospfd.html#graceful-restart)

* FRRouting 2021 GSOC Project

  FRRouting's GSOC student implemented the infrastructure needed to add the
  ability to call out to user provided Lua scripts from within FRR. Keep an eye
  out for developments in this area.

  You can read about the work he did here:

  https://frrouting.github.io/frr-gsoc/year-2021/projects/lua-hook-points
  https://dlqs.dev/frr-gsoc-2021.html

  And its presentation at Netdev 0x15:
  https://www.youtube.com/watch?v=_8R1MYP7M48&t=1051s

  Thank you @dlqs!

* Behavior Changes

- Every node in running config now has an explicit "exit" tag
- Link bandwidth in BGP is now correctly encoded according to IEEE 754.
  To stay with old incorrect encoding use:
  `neighbor PEER disable-link-bw-encoding-ieee`

* Changelog

alpine
    Fix path for daemons file install

bgpd
    Add "json" option to "show bgp as-path-access-list"
    Add `disable-addpath-rx` knob
    Add an ability to set extcommunity to none in route-maps
    Add counter of displayed show bgp summary when filtering
    Add knob to config cond-adv scanner period
    Add route-map `match alias` command
    Add rpki source address configuration
    Add show bgp summary filter by neighbor or as
    Add terse display option on show bgp summary
    Allow for auto-completion of community alias's created
    Bgp knob to teardown session immediately when peer is unreachable
    Expand 'bgp default <afi>-<safi>' cmds
    Extend evpn next hop tracking to type-1 and type-4 routes
    Fix "no router bgp x vrf default"
    Flowspec redirect vrf uses vrf table instead of allocated table id
    Handle quick flaps of an evpn prefix properly
    Initial batch of evpn lttng tracepoints
    Limit processing to what is needed in rpki validation
    Modify vrf/view display in show bgp summary
    Set 4096 instead of 65535 as new max packet size for a new peer
    Set extended msg size only if we advertised and received capability
    Show bgp community alias in json community list output
    Show bgp prefixes by community alias
    Show max packet size per update-group
    Split soft reconfigure table task into several jobs to not block vtysh
    Store distance received from a redistribute statement
    Update route-type-1 legend to match output

isis
    Fix sending of lsp with null seqno

lib
    Add "json" option to "show ip[v6] access-list"
    Add "json" option to "show ip[v6] prefix-list"
    Add "json" option to "show route-map"
    Prevent grpc assert on missing yang node

nhrp
    Clear cache when shortcuts are cleared
    Fix corrupt address being shown for shortcuts with no cache entry
    Set prefix correctly in resolution request

ospf6
    Add debug commands for lsa all and route all
    Add warning log for late hello packets
    Add write-multiplier configuration
    Don't update router-id if at least one adjacency is full
    Extend the "redistribute" command with more options
    Fix issue when displaying the redistribute command
    Fix logging of border router routes
    Json output for database dump show command
    Link state id in lsa database json output
    Send lsa update immediately when ospf instance is deleted

ospfd
    Fix crash when creating vlink in unknown vrf
    Gr conformance fix for hello packet dr election
    Print extra lsa information in some log messages
    Rfc conformance test case 25.23 issue fix
    Show ip ospf route json does not shown metric and tag
    Summary lsa is not originated when process is reset

pathd
    Handle pcinitiated configuration, main thread
    Handle pcinitiated messages, thread controller
    Handle srp_id correctly
    If pce ret no-path to pcreq don't retry pcreq nor delegate

pbrd
    Add `match ip-protocol [tcp|udp]`
    Add ability to set/unset src and dest ports
    Nhg "add" edge case for last in table range
    Start inclusion of src and dst ports for pbrd

pimd
    Add tos/ttl check for igmp conformance
    Allow join prune intervals to be as small as 5 seconds
    Allow msdp group name 'default'
    Fix register suppress timer code
    Fix uaf/heap corruption in bsm code
    Fix command "no ip msdp mesh-group member"
    Igmp groups are not getting timeout
    Igmp memberships are not querier specific
    Igmp sockets need to be iface-bound too
    Prevent uninited usage of nexthop
    Support msdp global timers configuration

vtysh
    Add cli timestamp '-t' flag
    Add error code if daemon is not running
    Fix searching commands in parent nodes

yang
    Add msdp timer configuration
    Fix bgp multicast prefix type
    Mark a couple of prefix-list/access-list leafs as mandatory
    Move multicast prefix type definition
    Replace an empty pattern with a zero-length restriction
    Rework pim msdp mesh group
    Simplify msdp peer handling

zebra
    Add "json" option to "show interface"
    Various improvment to dataplane interface
    Add message counts for `show zebra client`
    Add nhg id to show ip route json
    Add show command for ra interface lists
    Fix ipv4 routes with ipv6 link local next hops install in fpm
    Handle bridge mac address update in evpn contexts
    Move individual lines to table in `show zebra client` command
    Refresh vxlan evpn contexts, when bridge interface goes up
    Update zl3vni when bridge link refreshed in other namespaces

* Contributers

Aaron Pereira <pereiraaa@vmware.com>
Abhinay Ramesh <rabhinay@vmware.com>
Abhishek Naik <bhini@amazon.com>
Adriano Marto Reis <adrianomarto@gmail.com>
Alexander Chernavin <achernavin@netgate.com>
Alexander Skorichenko <askorichenko@netgate.com>
Ameya Dharkar <adharkar@vmware.com>
Amol Lad <amol.lad@4rf.com>
anlan_cs <anlan_cs@tom.com>
Anuradha Karuppiah <anuradhak@nvidia.com>
Basha Mougamadou <b.mougamadou@criteo.com>
batmancn <batmanustc@gmail.com>
Chirag Shah <chirag@nvidia.com>
Christian Hopps <chopps@gmail.com>
Colin Sames <colin.sames@haw-hamburg.de>
David Lamparter <equinox@diac24.net>
Dmitrii Turlupov <dturlupov@factor-ts.ru>
Donald Lee <dlqs@gmx.com>
Donald Sharp <sharpd@nvidia.com>
Donatas Abraitis <donatas.abraitis@gmail.com>
Don Slice <dslice@nvidia.com>
Emanuele Di Pascale <emanuele@voltanet.io>
enigamict <mochienper@gmail.com>
ewlumpkin <ewlumpkin@gmail.com>
GalaxyGorilla <sascha@netdef.org>
github login name <ranjany@vmware.com>
gord_chen <gord_chen@edge-core.com>
G. Paul Ziemba <p-fbsd-bugs@ziemba.us>
Guillaume Solignac <guillaume.solignac@orange.com>
Hiroki Shirokura <slank.dev@gmail.com>
Igor Ryzhov <iryzhov@nfware.com>
Jafar Al-Gharaibeh <jafar@atcorp.com>
Javier Garcia <javier.garcia@voltanet.io>
John W. O'Brien <john@saltant.com>
Kantesh Mundaragi <kmundaragi@vmware.com>
Karen Schoener <karen@voltanet.io>
Kaushik <kaushiknath.null@gmail.com>
Kuldeep Kashyap <kashyapk@vmware.com>
Lars Seipel <ls@slrz.net>
Lou Berger <lberger@labn.net>
Louis Scalbert <louis.scalbert@6wind.com>
lynne <lynne@voltanet.io>
Mark Stapp <mstapp@nvidia.com>
Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
Martin Winter <mwinter@opensourcerouting.org>
Mobashshera Rasool <mrasool@vmware.com>
nguggarigoud <nguggarigoud@vmware.com>
Nikhil Kelapure <nikhil.kelapure@broadcom.com>
Olivier Dugeon <olivier.dugeon@orange.com>
Ondřej Surý <ondrej@sury.org>
Pat Ruddy <pat@voltanet.io>
Pavel Ivashchenko <pivashchenko@nfware.com>
Philippe Guibert <philippe.guibert@6wind.com>
Prerana GB <prerana@vmware.com>
Quentin Young <qlyoung@nvidia.com>
Rafael Zalamena <rzalamena@opensourcerouting.org>
Renato Westphal <renato@opensourcerouting.org>
Reuben Dowle <reuben.dowle@4rf.com>
rgirada <rgirada@vmware.com>
Ryoga <contact@proelbtn.com>
Sai Gomathi <nsaigomathi@vmware.com>
schylar <schylarutley@hotmail.com>
Soman K.S <somanks@gmail.com>
Steffen Neubauer <s.neubauer@syseleven.de>
Stephen Worley <sworley@nvidia.com>
Takemasa Imada <takemasa.imada@gmail.com>
Tomáš Szaniszlo <tomaxuser@gmail.com>
Trey Aspelund <taspelund@nvidia.com>
vivek <vivek@cumulusnetworks.com>
Wesley Coakley <wcoakley@nvidia.com>
Xiao Liang <shaw.leon@gmail.com>
Yaroslav Fedoriachenko <yar.fed99@gmail.com>
Yash Ranjan <ranjany@vmware.com>
Yuan Yuan <yyuanam@amazon.com>
zyxwvu Shi <shiyuchen.syc@bytedance.com>

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agoMerge pull request #9992 from FRRouting/mergify/bp/stable/8.1/pr-9954
Donald Sharp [Sun, 7 Nov 2021 16:00:36 +0000 (11:00 -0500)]
Merge pull request #9992 from FRRouting/mergify/bp/stable/8.1/pr-9954

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

3 years agozebra: Send up ifindex for redistribution when appropriate 9992/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 agoMerge pull request #9990 from FRRouting/mergify/bp/stable/8.1/pr-9972
Donald Sharp [Sat, 6 Nov 2021 20:49:24 +0000 (16:49 -0400)]
Merge pull request #9990 from FRRouting/mergify/bp/stable/8.1/pr-9972

bfdd,bgpd: fix some integration bugs (backport #9972)

3 years agobgpd: update BFD config on update-source change 9990/head
Rafael Zalamena [Wed, 3 Nov 2021 11:43:17 +0000 (08:43 -0300)]
bgpd: update BFD config on update-source change

Update BFD sessions when the update-source configuration is set so the
session follows the new configured source address.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 7196f56eb3d3866ccafee095c8be66f058d99abf)

3 years agobgpd: fix BFD configuration update on TTL change
Rafael Zalamena [Tue, 2 Nov 2021 21:54:23 +0000 (18:54 -0300)]
bgpd: fix BFD configuration update on TTL change

When altering the TTL of a eBGP peer also update the BFD
configuration. This was only working when the configuration happened
after the peer connection had been established.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 4ba37eb691f9574e908ec7ed03e8f4cb4214f2d5)

3 years agolib: constify read only parameters
Rafael Zalamena [Wed, 3 Nov 2021 11:45:02 +0000 (08:45 -0300)]
lib: constify read only parameters

Constify some BFD library function parameters to signalize they are
not going to get modified.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit ca30ac7fc375e3979776bb229587415f05bd4ce9)

3 years agolib: fix BFD IPv6 session address change
Renato Westphal [Thu, 28 Oct 2021 15:35:56 +0000 (12:35 -0300)]
lib: fix BFD IPv6 session address change

Pass the correct family type and remove unneeded casts.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
(cherry picked from commit ae0945733333f60fccb0b4ac170ca3ee7351828b)

3 years agoMerge pull request #9985 from FRRouting/mergify/bp/stable/8.1/pr-9978
Igor Ryzhov [Sat, 6 Nov 2021 14:12:59 +0000 (17:12 +0300)]
Merge pull request #9985 from FRRouting/mergify/bp/stable/8.1/pr-9978

doc: Drop misleading explanation about `neighbor X interface IFNAME` (backport #9978)

3 years agodoc: Drop misleading explanation about `neighbor X interface IFNAME` 9985/head
Donatas Abraitis [Fri, 5 Nov 2021 20:59:52 +0000 (22:59 +0200)]
doc: Drop misleading explanation about `neighbor X interface IFNAME`

This command is not deprecated.

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

3 years agoMerge pull request #9911 from FRRouting/mergify/bp/dev/8.1/pr-9083
Donald Sharp [Thu, 28 Oct 2021 11:58:32 +0000 (07:58 -0400)]
Merge pull request #9911 from FRRouting/mergify/bp/dev/8.1/pr-9083

pimd: In Prune Pending state, the holdtime change is not taking effect (backport #9083)

3 years agopimd: In Prune Pending state, the holdtime change is not taking effect 9911/head
github login name [Mon, 19 Jul 2021 07:46:00 +0000 (00:46 -0700)]
pimd: In Prune Pending state, the holdtime change is not taking effect

Problem Statement:
In Prune pending state, when Join is received, and there is hold timer change
the Expiry timer is not getting updated with new Hold timer.

Root Cause:
When thread_add_timer function is called and the thread is already in the list
the thread api just returns, it does not modify the timer value.
So when we want to change the timer, we need to first call THREAD_OFF and then
call thread_add_timer.
The Expiry timer thread is not cancelled in PIM_IFJOIN_PRUNE_PENDING state,
therefore the timer change is not taking effect.

Fix:
Call THREAD_OFF in that flow.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
(cherry picked from commit b206dc5566dc790174f2fd1d14687612a54c7acd)

3 years agoMerge pull request #9784 from FRRouting/mergify/bp/dev/8.1/pr-9737
Donatas Abraitis [Wed, 27 Oct 2021 11:02:14 +0000 (14:02 +0300)]
Merge pull request #9784 from FRRouting/mergify/bp/dev/8.1/pr-9737

yang: replace an empty pattern with a zero-length restriction (backport #9737)

3 years agoMerge pull request #9901 from FRRouting/mergify/bp/dev/8.1/pr-9886
Donald Sharp [Wed, 27 Oct 2021 10:58:06 +0000 (06:58 -0400)]
Merge pull request #9901 from FRRouting/mergify/bp/dev/8.1/pr-9886

lib: fix srv6 route hardcode with BGP (backport #9886)

3 years agoMerge pull request #9904 from FRRouting/mergify/bp/dev/8.1/pr-9791
Donatas Abraitis [Wed, 27 Oct 2021 04:19:57 +0000 (07:19 +0300)]
Merge pull request #9904 from FRRouting/mergify/bp/dev/8.1/pr-9791

3 years agoMerge pull request #9891 from FRRouting/mergify/bp/dev/8.1/pr-9873
Igor Ryzhov [Tue, 26 Oct 2021 21:53:14 +0000 (00:53 +0300)]
Merge pull request #9891 from FRRouting/mergify/bp/dev/8.1/pr-9873

3 years agobgpd: remove bogus check 9904/head
Rafael Zalamena [Mon, 11 Oct 2021 21:29:54 +0000 (18:29 -0300)]
bgpd: remove bogus check

`bgp` pointer always exists and is used before this function call.

Calling `free` in `json` in this context will also cause a
use-after-free crash.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 21e33c958d6258943796a04b9ac29838a7b41283)

3 years agobgpd: fix json object handling
Martin Winter [Fri, 8 Oct 2021 17:19:53 +0000 (19:19 +0200)]
bgpd: fix json object handling

Fix memory leaks when quitting early and double free when headers are
not set.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
(cherry picked from commit 690c3134a4f5657bce8d533d8459c2e9e1dcfe86)

3 years agolib: fix srv6 route hardcode with BGP 9901/head
Hiroki Shirokura [Mon, 25 Oct 2021 23:36:14 +0000 (23:36 +0000)]
lib: fix srv6 route hardcode with BGP

zclient_send_localsid is called by various routing protocol daemons. To set the
srv6 endpoint function. Fix a hard-coded error in the initial implementation.
Before this PR, the srv6 function will be registered to zebra as a BGP route
even if isisd executes zclient_send_localsid.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
(cherry picked from commit 8563b9722ac7293b0cca4bc7d869943fef9a09c4)

3 years agoMerge pull request #9893 from FRRouting/mergify/bp/dev/8.1/pr-9876
Igor Ryzhov [Tue, 26 Oct 2021 12:15:10 +0000 (15:15 +0300)]
Merge pull request #9893 from FRRouting/mergify/bp/dev/8.1/pr-9876

bgpd: When issuing `no ... ebgp-multihop` always resets (backport #9876)

3 years agobgpd: When issuing `no ... ebgp-multihop` always resets 9893/head
Donald Sharp [Sun, 24 Oct 2021 19:02:11 +0000 (15:02 -0400)]
bgpd: When issuing `no ... ebgp-multihop` always resets

When removing the command `no neighbor <X> ebgp-multihop <Y>`
the bgp code was always resetting the connection even if
the command would do nothing.

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

3 years agobgpd: Reset dynamic peer counter 9891/head
Abhishek Naik [Tue, 19 Oct 2021 23:45:26 +0000 (23:45 +0000)]
bgpd: Reset dynamic peer counter

Dynamic peer count is inconsistent in
"show bgp summary json" and "show bgp summary failed json" due to
dynamic peer counter 'dn_count' being reused without resetting

Signed-off-by: Abhishek Naik <bhini@amazon.com>
(cherry picked from commit 800867d85e5fae7d41131c2552dec290f2246077)

3 years agoMerge pull request #9857 from FRRouting/mergify/bp/dev/8.1/pr-9856
Donald Sharp [Thu, 21 Oct 2021 17:58:51 +0000 (13:58 -0400)]
Merge pull request #9857 from FRRouting/mergify/bp/dev/8.1/pr-9856

zebra: Fix code paths that always resolve to true (backport #9856)

3 years agozebra: Fix code paths that always resolve to true 9857/head
Donald Sharp [Wed, 20 Oct 2021 14:15:41 +0000 (10:15 -0400)]
zebra: Fix code paths that always resolve to true

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

3 years agoMerge pull request #9845 from idryzhov/8.1-ospf-vlink-crash frr-8.1-rc2
Jafar Al-Gharaibeh [Tue, 19 Oct 2021 21:57:57 +0000 (16:57 -0500)]
Merge pull request #9845 from idryzhov/8.1-ospf-vlink-crash

[8.1] ospfd: fix crash when creating vlink in unknown vrf

3 years agoospfd: fix crash when creating vlink in unknown vrf 9845/head
Igor Ryzhov [Mon, 18 Oct 2021 14:16:35 +0000 (17:16 +0300)]
ospfd: fix crash when creating vlink in unknown vrf

if_create_name crashes when vrf_id is VRF_UNKNOWN:
```
nfware# conf t
nfware(config)# router ospf vrf doesnt-exist
nfware(config-router)# area 1.1.1.1 virtual-link 2.2.2.2
vtysh: error reading from ospfd: Success (0)Warning: closing connection to ospfd because of an I/O error!
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9808 from FRRouting/mergify/bp/dev/8.1/pr-9686
Donald Sharp [Fri, 15 Oct 2021 13:13:39 +0000 (09:13 -0400)]
Merge pull request #9808 from FRRouting/mergify/bp/dev/8.1/pr-9686

zebra: fix buffer overflow (backport #9686)

3 years agoMerge pull request #9810 from FRRouting/mergify/bp/dev/8.1/pr-9733
Igor Ryzhov [Fri, 15 Oct 2021 09:52:02 +0000 (12:52 +0300)]
Merge pull request #9810 from FRRouting/mergify/bp/dev/8.1/pr-9733

lib: fix gRPC crash on missing YANG node (backport #9733)

3 years agoMerge pull request #9767 from FRRouting/mergify/bp/dev/8.1/pr-9345
Igor Ryzhov [Wed, 13 Oct 2021 22:45:14 +0000 (01:45 +0300)]
Merge pull request #9767 from FRRouting/mergify/bp/dev/8.1/pr-9345

lib: Fix zmq wrapper module mem handling (backport #9345)

3 years agoMerge pull request #9809 from FRRouting/mergify/bp/dev/8.1/pr-9655
Igor Ryzhov [Wed, 13 Oct 2021 22:40:30 +0000 (01:40 +0300)]
Merge pull request #9809 from FRRouting/mergify/bp/dev/8.1/pr-9655

Zebra: Ignore the failure of startup intf lookup. (backport #9655)

3 years agoMerge pull request #9794 from FRRouting/mergify/bp/dev/8.1/pr-9789
Donald Sharp [Wed, 13 Oct 2021 14:15:58 +0000 (10:15 -0400)]
Merge pull request #9794 from FRRouting/mergify/bp/dev/8.1/pr-9789

lib: set type for newly created interfaces (backport #9789)

3 years agolib: prevent gRPC assert on missing YANG node 9810/head
Rafael Zalamena [Mon, 4 Oct 2021 21:10:58 +0000 (18:10 -0300)]
lib: prevent gRPC assert on missing YANG node

`yang_dnode_get` will `assert` if no YANG node/model exist, so lets test for
its existence first before trying to access it.

This `assert` is only acceptable for internal FRR usage otherwise we
might miss typos or unmatching YANG models nodes/leaves. For gRPC usage
we should let users attempt to use non existing models without
`assert`ing.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 0f538858c2bd22072539c8dbd4ad87601b0fc8ac)

3 years agoZebra: Ignore the failure of startup intf lookup. 9809/head
Yuan Yuan [Wed, 22 Sep 2021 20:02:40 +0000 (20:02 +0000)]
Zebra: Ignore the failure of startup intf lookup.

In startup, zebra would dump interface information from Kernel in 3
steps w/o lock: step1, get interface information; step2, get interface
ipv4 address; step3, get interface ipv6 address.
If any interface gets added after step1, but before step2/3, zebra
would get extra interface addresses in step2/3 that has not been added
into zebra in step1. Returning error in the referenced interface lookup
would cause the startup interface retrieval to be incomplete.

Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
(cherry picked from commit 8eec31ef564dcf4e096e700a648570973ca4e96b)

3 years agozebra: fix buffer overflow 9808/head
Igor Ryzhov [Tue, 28 Sep 2021 12:44:51 +0000 (15:44 +0300)]
zebra: fix buffer overflow

mac is only 6 bytes long and we shouldn't blindly copy unknown number of
bytes into it.

Fixes #9671.

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

3 years agoMerge pull request #9772 from FRRouting/mergify/bp/dev/8.1/pr-9738
Russ White [Tue, 12 Oct 2021 15:47:49 +0000 (11:47 -0400)]
Merge pull request #9772 from FRRouting/mergify/bp/dev/8.1/pr-9738

ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA. (backport #9738)

3 years agolib: set type for newly created interfaces 9794/head
Igor Ryzhov [Fri, 8 Oct 2021 21:22:31 +0000 (00:22 +0300)]
lib: set type for newly created interfaces

Currently, the ll_type is set only in `netlink_interface` which is
executed only during startup. If the interface is created when the FRR
is already running, the type is not stored.

Fixes #1164.

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

3 years agoMerge pull request #9786 from FRRouting/mergify/bp/dev/8.1/pr-9774
Donatas Abraitis [Mon, 11 Oct 2021 09:10:43 +0000 (12:10 +0300)]
Merge pull request #9786 from FRRouting/mergify/bp/dev/8.1/pr-9774

bgpd: fix crash when using "show bgp vrf all" (backport #9774)

3 years agobgpd: fix crash when using "show bgp vrf all" 9786/head
Igor Ryzhov [Thu, 7 Oct 2021 15:27:29 +0000 (18:27 +0300)]
bgpd: fix crash when using "show bgp vrf all"

Any command that uses `peer_lookup_in_view` crashes when "vrf all" is
used, because bgp is NULL in this case.

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

3 years agoyang: replace an empty pattern with a zero-length restriction 9784/head
Igor Ryzhov [Tue, 5 Oct 2021 10:27:39 +0000 (13:27 +0300)]
yang: replace an empty pattern with a zero-length restriction

No functional difference, but `length "0"` is more comprehensible.

Suggested-by: Christian Hopps <chopps@labn.net>
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 405ebe45cf111376fe33bad45b4ec836e0157d9f)

3 years agoospf6d: ospf6d is crashing upon receiving duplicated Grace LSA. 9772/head
rgirada [Tue, 5 Oct 2021 07:52:36 +0000 (00:52 -0700)]
ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.

Description:
When grace lsa received, DUT is adding
the copy of the  lsas  to all nbrs retransmission  list as part of
flooding procedure and subsequently incrementing the rmt counter in
the original the LSA. This counter is supposed to be decremented
when ack is received by nbr and the lsa  will be removed from retransmission list.

But in our current scenario,
Step-1:
When GR helper is disabled, if DUT receives the grace lsa
it adds the lsa copy to nbrs retransmission list but original
LSA will be discarded since GR helper disabled.
Step-2:
GR helper enabled and DUT receives the grace lsa, as part
of flooding process all nbrs have same copy of lsa in their
corresponding rmt list which was added in step -1 due to this
the corresponding rmt counter in the original lsa is not getting
incremented.
Step-3:
If the same copy of the grace lsa received by DUT, It considers
as implicit ack from nbr if the same copy of the lsa exits in its
rmt list and subsequently  decrement the rmt counter.
Since counter is zero (because of step-1 and 2) , it is asserting while decrement.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
(cherry picked from commit a60eab9e109fd2625dc3f941d7d9be2b6312f593)

3 years agolib: avoid double-free in zmq wrapper callbacks 9767/head
Mark Stapp [Mon, 9 Aug 2021 15:57:17 +0000 (11:57 -0400)]
lib: avoid double-free in zmq wrapper callbacks

There were paths where the zmq wrapper lib could call user
callbacks that would free the internal context struct, but the
context was then used in the lib code. Use a boolean to avoid
freeing the context within an application callback.

Restore logic that frees the context within the 'cancel' api.

Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
(cherry picked from commit 8fd5502b0c2e628b875fdaf1a0ca467f8ba07ce4)