]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
3 years agoMerge pull request #9335 from FRRouting/mergify/bp/stable/7.2/pr-9214 stable/7.2
Igor Ryzhov [Tue, 24 Aug 2021 21:45:15 +0000 (00:45 +0300)]
Merge pull request #9335 from FRRouting/mergify/bp/stable/7.2/pr-9214

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

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

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

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

3 years agoMerge pull request #8886 from FRRouting/mergify/bp/stable/7.2/pr-8876
Donald Sharp [Sat, 19 Jun 2021 19:47:46 +0000 (15:47 -0400)]
Merge pull request #8886 from FRRouting/mergify/bp/stable/7.2/pr-8876

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

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

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

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

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

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

4 years agoMerge pull request #6944 from LabNConsulting/working/lb/7.2/valgrind-supp-libyang
Donald Sharp [Wed, 19 Aug 2020 11:43:08 +0000 (07:43 -0400)]
Merge pull request #6944 from LabNConsulting/working/lb/7.2/valgrind-supp-libyang

[7.2] bgpd: suppress new libyang_1.0 related loss reports

4 years agobgpd: suppress new libyang_1.0 related loss reports
Lou Berger [Tue, 18 Aug 2020 15:43:07 +0000 (11:43 -0400)]
bgpd: suppress new libyang_1.0 related loss reports

Signed-off-by: Lou Berger <lberger@labn.net>
4 years agoMerge pull request #6562 from ton31337/fix/configuration_for_labeled_unicast_in_place_7.2
Donald Sharp [Wed, 10 Jun 2020 22:53:13 +0000 (18:53 -0400)]
Merge pull request #6562 from ton31337/fix/configuration_for_labeled_unicast_in_place_7.2

bgpd: [7.2] Make sure network/aggregate-address commands lay down under labeled safi

4 years agobgpd: Make sure network/aggregate-address commands lay down under labeled safi
Donatas Abraitis [Thu, 30 Apr 2020 14:01:10 +0000 (17:01 +0300)]
bgpd: Make sure network/aggregate-address commands lay down under labeled safi

unicast and labeled-unicast share the same table, but configuration should
be visible for both independently. Without this fix it confuses a bit
because when you enter `network 10.0.0.0/24` under labeled-unicast it's
written in unicast family block.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6526 from ton31337/fix/set_ipv6_ll_if_global_zero_7.2
David Lamparter [Tue, 9 Jun 2020 14:42:20 +0000 (16:42 +0200)]
Merge pull request #6526 from ton31337/fix/set_ipv6_ll_if_global_zero_7.2

bgpd: [7.2] Use IPv6 LL address as nexthop if global was set to ::/LL

4 years agobgpd: Use IPv6 LL address as nexthop if global was set to ::/LL
Donatas Abraitis [Mon, 25 May 2020 14:22:37 +0000 (17:22 +0300)]
bgpd: Use IPv6 LL address as nexthop if global was set to ::/LL

This happens between Bird and FRR. Maybe others as well, dunno.

Bird sends ::(fe80::1588) and we have a nexthop as :: which is inaccessible:

```
BGP routing table entry for fdff:b87d:f5b0::/48
Paths: (1 available, no best path)
  Not advertised to any peer
  4242421588 4242422547 4242422601 4242423605
    :: (inaccessible) from fe80::1588 (172.20.16.140)
    (fe80::1588) (used)
      Origin IGP, invalid, external
      Last update: Mon May 25 14:27:02 2020
```

bgpd[9554]: fe80::1588 went from OpenConfirm to Established
bgpd[9554]: fe80::1588 [FSM] Timer (routeadv timer expire)
bgpd[9554]: fe80::1588 rcvd UPDATE w/ attr: , origin i, mp_nexthop ::(fe80::1588)
bgpd[9554]: fe80::1588 rcvd UPDATE wlen 0 attrlen 120 alen 0
bgpd[9554]: fe80::1588 rcvd fda9:26a9:1c47:2d42::/64 IPv6 unicast
bgpd[9554]: Allocated bnc ::/128(VRF default) peer 0x0
bgpd[9554]: bgp_update(0.0.0.0): NH unresolved
bgpd[9554]: fe80::1588 rcvd fda9:26a9:1c47:d42::/64 IPv6 unicast

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6395 from opensourcerouting/7.2/init-config-perms
Donatas Abraitis [Thu, 14 May 2020 20:07:07 +0000 (23:07 +0300)]
Merge pull request #6395 from opensourcerouting/7.2/init-config-perms

[7.2] build: use configfile mode in init script

4 years agobuild: use configfile mode in init script
David Lamparter [Mon, 11 May 2020 19:37:08 +0000 (21:37 +0200)]
build: use configfile mode in init script

This only applies for split-config;  the init script would create an
empty config file with default permissions.

Reported-by: Robert Scheck <robert@fedoraproject.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 5c9063771195bb51a8cc1c64f9924e53a0602817)

4 years agoMerge pull request #6360 from opensourcerouting/7.2/fix-warnings
Donald Sharp [Wed, 6 May 2020 17:49:55 +0000 (13:49 -0400)]
Merge pull request #6360 from opensourcerouting/7.2/fix-warnings

[7.2] fix random debian & SA warnings

4 years agonhrpd: clean up SA warning
Mark Stapp [Thu, 17 Oct 2019 13:52:51 +0000 (09:52 -0400)]
nhrpd: clean up SA warning

Try to signal to SA/clang more clearly to clean up an SA warning
in the nhrp-specific linkedlist code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agonhrpd: be more careful with linked lists
Mark Stapp [Wed, 16 Oct 2019 12:51:43 +0000 (08:51 -0400)]
nhrpd: be more careful with linked lists

NHRPD has its own linked-list implementation, and one of the
apis is a little free and easy with pointers. Also be safer
with one list iteration operation.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agodebian: Fix spelling error
Donald Sharp [Tue, 7 Jan 2020 01:36:13 +0000 (20:36 -0500)]
debian: Fix spelling error

Spelling error pointed out by debian build.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6284 from opensourcerouting/7.2/gcc-10
Mark Stapp [Wed, 6 May 2020 16:20:05 +0000 (12:20 -0400)]
Merge pull request #6284 from opensourcerouting/7.2/gcc-10

[7.2] backport gcc-10 fixes

4 years agoMerge pull request #6354 from ton31337/fix/communities_bgpd_crash_7.2
David Lamparter [Wed, 6 May 2020 11:37:02 +0000 (13:37 +0200)]
Merge pull request #6354 from ton31337/fix/communities_bgpd_crash_7.2

4 years agobgpd: Check to ensure community attributes exist before freeing them
Josh Cox [Tue, 5 May 2020 17:09:14 +0000 (13:09 -0400)]
bgpd: Check to ensure community attributes exist before freeing them

Community attributes might have been removed by an inbound route map, so we
should check to ensure they still exist before trying to free them.
This fixes a segfault described in issue #6345.

Signed-off-by: Josh Cox <josh.cox@pureport.com>
5 years agovrrpd: fix build on Fedora Rawhide
Ruben Kerkhof [Sat, 7 Mar 2020 22:38:14 +0000 (23:38 +0100)]
vrrpd: fix build on Fedora Rawhide

Fixes the following linker errors:
make[1]: Entering directory '/home/ruben/src/frr'
  CCLD     vrrpd/vrrpd
/usr/bin/ld: vrrpd/libvrrp.a(vrrp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: multiple definition of `vrrp_dbg_sock'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: multiple definition of `vrrp_dbg_pkt'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: multiple definition of `vrrp_dbg_proto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: multiple definition of `vrrp_dbg_zebra'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: multiple definition of `vrrp_dbg_auto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: multiple definition of `vrrp_dbg_ndisc'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: multiple definition of `vrrp_dbg_arp'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_arp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: multiple definition of `vrrp_dbg_arp'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_arp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: multiple definition of `vrrp_dbg_sock'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_arp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: multiple definition of `vrrp_dbg_zebra'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_arp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: multiple definition of `vrrp_dbg_proto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_arp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: multiple definition of `vrrp_dbg_pkt'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_arp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: multiple definition of `vrrp_dbg_ndisc'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_arp.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: multiple definition of `vrrp_dbg_auto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_debug.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: multiple definition of `vrrp_dbg_proto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_debug.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: multiple definition of `vrrp_dbg_auto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_debug.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: multiple definition of `vrrp_dbg_pkt'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_debug.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: multiple definition of `vrrp_dbg_sock'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_debug.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: multiple definition of `vrrp_dbg_ndisc'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_debug.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: multiple definition of `vrrp_dbg_arp'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_debug.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: multiple definition of `vrrp_dbg_zebra'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_ndisc.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: multiple definition of `vrrp_dbg_ndisc'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_ndisc.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: multiple definition of `vrrp_dbg_pkt'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_ndisc.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: multiple definition of `vrrp_dbg_sock'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_ndisc.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: multiple definition of `vrrp_dbg_zebra'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_ndisc.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: multiple definition of `vrrp_dbg_proto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_ndisc.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: multiple definition of `vrrp_dbg_auto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_ndisc.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: multiple definition of `vrrp_dbg_arp'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_packet.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: multiple definition of `vrrp_dbg_zebra'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_packet.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: multiple definition of `vrrp_dbg_sock'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_packet.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: multiple definition of `vrrp_dbg_proto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_packet.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: multiple definition of `vrrp_dbg_pkt'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_packet.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: multiple definition of `vrrp_dbg_ndisc'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_packet.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: multiple definition of `vrrp_dbg_auto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_packet.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: multiple definition of `vrrp_dbg_arp'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_vty.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: multiple definition of `vrrp_dbg_zebra'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_vty.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: multiple definition of `vrrp_dbg_sock'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_vty.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: multiple definition of `vrrp_dbg_proto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_vty.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: multiple definition of `vrrp_dbg_pkt'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_vty.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: multiple definition of `vrrp_dbg_ndisc'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_vty.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: multiple definition of `vrrp_dbg_auto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_vty.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: multiple definition of `vrrp_dbg_arp'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_zebra.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: multiple definition of `vrrp_dbg_zebra'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:34: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_zebra.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: multiple definition of `vrrp_dbg_sock'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:33: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_zebra.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: multiple definition of `vrrp_dbg_proto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:32: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_zebra.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: multiple definition of `vrrp_dbg_pkt'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:31: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_zebra.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: multiple definition of `vrrp_dbg_ndisc'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:30: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_zebra.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: multiple definition of `vrrp_dbg_auto'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:29: first defined here
/usr/bin/ld: vrrpd/libvrrp.a(vrrp_zebra.o):/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: multiple definition of `vrrp_dbg_arp'; vrrpd/vrrp_main.o:/home/ruben/src/frr/vrrpd/vrrp_debug.h:28: first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:6639: vrrpd/vrrpd] Error 1
make[1]: Leaving directory '/home/ruben/src/frr'
make: *** [Makefile:4525: all] Error 2

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
(cherry picked from commit 744f2650c4e7b6dd5075c31dc8e1638269a6f601)

5 years agobabeld: GCC complaining about no return in non-void function
Donald Sharp [Thu, 13 Feb 2020 13:44:40 +0000 (08:44 -0500)]
babeld: GCC complaining about no return in non-void function

The babel_main_loop function did not have a return for
a non-void function.  For some reason gcc is starting to complain
about this now.

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

5 years agobabeld: fix build on Fedora Rawhide
Ruben Kerkhof [Sat, 7 Mar 2020 22:51:34 +0000 (23:51 +0100)]
babeld: fix build on Fedora Rawhide

Fixes the following linker errors:
/usr/bin/ld: babeld/libbabel.a(babel_interface.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(babel_zebra.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(babeld.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(kernel.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(message.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(neighbour.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(net.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(resend.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(route.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(source.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(util.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(xroute.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
/usr/bin/ld: babeld/libbabel.a(babel_filter.o):/home/ruben/src/frr/babeld/util.h:125: multiple definition of `v4prefix'; babeld/babel_main.o:/home/ruben/src/frr/babeld/util.h:125: first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:6015: babeld/babeld] Error 1

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
(cherry picked from commit b0ba81f81f5fff158e756ef52c91f8c6179872e6)

5 years agobgpd: remove unused variable
Ruben Kerkhof [Sat, 7 Mar 2020 22:19:13 +0000 (23:19 +0100)]
bgpd: remove unused variable

This fixes a linking issue on Fedora Rawhide:
/usr/bin/ld: bgpd/libbgp.a(bgp_flowspec.o):/home/ruben/src/frr/./bgpd/bgp_attr_evpn.h:37: multiple definition of `eth_tag_id'; bgpd/bgp_btoa-bgp_btoa.o:/home/ruben/src/frr/./bgpd/bgp_attr_evpn.h:37: first defined here
collect2: error: ld returned 1 exit status

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
(cherry picked from commit 01feb0907f6e7f72fbd973dba1ea69489f11a9c7)

5 years agopimd: Make frr able to be built by gcc 10
Tomas Korbar [Thu, 20 Feb 2020 06:37:55 +0000 (07:37 +0100)]
pimd: Make frr able to be built by gcc 10

- Add extern modifier to some declarations in header file and move
qpim_all_pim_routers_addr definition to pimd/pimd.c

`GCC now defaults to -fno-common. As a result, global variable accesses
are more efficient on various targets. In C, global variables with
multiple tentative definitions now result in linker errors.`
Taken from https://gcc.gnu.org/gcc-10/changes.html

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
(cherry picked from commit 403242d214b6cb919ed08f2149d7bee77a060947)

5 years agoldpd: remove multiple definitions of thread_master
Ruben Kerkhof [Sun, 8 Mar 2020 19:21:05 +0000 (20:21 +0100)]
ldpd: remove multiple definitions of thread_master

This fixes the last issue compiling FRR with GCC 10 on Fedora Rawhide.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
(cherry picked from commit f3faea7fe3bf5f73991effe56290346e3f43728e)

5 years agoldpd: fix another linking issue with GCC-10
Ruben Kerkhof [Sun, 8 Mar 2020 19:17:42 +0000 (20:17 +0100)]
ldpd: fix another linking issue with GCC-10

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
(cherry picked from commit 54ca644b6e20416587484011f8e649eeddf2cb15)

5 years agotests: fix build with GCC 10
Ruben Kerkhof [Sun, 8 Mar 2020 16:17:49 +0000 (17:17 +0100)]
tests: fix build with GCC 10

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
(cherry picked from commit 9635de6e9b8cbc35f5ec62d4d1dc8b6c72df8c45)

5 years agoldpd: Fix linking error on Fedora Rawhide with GCC 10
Ruben Kerkhof [Sun, 8 Mar 2020 14:34:40 +0000 (15:34 +0100)]
ldpd: Fix linking error on Fedora Rawhide with GCC 10

GCC 10 switched to -fno-common by default, see
https://gcc.gnu.org/gcc-10/porting_to.html#common for details.

Fixes:
  CCLD     ldpd/ldpd
/usr/bin/ld: ldpd/libldp.a(adjacency.o):/home/ruben/src/frr/ldpd/ldpe.h:294: multiple definition of `pkt_ptr'; ldpd/ldpd.o:/home/ruben/src/frr/ldpd/ldpe.h:294: first defined here

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
(cherry picked from commit 56b7d7252f13f3c90c824287b2441f13e2b0defe)

5 years agoMerge pull request #5891 from sworleys/stable-7.2-Fix-Kernel-Del-VRF
Mark Stapp [Tue, 3 Mar 2020 13:42:20 +0000 (08:42 -0500)]
Merge pull request #5891 from sworleys/stable-7.2-Fix-Kernel-Del-VRF

[7.2] zebra: add vrf_id to nexthop from netlink route delete

5 years agozebra: add vrf_id to nexthop from netlink route delete
Stephen Worley [Mon, 2 Mar 2020 20:38:07 +0000 (15:38 -0500)]
zebra: add vrf_id to nexthop from netlink route delete

When we backported 760f39dc082c6739d342225cd71863ada9471a87
on the 7.2 stable branch with 31d682a2ee647fdc0636bebb8129e3cf5922151f

we had to do quite a bit of modification to get the commit
to fit since the codepaths changed so much. When doing so,
we missed adding the vrf_id to the nexthop struct before
sending it into `rib_delete()` and instead added it incorrectly
to `rib_delete()` API. The `vrf_id` in `rib_delete()` should correspond
to the route's `vrf_id` whereas the nexthop should be set with the
one we determined from `nh_vrf_id`.

This patch fixes that by setting it after its determined above and
reverting the `rib_delete()` call to use the route's `vrf_id`.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agoMerge pull request #5724 from donaldsharp/7.2_missing_pref_src
Mark Stapp [Thu, 6 Feb 2020 13:28:51 +0000 (08:28 -0500)]
Merge pull request #5724 from donaldsharp/7.2_missing_pref_src

[7.2]zebra: fix kernel-route's deletion on vrf

5 years agozebra: fix kernel-route's deletion on vrf
Hiroki Shirokura [Fri, 24 Jan 2020 04:45:54 +0000 (23:45 -0500)]
zebra: fix kernel-route's deletion on vrf

zebra can catch the kernel's route deletion by netlink.
but current FRR can't delete kernel-route on vrf(l3mdev)
when kernel operator delete the route on out-side of FRR.
It looks problem about kernel-route deletion.

This problem is caused around _nexthop_cmp_no_labels(nh1,nh2)
that checks the each nexthop's member 'vrf_id'.
And _nexthop_cmp_no_labels's caller doesn't set the vrf_id
of nexthop structure. This commit fix that case.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5729 from opensourcerouting/72_fix_centos6
Donatas Abraitis [Sat, 25 Jan 2020 03:03:01 +0000 (05:03 +0200)]
Merge pull request #5729 from opensourcerouting/72_fix_centos6

[7.2] lib: Fix missing __be16 typedef on CentOS6

5 years agolib: Fix missing __be16 typedef on CentOS6
Martin Winter [Mon, 20 Jan 2020 14:40:49 +0000 (15:40 +0100)]
lib: Fix missing __be16 typedef on CentOS6

Need to include linux/types.h on older Linux

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 years agoFRRouting Release 7.2.1 frr-7.2.1
Martin Winter [Fri, 17 Jan 2020 16:18:19 +0000 (17:18 +0100)]
FRRouting Release 7.2.1
(Maintenance Release)

- BGPd
-   Fix Addpath issue
-   Do not apply eBGP policy for iBGP peers
-   Show `ip` and `fqdn` in json output for `show [ip] bgp <route> json`
-   Fix large route-distinguisher's format
-   Fix `no bgp listen range ...` configuration command
-   Autocomplete neighbor for clear bgp
-   Reflect the distance in RIB when it is changed for an arbitrary afi/safi
-   Notify "Peer De-configured" after entering 'no neighbor <neighbor> cmd
-   Fix per afi/safi addpath peer counting
-   Rework BGP dampening to be per AFI/SAFI
-   Do not send next-hop as :: in MP_REACH_NLRI if no link-local exists
-   Override peer's TTL only if peer-group is configured with TTL
-   Remove error message for unkown afi/safi combination
-   Keep the session down if maximum-prefix is reached
- OSPFd
-   Fix BFD down not tearing down OSPF adjacency for point-to-point net
- BFDd
-   Fix multiple VRF handling
-   VRF security improvement
- PIMd
-   Fix rp crash
- NHRPd
-   Make sure `no ip nhrp map <something>` works as expected
- LDPd
-   Add missing sanity check in the parsing of label messages
- Zebra
-   Use correct state when installing evpn macs
-   Capture dplane plugin flags
- lib
-   Fix interface config when vrf changes
-   Fix Interface Infinite Loop Walk (for special interfaces such as bond)
- snapcraft
-   fix missing vrrpd daemon
- Others
-   Rename man pages (to avoid conflicts with other packages)
-   Various other fixes for code cleanup and memory leaks

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 years agoMerge pull request #5696 from qlyoung/stable-7.2-backport-more
David Lamparter [Thu, 16 Jan 2020 21:24:27 +0000 (22:24 +0100)]
Merge pull request #5696 from qlyoung/stable-7.2-backport-more

More 7.2 bugfix backports

5 years agopimd: readd iph length checks
Quentin Young [Sun, 22 Dec 2019 01:19:47 +0000 (20:19 -0500)]
pimd: readd iph length checks

Kernel might not hand us a bad packet, but better safe than sorry here.
Validate the IP header length field. Also adds an additional check that
the packet length is sufficient for an IGMP packet, and a check that we
actually have enough for an ip header at all.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agopimd: fix missing igmp mtrace length check
Quentin Young [Sun, 22 Dec 2019 02:02:15 +0000 (21:02 -0500)]
pimd: fix missing igmp mtrace length check

We check that the IGMP message is sufficently sized for an mtrace query,
but not a response, leading to uninitialized stack read.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoospfd: sizeof(pointer) -> sizeof(pointed-at)
Quentin Young [Thu, 12 Dec 2019 05:13:58 +0000 (00:13 -0500)]
ospfd: sizeof(pointer) -> sizeof(pointed-at)

14 years old eh?

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoospfd: fix misplaced trust in ip header length
Quentin Young [Thu, 12 Dec 2019 05:09:39 +0000 (00:09 -0500)]
ospfd: fix misplaced trust in ip header length

We actually don't validate the IHL field, although it certainly looks
like we do at a casual glance.

This patch saves us from an assert in case we actually do get an IP
packet with an incorrect header length field.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: more attribute parsing cleanup & paranoia
Quentin Young [Tue, 3 Dec 2019 20:48:27 +0000 (15:48 -0500)]
bgpd: more attribute parsing cleanup & paranoia

* Move VNC interning to the appropriate spot
* Use existing bgp_attr_flush_encap to free encap sets
* Assert that refcounts are correct before exiting to keep the demons
  contained in their fiery prison

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: remove bgp_attr_dup
Quentin Young [Tue, 3 Dec 2019 21:01:19 +0000 (16:01 -0500)]
bgpd: remove bgp_attr_dup

yeah

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agolib: fix heap buf overflow when adding prefix orf
Quentin Young [Tue, 3 Dec 2019 18:12:25 +0000 (13:12 -0500)]
lib: fix heap buf overflow when adding prefix orf

Don't lose your way

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: clean up attribute parsing state before ret
Quentin Young [Tue, 26 Nov 2019 19:42:40 +0000 (14:42 -0500)]
bgpd: clean up attribute parsing state before ret

Early exits without appropriate cleanup were causing obscure double
frees and other issues later on in the attribute parsing code. If we
return anything except a hard attribute parse error, we have cleanup and
refcounts to manage.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: ensure transit ptr is nulled on free
Quentin Young [Tue, 26 Nov 2019 19:42:26 +0000 (14:42 -0500)]
bgpd: ensure transit ptr is nulled on free

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: fix bad bounds check for addpath in nlri
Quentin Young [Sun, 24 Nov 2019 07:02:54 +0000 (02:02 -0500)]
bgpd: fix bad bounds check for addpath in nlri

If a peer advertised capability addpath in their OPEN, but sent us an
UPDATE without an ADDPATH, we overflow a heap buffer.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: fix heap buffer overflow in lcom -> str enc
Quentin Young [Thu, 21 Nov 2019 23:55:59 +0000 (18:55 -0500)]
bgpd: fix heap buffer overflow in lcom -> str enc

Spaces were not being accounted for in the heap buffer sizing, leading
to a heap buffer overflow when encoding large communities to their
string representations.

This patch also uses safer functions to do the encoding instead of
pointer math.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: use safe functions to work with ecom attrs
Quentin Young [Fri, 22 Nov 2019 00:01:55 +0000 (19:01 -0500)]
bgpd: use safe functions to work with ecom attrs

Tons of insane just-so pointer math here where it is not needed. This is
too smart. Use safer methods.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: remove extra ecom attr ptr increment
Quentin Young [Fri, 22 Nov 2019 00:00:11 +0000 (19:00 -0500)]
bgpd: remove extra ecom attr ptr increment

Copy paste leads to invalid read of 1 byte off the heap when converting
extended community attributes into strings.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: [7.2] fix unaligned access to addpath id (#5693)
David Lamparter [Thu, 16 Jan 2020 13:30:57 +0000 (14:30 +0100)]
bgpd: [7.2] fix unaligned access to addpath id (#5693)

bgpd: [7.2] fix unaligned access to addpath id

5 years agoMerge pull request #5689 from ton31337/fix/addpath_adj_out_look_compare_id_7.2
Donald Sharp [Thu, 16 Jan 2020 12:17:59 +0000 (07:17 -0500)]
Merge pull request #5689 from ton31337/fix/addpath_adj_out_look_compare_id_7.2

bgpd: [7.2] add addpath ID to adj_out tree sort

5 years agobgpd: fix unaligned access to addpath id
Santosh P K [Tue, 7 Jan 2020 15:47:13 +0000 (07:47 -0800)]
bgpd: fix unaligned access to addpath id

uint8_t * cannot be cast to uint32_t * unless the
pointed-to address is aligned according to uint32_t's
alignment rules. And it usually is not.

Signed-off-by: Santosh P K <sapk@vmware.com>
5 years agoStable 7.2 backport edible arrangement (#5687)
David Lamparter [Thu, 16 Jan 2020 10:39:21 +0000 (11:39 +0100)]
Stable 7.2 backport edible arrangement (#5687)

Stable 7.2 backport edible arrangement

5 years agobgpd: add addpath ID to adj_out tree sort
Mitchell Skiba [Thu, 9 Jan 2020 19:46:13 +0000 (11:46 -0800)]
bgpd: add addpath ID to adj_out tree sort

When withdrawing addpaths, adj_lookup was called to find the path that
needed to be withdrawn. It would lookup in the RB tree based on subgroup
pointer alone, often find the path with the wrong addpath ID, and return
null.  Only the path highest in the tree sent to the subgroup could be
found, thus withdrawn.

Adding the addpath ID to the sort criteria for the RB tree allows us to
simplify the logic for adj_lookup, and address this problem. We are able
to remove the logic around non-addpath subgroups because the addpath ID
is consistently 0 for non-addpath adj_outs, so special logic to skip
matching the addpath ID isn't required.  (As a side note, addpath will
also never use ID 0, so there won't be any ambiguity when looking at the
structure content.)

Signed-off-by: Mitchell Skiba <mskiba@amazon.com>
5 years agoMerge pull request #5685 from opensourcerouting/7.2/manpage-rename
Donatas Abraitis [Wed, 15 Jan 2020 18:38:08 +0000 (20:38 +0200)]
Merge pull request #5685 from opensourcerouting/7.2/manpage-rename

[7.2] doc: manpage rename

5 years agobgpd: fix memory leak when parsing capabilities
Quentin Young [Wed, 15 Jan 2020 18:00:34 +0000 (13:00 -0500)]
bgpd: fix memory leak when parsing capabilities

Duplicated domain name capability messages cause memory leak. The amount
of leaked memory is proportional to the size of the duplicated
capabilities. This bug was introduced in 2015.

To hit this, a BGP OPEN message must contain multiple FQDN capabilities.
Memory is leaked when the hostname portion of the capability is of
length 0, but the domainname portion is not, for any of the duplicated
capabilities beyond the first one.

https://tools.ietf.org/html/draft-walton-bgp-hostname-capability-00

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: bfd message handling cleanup foo
Quentin Young [Tue, 14 Jan 2020 18:55:55 +0000 (13:55 -0500)]
zebra: bfd message handling cleanup foo

Previous patches introduced various issues:
- Removal of stream_free() to fix double free caused memleak
- Patch for memleak was incomplete

This should fix it hopefully.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: fix bfd deregister message memleak
Quentin Young [Thu, 9 Jan 2020 23:50:18 +0000 (18:50 -0500)]
zebra: fix bfd deregister message memleak

Removing double frees accidentally introduced a memleak

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: avoid memcmp(NULL, NULL)
Quentin Young [Tue, 7 Jan 2020 05:51:35 +0000 (00:51 -0500)]
bgpd: avoid memcmp(NULL, NULL)

Undefined behavior

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: fix unaligned access to addpath id
Quentin Young [Tue, 7 Jan 2020 01:09:23 +0000 (20:09 -0500)]
bgpd: fix unaligned access to addpath id

uint8_t * cannot be cast to uint32_t * unless the pointed-to address is
aligned according to uint32_t's alignment rules. And it usually is not.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: fix ptm heap double free
Quentin Young [Tue, 7 Jan 2020 00:48:08 +0000 (19:48 -0500)]
zebra: fix ptm heap double free

Don't need to free these, they're freed by the caller.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: free ptm message on error
Quentin Young [Mon, 6 Jan 2020 17:09:23 +0000 (12:09 -0500)]
zebra: free ptm message on error

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: fix undefined bitshifts in netlink stuff
Quentin Young [Fri, 3 Jan 2020 21:39:57 +0000 (16:39 -0500)]
zebra: fix undefined bitshifts in netlink stuff

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: reject ingress packets that are too large
Quentin Young [Sat, 4 Jan 2020 02:22:44 +0000 (21:22 -0500)]
zebra: reject ingress packets that are too large

There may be logic to prevent this ever happening earlier in the network
read path, but it doesn't hurt to double check it here, because clearly
deeper paths rely on this being the case.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: fix multiple bfd buffer issues
Quentin Young [Sat, 4 Jan 2020 02:18:49 +0000 (21:18 -0500)]
zebra: fix multiple bfd buffer issues

Whatever this BFD re-transmission function is had a few problems.

1. Used memcpy instead of the (more concise) stream APIs, which include
   bounds checking.
2. Did not sufficiently check packet sizes.

Actually, 2) is mitigated but is still a problem, because the BFD header
is 2 bytes larger than the "normal" ZAPI header, while the overall
message size remains the same. So if the source message being duplicated
is actually right up against the ZAPI_MAX_PACKET_SIZ, you still can't
fit the whole message into your duplicated message. I have no idea what
the intent was here but at least there's a warning if it happens now.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: null terminate interface name from wire
Quentin Young [Sat, 4 Jan 2020 03:30:33 +0000 (22:30 -0500)]
zebra: null terminate interface name from wire

We read an ifname from the wire but don't make sure its null terminated,
fix it

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: fix iptable memleak, fix free funcs
Quentin Young [Sat, 4 Jan 2020 03:28:53 +0000 (22:28 -0500)]
zebra: fix iptable memleak, fix free funcs

- Fix iptable freeing code to free malloc'd list
- malloc iptable in zapi handler and use those functions to free it when
  done to fix a linked list memleak

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: ensure ipset name is null terminated
Quentin Young [Sat, 4 Jan 2020 02:40:30 +0000 (21:40 -0500)]
zebra: ensure ipset name is null terminated

We copy a fixed length buffer from the wire but don't ensure it is null
terminated. Then print it as a c-string. Lul.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: disallow negative rtadv intvl, fix overflow
Quentin Young [Sat, 4 Jan 2020 01:26:09 +0000 (20:26 -0500)]
zebra: disallow negative rtadv intvl, fix overflow

- Disallow RA interval < 0
- Fix integer overflow issue converting interval to seconds from
  milliseconds
- Add missing "m" to "ms"

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agolib: fix ifindex comparison overflow
Quentin Young [Sat, 4 Jan 2020 00:25:38 +0000 (19:25 -0500)]
lib: fix ifindex comparison overflow

Very small (negative!) ifindexes, when subtracted, can overflow.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: check pbr rule msg for correct afi
Quentin Young [Fri, 3 Jan 2020 07:12:58 +0000 (02:12 -0500)]
zebra: check pbr rule msg for correct afi

further down we hash the src & dst ip, which asserts that the afi is one
of the well known ones, given the field names i assume the correct afis
here are af_inet[6]

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: use correct attr size for netlink enc
Quentin Young [Fri, 3 Jan 2020 07:12:12 +0000 (02:12 -0500)]
zebra: use correct attr size for netlink enc

a bool is not 4 bytes

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoospfclient: don't install man page
David Lamparter [Wed, 15 Jan 2020 11:22:26 +0000 (12:22 +0100)]
ospfclient: don't install man page

... we're not installing ospfclient (it's a demo/example program), so
installing the man page is quite useless.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agodoc: rename man pages to frr-*
David Lamparter [Tue, 14 Jan 2020 23:00:32 +0000 (00:00 +0100)]
doc: rename man pages to frr-*

The vrrpd one conflicts with the standalone vrrpd package; also we're
installing daemons to /usr/lib/frr on some systems so they're not on
PATH.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #5647 from LabNConsulting/working/lb/7.2/tt-update
Donald Sharp [Tue, 7 Jan 2020 19:00:03 +0000 (14:00 -0500)]
Merge pull request #5647 from LabNConsulting/working/lb/7.2/tt-update

7.2: bgp_l3vpn_to_bgp_vrf: allow for change in 'ip add show vrf' output format

5 years agoMerge pull request #5569 from ton31337/fix/ebgp-requires-policy_with_ibgp_7.2
Donald Sharp [Tue, 7 Jan 2020 18:59:36 +0000 (13:59 -0500)]
Merge pull request #5569 from ton31337/fix/ebgp-requires-policy_with_ibgp_7.2

bgpd: [7.2] Do not apply eBGP policy for iBGP peers

5 years agoMerge pull request #5544 from ton31337/fix/rr_do_not_show_fqdn_7.2
Donald Sharp [Tue, 7 Jan 2020 18:57:49 +0000 (13:57 -0500)]
Merge pull request #5544 from ton31337/fix/rr_do_not_show_fqdn_7.2

 bgpd: [7.2] Show `ip` and `fqdn` in json output for `show [ip] bgp <route> json`

5 years agotopotest: bgp_l3vpn_to_bgp_vrf allow for different interface output
Lou Berger [Sun, 22 Sep 2019 17:06:48 +0000 (13:06 -0400)]
topotest: bgp_l3vpn_to_bgp_vrf allow for different interface output

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agoMerge pull request #5642 from slankdev/slankdev-bgpd-fix-large-rd-frr-7-2
Donatas Abraitis [Tue, 7 Jan 2020 09:11:55 +0000 (11:11 +0200)]
Merge pull request #5642 from slankdev/slankdev-bgpd-fix-large-rd-frr-7-2

bgpd: [7.2] fix large route-distinguisher's format

5 years agobgpd: fix large route-distinguisher's format
Hiroki Shirokura [Sun, 5 Jan 2020 13:56:14 +0000 (22:56 +0900)]
bgpd: fix large route-distinguisher's format

This commit is about #5629 's issue.
Before this commit, bgpd creates format string of
bgp-route-distinguisher as int32, but correctly format
is uint32. current bgpd's sh-run-cli generate int32 rd,
so if user sets the rd as 1:4294967295(0x1:0xffffffff),
sh-run cli generates 1: -1 as running-config. This
commit fix that issue.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
5 years agoMerge pull request #5575 from ton31337/fix/no_bgp_listen_range_peer-group_7.2
Quentin Young [Fri, 20 Dec 2019 15:37:37 +0000 (10:37 -0500)]
Merge pull request #5575 from ton31337/fix/no_bgp_listen_range_peer-group_7.2

bgpd: [7.2] Make sure we can use `no bgp listen range ...`

5 years agobgpd: Make sure we can use `no bgp listen range ...`
Donatas Abraitis [Thu, 19 Dec 2019 20:09:47 +0000 (22:09 +0200)]
bgpd: Make sure we can use `no bgp listen range ...`

Fixes:
```
exit1-debian-9(config-router)# no bgp listen range 192.168.10.0/24 peer-group TEST
% Peer-group does not exist
exit1-debian-9(config-router)#
```
Closes https://github.com/FRRouting/frr/issues/5570

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Do not apply eBGP policy for iBGP peers
Donatas Abraitis [Thu, 19 Dec 2019 08:51:13 +0000 (10:51 +0200)]
bgpd: Do not apply eBGP policy for iBGP peers

Treat iBGP peers as they have a policy applied.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agotests: Test if eBGP policy is not applied to iBGP peers
Donatas Abraitis [Thu, 19 Dec 2019 08:53:05 +0000 (10:53 +0200)]
tests: Test if eBGP policy is not applied to iBGP peers

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5562 from mjstapp/fix_test_typelist_7_2
Quentin Young [Thu, 19 Dec 2019 16:00:50 +0000 (11:00 -0500)]
Merge pull request #5562 from mjstapp/fix_test_typelist_7_2

[7.2] tests: fix endian bug in test_typelist

5 years agotests: fix endian bug in test_typelist
Mark Stapp [Wed, 18 Dec 2019 15:52:08 +0000 (10:52 -0500)]
tests: fix endian bug in test_typelist

[7.2 version] Fix a byte-swapping bug that appeared on
big-endian arch but wasn't visible on little-endian.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agobgpd: Show `ip` and `fqdn` in json output for `show [ip] bgp <route> json`
Donatas Abraitis [Fri, 6 Dec 2019 20:03:50 +0000 (22:03 +0200)]
bgpd: Show `ip` and `fqdn` in json output for `show [ip] bgp <route> json`

This should keep backward compatibility when bgp show-hostname is
enabled/disabled.

Also show the real originator IP instead of showing fqdn of the route
reflector.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agotests: Test if `ip` and `fqdn` are included in `show [ip] bgp json`
Donatas Abraitis [Fri, 6 Dec 2019 20:44:36 +0000 (22:44 +0200)]
tests: Test if `ip` and `fqdn` are included in `show [ip] bgp json`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5518 from mjstapp/fix_evpn_state_7_2
Donald Sharp [Tue, 10 Dec 2019 22:14:46 +0000 (17:14 -0500)]
Merge pull request #5518 from mjstapp/fix_evpn_state_7_2

[7.2] zebra: use correct state when installing evpn macs

5 years agozebra: use correct state when installing evpn macs
Mark Stapp [Tue, 10 Dec 2019 15:10:56 +0000 (10:10 -0500)]
zebra: use correct state when installing evpn macs

[7.2 version] Use correct state/flags when installing EVPN macs;
when we converted from raw netlink to the zebra dataplane, a
state value got lost.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #5505 from m-varasteh/fix-if_update_to_new_vrf
Renato Westphal [Mon, 9 Dec 2019 13:32:53 +0000 (10:32 -0300)]
Merge pull request #5505 from m-varasteh/fix-if_update_to_new_vrf

lib: set entry to xpath in if_update_to_new_vrf

5 years agolib: set entry to xpath in if_update_to_new_vrf
Mahdi Varasteh [Sun, 8 Dec 2019 13:03:14 +0000 (16:33 +0330)]
lib: set entry to xpath in if_update_to_new_vrf

when vrf is changed, we change the interface running configuration
without using northbound layer. it causes the nb_running_get_entry to fail

Signed-off-by: Mahdi Varasteh <mahdy.varasteh@gmail.com>
5 years agoMerge pull request #5480 from mjstapp/fix_dplane_prov_flags_7_2
Jafar Al-Gharaibeh [Fri, 6 Dec 2019 05:01:41 +0000 (23:01 -0600)]
Merge pull request #5480 from mjstapp/fix_dplane_prov_flags_7_2

[7.2] zebra: capture dplane plugin flags

5 years agozebra: capture dplane plugin flags
Mark Stapp [Thu, 5 Dec 2019 21:33:51 +0000 (16:33 -0500)]
zebra: capture dplane plugin flags

[7.2 version]
The flags can be important - like "threaded" - so we need to
actually capture them when plugins are registered.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #5469 from k0ste/stable_7.2_backports
Donald Sharp [Wed, 4 Dec 2019 19:13:13 +0000 (14:13 -0500)]
Merge pull request #5469 from k0ste/stable_7.2_backports

[7.2] bgpd: Autocomplete neighbor for clear bgp

5 years agobgpd: Autocomplete neighbor for clear bgp
Donatas Abraitis [Wed, 27 Nov 2019 19:44:46 +0000 (21:44 +0200)]
bgpd: Autocomplete neighbor for clear bgp

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

5 years ago[7.2]bgpd: Prevent crash in bgp_table_range_lookup (#5454)
David Lamparter [Wed, 4 Dec 2019 00:48:37 +0000 (01:48 +0100)]
[7.2]bgpd: Prevent crash in bgp_table_range_lookup (#5454)

[7.2]bgpd: Prevent crash in bgp_table_range_lookup

Co-authored-by: Mark Stapp <mjs@voltanet.io>
5 years agoospfd,eigrpd: don't take address of packed struct member
Mark Stapp [Mon, 11 Nov 2019 17:22:38 +0000 (12:22 -0500)]
ospfd,eigrpd: don't take address of packed struct member

Use a local variable to avoid trying to take the address
of a packed struct member - an address from the ip header
in these cases.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agobgpd: Prevent crash in bgp_table_range_lookup
Donald Sharp [Mon, 2 Dec 2019 14:37:47 +0000 (09:37 -0500)]
bgpd: Prevent crash in bgp_table_range_lookup

The function bgp_table_range_lookup attempts to walk down
the table node data structures to find a list of matching
nodes.  We need to guard against the current node from
not matching and not having anything in the child nodes.
Add a bit of code to guard against this.

Traceback that lead me down this path:

Nov 24 12:22:38 frr bgpd[20257]: Received signal 11 at 1574616158 (si_addr 0x2, PC 0x46cdc3); aborting...
Nov 24 12:22:38 frr bgpd[20257]: Backtrace for 11 stack frames:
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(zlog_backtrace_sigsafe+0x67) [0x7fd1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(zlog_signal+0x113) [0x7fd1ad445db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(+0x70e65) [0x7fd1ad465e65]ad445db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libpthread.so.0(+0xf5f0) [0x7fd1abd605f0]45db3]1ad445957]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd(bgp_table_range_lookup+0x63) [0x46cdc3]445957]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib64/frr/modules/bgpd_rpki.so(+0x4f0d) [0x7fd1a934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(thread_call+0x60) [0x7fd1ad4736e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libfrr.so.0(frr_run+0x128) [0x7fd1ad443ab8]e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd(main+0x2e3) [0x41c043]1ad443ab8]e0]934ff0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /lib64/libc.so.6(__libc_start_main+0xf5) [0x7fd1ab9a5505]f0d]57]
Nov 24 12:22:38 frr bgpd[20257]: /usr/lib/frr/bgpd() [0x41d9bb]main+0xf5) [0x7fd1ab9a5505]f0d]57]
Nov 24 12:22:38 frr bgpd[20257]: in thread bgpd_sync_callback scheduled from bgpd/bgp_rpki.c:351#012; aborting...
Nov 24 12:22:38 frr watchfrr[6779]: [EC 268435457] bgpd state -> down : read returned EOF
Nov 24 12:22:38 frr zebra[5952]: [EC 4043309116] Client 'bgp' encountered an error and is shutting down.
Nov 24 12:22:38 frr zebra[5952]: zebra/zebra_ptm.c:1345 failed to find process pid registration
Nov 24 12:22:38 frr zebra[5952]: client 15 disconnected. 0 bgp routes removed from the rib

I am not really 100% sure what we are really trying to do with this function, but we must
guard against child nodes not having any data.

Fixes: #5440
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5447 from donaldsharp/7.2_bgp_show_json_mem_leak
Donatas Abraitis [Mon, 2 Dec 2019 07:59:37 +0000 (09:59 +0200)]
Merge pull request #5447 from donaldsharp/7.2_bgp_show_json_mem_leak

[7.2]bgpd: Fix memory leak in json output of show commands