]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoMerge pull request #5662 from qlyoung/fix-ptm-bfd-deregister-memleak
Mark Stapp [Fri, 10 Jan 2020 21:59:20 +0000 (16:59 -0500)]
Merge pull request #5662 from qlyoung/fix-ptm-bfd-deregister-memleak

zebra: fix bfd deregister message memleak

4 years agoMerge pull request #5661 from ton31337/fix/doc_for_redhat
Quentin Young [Fri, 10 Jan 2020 18:44:21 +0000 (13:44 -0500)]
Merge pull request #5661 from ton31337/fix/doc_for_redhat

doc: Replace wrong paths for centos/fedora source build instructions

4 years agoMerge pull request #5609 from kooky/fix_log
Quentin Young [Fri, 10 Jan 2020 01:55:05 +0000 (20:55 -0500)]
Merge pull request #5609 from kooky/fix_log

Fix logrotate in debian for bfdd, pbrd and vrrpd.

4 years agodebian: Fix logrotate in debian for bfdd, pbrd and vrrpd.
Tim Bray [Thu, 2 Jan 2020 20:00:07 +0000 (20:00 +0000)]
debian: Fix logrotate in debian for bfdd, pbrd and vrrpd.

Signed-off-by: Tim Bray <tim@kooky.org>
4 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>
4 years agodoc: Replace wrong paths for centos/fedora source build instructions
Donatas Abraitis [Thu, 9 Jan 2020 22:11:09 +0000 (00:11 +0200)]
doc: Replace wrong paths for centos/fedora source build instructions

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5410 from ton31337/feature/bgp_default-route_with_route-map_set
Donald Sharp [Thu, 9 Jan 2020 13:39:32 +0000 (08:39 -0500)]
Merge pull request #5410 from ton31337/feature/bgp_default-route_with_route-map_set

bgpd: An ability to set attributes for default-originate via route-map

4 years agoMerge pull request #5560 from sworleys/Pim-Vrf-Hang-3
Mark Stapp [Wed, 8 Jan 2020 20:14:40 +0000 (15:14 -0500)]
Merge pull request #5560 from sworleys/Pim-Vrf-Hang-3

lib,zebra: add zapi msg top level error handling

4 years agoMerge pull request #5418 from qlyoung/fix-bgp-prefix-sid-missing-boundscheck
Donatas Abraitis [Wed, 8 Jan 2020 19:59:07 +0000 (21:59 +0200)]
Merge pull request #5418 from qlyoung/fix-bgp-prefix-sid-missing-boundscheck

bgpd: fix missing bounds checks for psid attr

4 years agopimd: lookup nh using vrf_id we checked before
Stephen Worley [Mon, 16 Dec 2019 22:40:41 +0000 (17:40 -0500)]
pimd: lookup nh using vrf_id we checked before

Update zclient_lookup_nexthop_once() to create the zapi
header using the vrf_id on the pim->vrf struct.

This is the one we do a check on a couple lines before, so
we should be using it when we actually create the header as
well.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopimd: allow pimd to handle nexthop_lookup zapi error
Stephen Worley [Fri, 13 Dec 2019 01:14:51 +0000 (20:14 -0500)]
pimd: allow pimd to handle nexthop_lookup zapi error

Allow pimd to stop the lookup if zebra tells pimd that the
lookup failed due to a zapi error. Otherwise, it will keep
waiting for a nexthop message that will never come.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,zebra: add zapi msg top level error handling
Stephen Worley [Tue, 17 Dec 2019 22:00:52 +0000 (17:00 -0500)]
lib,zebra: add zapi msg top level error handling

Add error handling for top level failures (not able to
execute command, unable to find vrf for command, etc.)

With this error handling we add a new zapi message type
of ZEBRA_ERROR used when we are unable to properly handle
a zapi command and pass it down into the lower level code.

In the event of this, we reply with a message of type
enum zebra_error_types containing the error type.

The sent packet will look like so:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Length            |     Marker    |    Version    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             VRF ID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Command            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            ERROR TYPE         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Also add appropriate hooks for clients to subscribe to for
handling these types of errors.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #5551 from mjstapp/fix_zebra_show_nhg
Donald Sharp [Wed, 8 Jan 2020 16:54:01 +0000 (11:54 -0500)]
Merge pull request #5551 from mjstapp/fix_zebra_show_nhg

zebra: make current show nexthop-group cli zebra-specific

4 years agozebra: make current show nexthop-group cli zebra-specific
Mark Stapp [Tue, 17 Dec 2019 16:31:17 +0000 (11:31 -0500)]
zebra: make current show nexthop-group cli zebra-specific

There's confusion between the nexthop-group configuration and a
zebra-specific show command. For now, make the zebra show
command string RIB-specific until we're able to unify these
paths.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5260 from donaldsharp/evpn_mac_daddy
Donatas Abraitis [Wed, 8 Jan 2020 06:59:51 +0000 (08:59 +0200)]
Merge pull request #5260 from donaldsharp/evpn_mac_daddy

bgpd: Prevent usage after free in bgp_mac.c

4 years agoMerge pull request #5314 from qlyoung/yang-vrrp
Renato Westphal [Wed, 8 Jan 2020 00:36:46 +0000 (21:36 -0300)]
Merge pull request #5314 from qlyoung/yang-vrrp

VRRP northbound conversion

4 years agoMerge pull request #5650 from qlyoung/fix-cast-malloc
Mark Stapp [Tue, 7 Jan 2020 21:46:29 +0000 (16:46 -0500)]
Merge pull request #5650 from qlyoung/fix-cast-malloc

zebra: remove cast from l3vni XMALLOC

4 years agoMerge pull request #5624 from qlyoung/fix-zebra-ptm-buffer-overrun
Rafael Zalamena [Tue, 7 Jan 2020 20:02:07 +0000 (17:02 -0300)]
Merge pull request #5624 from qlyoung/fix-zebra-ptm-buffer-overrun

Fix PTM ZAPI stream parsing

4 years agoMerge pull request #5646 from Spantik/bgp_unalign
Donald Sharp [Tue, 7 Jan 2020 19:35:59 +0000 (14:35 -0500)]
Merge pull request #5646 from Spantik/bgp_unalign

bgpd: fix unaligned access to addpath id

4 years agozebra: remove cast from l3vni XMALLOC
Quentin Young [Tue, 7 Jan 2020 18:54:04 +0000 (13:54 -0500)]
zebra: remove cast from l3vni XMALLOC

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5617 from donaldsharp/zebra_bites
Mark Stapp [Tue, 7 Jan 2020 18:41:03 +0000 (13:41 -0500)]
Merge pull request #5617 from donaldsharp/zebra_bites

zebra: misc zebra cleanups

4 years agoMerge pull request #5639 from qlyoung/fix-zebra-ptm-double-free
Mark Stapp [Tue, 7 Jan 2020 16:20:22 +0000 (11:20 -0500)]
Merge pull request #5639 from qlyoung/fix-zebra-ptm-double-free

zebra: fix ptm heap double free

4 years agoMerge pull request #5628 from donaldsharp/rtm_getneigh
Russ White [Tue, 7 Jan 2020 15:47:50 +0000 (10:47 -0500)]
Merge pull request #5628 from donaldsharp/rtm_getneigh

zebra: Ignore RTM_GETNEIGH messages from the linux kernel

4 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>
4 years agoMerge pull request #5634 from chiragshah6/evpn_dev2
Russ White [Tue, 7 Jan 2020 15:45:30 +0000 (10:45 -0500)]
Merge pull request #5634 from chiragshah6/evpn_dev2

bgpd: fix advertise pip running config

4 years agoMerge pull request #5644 from donaldsharp/more_pim_doc
Russ White [Tue, 7 Jan 2020 15:34:01 +0000 (10:34 -0500)]
Merge pull request #5644 from donaldsharp/more_pim_doc

doc: Clarify what is supported directly in PIM documentation

4 years agodoc: Clarify what is supported directly in PIM documentation
Donald Sharp [Tue, 7 Jan 2020 14:03:08 +0000 (09:03 -0500)]
doc: Clarify what is supported directly in PIM documentation

The FRR community keeps getting asked about what is supported or not.
Try to clarify in an additional spot what is and what is not supported.
Where people interested in using PIM might have a chance at actually
seeing the notification.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5638 from qlyoung/fix-bgp-cluster-list-null-memcmp
Donatas Abraitis [Tue, 7 Jan 2020 08:54:31 +0000 (10:54 +0200)]
Merge pull request #5638 from qlyoung/fix-bgp-cluster-list-null-memcmp

bgpd: avoid memcmp(NULL, NULL)

4 years agoMerge pull request #5635 from donaldsharp/debian_build
Donatas Abraitis [Tue, 7 Jan 2020 08:47:41 +0000 (10:47 +0200)]
Merge pull request #5635 from donaldsharp/debian_build

debian: Fix spelling error

4 years agoMerge pull request #5636 from qlyoung/fix-bgp-unaligned-addpath-id-pointer
Donatas Abraitis [Tue, 7 Jan 2020 08:47:16 +0000 (10:47 +0200)]
Merge pull request #5636 from qlyoung/fix-bgp-unaligned-addpath-id-pointer

bgpd: fix unaligned access to addpath id

4 years agobgpd: An ability to set attributes for default-originate via route-map
Donatas Abraitis [Wed, 27 Nov 2019 20:50:33 +0000 (22:50 +0200)]
bgpd: An ability to set attributes for default-originate via route-map

With this change, we are able to set attributes via route-map to the default
route. It's useful in cases where we have two or more spines and we want to
prefer one router over others for leaves. This simplifies configuration instead
of using 'network 0.0.0.0/0' or 'ip route 0.0.0.0/0 ...' and 'redistribute
static' combination.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotests: Add a test for 'neighbor <neighbor> default-originate route-map <rm>'
Donatas Abraitis [Wed, 27 Nov 2019 20:50:21 +0000 (22:50 +0200)]
tests: Add a test for 'neighbor <neighbor> default-originate route-map <rm>'

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 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>
4 years agoMerge pull request #5623 from qlyoung/fix-zebra-rtadv-interval-overflow
Renato Westphal [Tue, 7 Jan 2020 02:51:44 +0000 (23:51 -0300)]
Merge pull request #5623 from qlyoung/fix-zebra-rtadv-interval-overflow

zebra: disallow negative rtadv intvl, fix overflow

4 years agoMerge pull request #5625 from qlyoung/fix-zapi-ipset-name-nullterm
Renato Westphal [Tue, 7 Jan 2020 02:47:41 +0000 (23:47 -0300)]
Merge pull request #5625 from qlyoung/fix-zapi-ipset-name-nullterm

zebra: ensure ipset name is null terminated

4 years agoMerge pull request #5614 from qlyoung/fix-zebra-zapi-crashes
Renato Westphal [Tue, 7 Jan 2020 02:45:49 +0000 (23:45 -0300)]
Merge pull request #5614 from qlyoung/fix-zebra-zapi-crashes

Fix zebra zapi crashes

4 years agoMerge pull request #5580 from mjstapp/zebra_nhg_debug_category
Renato Westphal [Tue, 7 Jan 2020 02:44:23 +0000 (23:44 -0300)]
Merge pull request #5580 from mjstapp/zebra_nhg_debug_category

zebra: add a debug category for nexthops

4 years agoMerge pull request #5550 from manuhalo/fix_isis_def_level
Renato Westphal [Tue, 7 Jan 2020 02:43:07 +0000 (23:43 -0300)]
Merge pull request #5550 from manuhalo/fix_isis_def_level

isisd, yang: set default is-type to level-1-2

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 #5546 from mjstapp/fix_notify_nht
Donald Sharp [Tue, 7 Jan 2020 01:34:24 +0000 (20:34 -0500)]
Merge pull request #5546 from mjstapp/fix_notify_nht

zebra: route changes via notify path should trigger nht

4 years agoMerge pull request #5553 from slankdev/slankdev-fix-kernel-route-deletion-on-vrf
Donald Sharp [Tue, 7 Jan 2020 01:32:16 +0000 (20:32 -0500)]
Merge pull request #5553 from slankdev/slankdev-fix-kernel-route-deletion-on-vrf

zebra: fix kernel-route's deletion on vrf

4 years agozebra: Handle crash when backpointer does not exist
Donald Sharp [Fri, 3 Jan 2020 19:35:10 +0000 (14:35 -0500)]
zebra: Handle crash when backpointer does not exist

=================================================================
==3058==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x7f5bf3ef7477 bp 0x7ffdfaa20d40 sp 0x7ffdfaa204c8 T0)
==3058==The signal is caused by a READ memory access.
==3058==Hint: address points to the zero page.
    #0 0x7f5bf3ef7476 in memcpy /build/glibc-OTsEL5/glibc-2.27/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:134
    #1 0x4d158a in __asan_memcpy (/usr/lib/frr/zebra+0x4d158a)
    #2 0x7f5bf58da8ad in stream_put /home/qlyoung/frr/lib/stream.c:605:3
    #3 0x67d428 in zsend_ipset_entry_notify_owner /home/qlyoung/frr/zebra/zapi_msg.c:851:2
    #4 0x5c70b3 in zebra_pbr_add_ipset_entry /home/qlyoung/frr/zebra/zebra_pbr.c
    #5 0x68e1bb in zread_ipset_entry /home/qlyoung/frr/zebra/zapi_msg.c:2465:4
    #6 0x68f958 in zserv_handle_commands /home/qlyoung/frr/zebra/zapi_msg.c:2611:3
    #7 0x55666d in main /home/qlyoung/frr/zebra/main.c:309:2
    #8 0x7f5bf3e5db96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #9 0x4311d9 in _start (/usr/lib/frr/zebra+0x4311d9)

the ipset->backpointer was NULL as that the hash lookup failed to find
anything.  Prevent this crash from happening.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Refactor _add and _del to use a common function
Donald Sharp [Fri, 3 Jan 2020 18:30:37 +0000 (13:30 -0500)]
zebra: Refactor _add and _del to use a common function

The decoding of _add and _del functions is practically identical
do a bit of work and make them so.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Prevent zebra vxlan remote macip del buffer overflow
Donald Sharp [Fri, 3 Jan 2020 17:55:09 +0000 (12:55 -0500)]
zebra: Prevent zebra vxlan remote macip del buffer overflow

=================================================================
==13611==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe9e5c8694 at pc 0x0000004d18ac bp 0x7ffe9e5c8330 sp 0x7ffe9e5c7ae0
WRITE of size 17 at 0x7ffe9e5c8694 thread T0
    #0 0x4d18ab in __asan_memcpy (/usr/lib/frr/zebra+0x4d18ab)
    #1 0x7f16f04bd97f in stream_get2 /home/qlyoung/frr/lib/stream.c:277:2
    #2 0x6410ec in zebra_vxlan_remote_macip_del /home/qlyoung/frr/zebra/zebra_vxlan.c:7718:4
    #3 0x68fa98 in zserv_handle_commands /home/qlyoung/frr/zebra/zapi_msg.c:2611:3
    #4 0x556add in main /home/qlyoung/frr/zebra/main.c:309:2
    #5 0x7f16eea3bb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #6 0x431249 in _start (/usr/lib/frr/zebra+0x431249)

This decode is the result of a buffer overflow because we are
not checking ipa_len.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 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>
4 years agobgpd: fix advertise pip running config
Chirag Shah [Mon, 6 Jan 2020 22:48:57 +0000 (14:48 -0800)]
bgpd: fix advertise pip running config

advertise pip running configuration should
display ip followed by mac parameters value as defined
in cli signature.

advertise-pip is enabled by default, when displaying the
running configuration, there is '\n' added after
ip and mac parameters which was not guarded around
the non-default parameters.

Currently, for every bgp vrf instance it ends up
displaying l2vpn address-family section due to
unguarded newline.

running config:
router bgp 6004 vrf vrf1
 !
 address-family l2vpn evpn
 exit-address-family
!

Ticket:CM-26964
Testing Done:

With fix when only 'router bgp 6004 vrf vrf1' configured,
running config looks like:

!
router bgp 6004 vrf vrf1
!

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 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>
4 years agoMerge pull request #5621 from qlyoung/fix-zclient-excess-nexthop-decode
Mark Stapp [Mon, 6 Jan 2020 21:00:35 +0000 (16:00 -0500)]
Merge pull request #5621 from qlyoung/fix-zclient-excess-nexthop-decode

lib: dont decode more nexthops than we can handle

4 years agoMerge pull request #5626 from qlyoung/fix-zapi-pbr-foo
Mark Stapp [Mon, 6 Jan 2020 19:59:07 +0000 (14:59 -0500)]
Merge pull request #5626 from qlyoung/fix-zapi-pbr-foo

zebra: Fix zapi pbr foo, pseudowire ifname termination

4 years agoMerge pull request #5622 from qlyoung/fix-iface-ifindex-compare
Mark Stapp [Mon, 6 Jan 2020 19:04:33 +0000 (14:04 -0500)]
Merge pull request #5622 from qlyoung/fix-iface-ifindex-compare

lib: fix ifindex comparison overflow

4 years agolib: dont decode more nexthops than we can handle
Quentin Young [Sat, 4 Jan 2020 00:07:25 +0000 (19:07 -0500)]
lib: dont decode more nexthops than we can handle

If someone provides us more nexthops than our configured multipath
setting, drop the rest of them

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5607 from ton31337/fix/deprecate_bgpTimerUp
Quentin Young [Mon, 6 Jan 2020 17:28:52 +0000 (12:28 -0500)]
Merge pull request #5607 from ton31337/fix/deprecate_bgpTimerUp

bgpd: Time to deprecate bgpTimerUp

4 years agoMerge pull request #5606 from ton31337/fix/docker_centos8_image_name
Jafar Al-Gharaibeh [Mon, 6 Jan 2020 17:24:15 +0000 (11:24 -0600)]
Merge pull request #5606 from ton31337/fix/docker_centos8_image_name

docker: Use proper container name when creating CentOS 8 container

4 years agoMerge pull request #5632 from ton31337/fix/dont_use_pipes
Jafar Al-Gharaibeh [Mon, 6 Jan 2020 17:19:42 +0000 (11:19 -0600)]
Merge pull request #5632 from ton31337/fix/dont_use_pipes

packaging: Redirect stderr to /dev/null in %post action (frr.spec.in)

4 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>
4 years agoMerge pull request #5545 from ton31337/feature/show_bgp_json_regexp
Jafar Al-Gharaibeh [Mon, 6 Jan 2020 17:03:55 +0000 (11:03 -0600)]
Merge pull request #5545 from ton31337/feature/show_bgp_json_regexp

bgpd: Print json output for show_ip_bgp_regexp_cmd

4 years agozebra: route changes via notify path trigger nht and mpls
Mark Stapp [Tue, 17 Dec 2019 14:21:21 +0000 (09:21 -0500)]
zebra: route changes via notify path trigger nht and mpls

Changes to a route via the dataplane notify path should
trigger nht and mpls lsp processing.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5618 from qlyoung/fix-san-flags-additive
Rafael Zalamena [Mon, 6 Jan 2020 14:51:02 +0000 (11:51 -0300)]
Merge pull request #5618 from qlyoung/fix-san-flags-additive

configure.ac: make msan & ubsan flags additive

4 years agoMerge pull request #5619 from qlyoung/fix-zebra-netlink-undefined-bitshift
Mark Stapp [Mon, 6 Jan 2020 13:59:49 +0000 (08:59 -0500)]
Merge pull request #5619 from qlyoung/fix-zebra-netlink-undefined-bitshift

zebra: fix undefined bitshifts in netlink stuff

4 years agoMerge pull request #5630 from slankdev/slankdev-bgpd-fix-large-rd
Donatas Abraitis [Mon, 6 Jan 2020 11:15:07 +0000 (13:15 +0200)]
Merge pull request #5630 from slankdev/slankdev-bgpd-fix-large-rd

bgpd: fix large route-distinguisher's format

4 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>
4 years agoMerge pull request #5467 from pogojotz/alpine-linux-build
Donatas Abraitis [Sun, 5 Jan 2020 20:10:34 +0000 (22:10 +0200)]
Merge pull request #5467 from pogojotz/alpine-linux-build

alpine: fix build on current 'edge' version of Alpine

4 years agoMerge pull request #5601 from donaldsharp/pim_rb
Donatas Abraitis [Sun, 5 Jan 2020 20:07:00 +0000 (22:07 +0200)]
Merge pull request #5601 from donaldsharp/pim_rb

Pim rb

4 years agopackaging: Redirect stderr to /dev/null in %post action (frr.spec.in)
Donatas Abraitis [Sun, 5 Jan 2020 14:34:40 +0000 (16:34 +0200)]
packaging: Redirect stderr to /dev/null in %post action (frr.spec.in)

Solves:
```
/usr/bin/sed: couldn't write 40 items to stdout: Broken pipe
/usr/bin/sed: couldn't write 40 items to stdout: Broken pipe
/usr/bin/sed: couldn't write 40 items to stdout: Broken pipe
/usr/bin/sed: couldn't write 40 items to stdout: Broken pipe
/usr/bin/sed: couldn't write 40 items to stdout: Broken pipe
/usr/bin/sed: couldn't write 40 items to stdout: Broken pipe
/usr/bin/sed: couldn't write 40 items to stdout: Broken pipe
```

This happens because `grep -q` returns immediately after first match
and closes the pipe while sed has more output to write.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 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>
4 years agozebra: Ignore RTM_GETNEIGH messages from the linux kernel
Donald Sharp [Sat, 4 Jan 2020 12:42:22 +0000 (07:42 -0500)]
zebra: Ignore RTM_GETNEIGH messages from the linux kernel

The linux kernel will occassionally send RTM_GETNEIGH when
it expects user space to help in resolution of an ARP entry.
See linux kernel commit:

commit 3e25c65ed085b361cc91a8f02e028f1158c9f255
Author: Tim Gardner <tim.gardner@canonical.com>
Date:   Thu Aug 29 06:38:47 2013 -0600

    net: neighbour: Remove CONFIG_ARPD

Since we don't care about this, let's just safely ignore this
message for the moment.  I imagine in the future we might
care when we implement neighbor managment in the system.

Reported By: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 years agobgpd: Time to deprecate bgpTimerUp
Donatas Abraitis [Thu, 2 Jan 2020 10:34:48 +0000 (12:34 +0200)]
bgpd: Time to deprecate bgpTimerUp

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agodocker: Use proper container name when creating CentOS 8 container
Donatas Abraitis [Thu, 2 Jan 2020 10:20:18 +0000 (12:20 +0200)]
docker: Use proper container name when creating CentOS 8 container

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5611 from qlyoung/fix-bgp-no-listen-docstring
Donatas Abraitis [Fri, 3 Jan 2020 22:39:46 +0000 (00:39 +0200)]
Merge pull request #5611 from qlyoung/fix-bgp-no-listen-docstring

bgpd: fix too much no listen doc string

4 years agoconfigure.ac: make msan & ubsan flags additive
Quentin Young [Fri, 3 Jan 2020 20:03:37 +0000 (15:03 -0500)]
configure.ac: make msan & ubsan flags additive

These were setting = SAN_FLAGS, we want to add to the variable. Note
MSAN can't be used with any other sanitizer (except UBSan) but the
compiler will complain about that if you use it wrong so we don't need
to enforce it here.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: slight correction to sanity checks for SRGB
Quentin Young [Tue, 10 Dec 2019 20:57:28 +0000 (15:57 -0500)]
bgpd: slight correction to sanity checks for SRGB

Also improves the log messages for invalid SRGB length fields, truncated
attribute data etc

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: fix missing bounds checks for psid attr
Quentin Young [Fri, 22 Nov 2019 07:49:45 +0000 (02:49 -0500)]
bgpd: fix missing bounds checks for psid attr

Guess what - for a bounds check to work, it has to happen *before* you
read the data. We were trusting the attribute field received in a prefix
SID attribute and then checking if it was correct afterwards, but if was
wrong we'd crash before that.

This fixes the problem, and adds additional paranoid bounds checks.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5604 from qlyoung/add-ubsan-option
Renato Westphal [Fri, 3 Jan 2020 18:14:20 +0000 (15:14 -0300)]
Merge pull request #5604 from qlyoung/add-ubsan-option

configure.ac: add --enable-undefined-sanitizer

4 years agoMerge pull request #5615 from ton31337/feature/supported_rfc_list_add_8212
Quentin Young [Fri, 3 Jan 2020 18:03:14 +0000 (13:03 -0500)]
Merge pull request #5615 from ton31337/feature/supported_rfc_list_add_8212

doc: Add rfc8212 to supported RFCs list

4 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>
4 years agopimd: Do not warn for common occurrence in igmp code
Donald Sharp [Tue, 31 Dec 2019 20:28:29 +0000 (15:28 -0500)]
pimd: Do not warn for common occurrence in igmp code

Do not warn when we receive a multicast address that
matches 224.0.0.0/24.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Convert the upstream_list and hash to a rb tree
Donald Sharp [Sat, 21 Dec 2019 04:00:31 +0000 (23:00 -0500)]
pimd: Convert the upstream_list and hash to a rb tree

Convert the upstream_list and hash to a rb tree, Significant
time was being spent in the listnode_add_sort.  This reduces
this time greatly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Convert the channel_oil_list|hash to a rb_tree
Donald Sharp [Sat, 21 Dec 2019 03:12:19 +0000 (22:12 -0500)]
pimd: Convert the channel_oil_list|hash to a rb_tree

The channel_oil_list and hash are taking significant
cpu at scale when adding to the sorted list.  Replace
with a RB_TREE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agodoc: Add rfc8212 to supported RFCs list
Donatas Abraitis [Fri, 3 Jan 2020 07:51:17 +0000 (09:51 +0200)]
doc: Add rfc8212 to supported RFCs list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 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>
4 years agoMerge pull request #5613 from srimohans/ietf
Quentin Young [Fri, 3 Jan 2020 04:04:38 +0000 (23:04 -0500)]
Merge pull request #5613 from srimohans/ietf

doc: Updating FRR supported RFC list

4 years agodoc: Updating FRR supported RFC list
Sri Mohana Singamsetty [Fri, 3 Jan 2020 00:00:31 +0000 (16:00 -0800)]
doc: Updating FRR supported RFC list

1. Added subsections for BGP, MPLS, ISIS, OSPF etc.
2. Updated RFCs for BGP, MPLS, OSPF.

Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
4 years agobgpd: fix too much no listen doc string
Quentin Young [Thu, 2 Jan 2020 21:26:31 +0000 (16:26 -0500)]
bgpd: fix too much no listen doc string

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoconfigure.ac: add --enable-undefined-sanitizer
Quentin Young [Thu, 2 Jan 2020 02:05:02 +0000 (21:05 -0500)]
configure.ac: add --enable-undefined-sanitizer

For UBSan

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5594 from ton31337/feature/rhel8_docker
Donald Sharp [Wed, 1 Jan 2020 13:36:23 +0000 (08:36 -0500)]
Merge pull request #5594 from ton31337/feature/rhel8_docker

docker: Create build for CentOS 8

4 years agoMerge pull request #5593 from ton31337/feature/rhel8_rpm
Donald Sharp [Wed, 1 Jan 2020 13:35:31 +0000 (08:35 -0500)]
Merge pull request #5593 from ton31337/feature/rhel8_rpm

packaging: Add CentOS 8 support

4 years agoMerge pull request #5602 from donaldsharp/ripng_redistribute
Donatas Abraitis [Wed, 1 Jan 2020 07:33:32 +0000 (09:33 +0200)]
Merge pull request #5602 from donaldsharp/ripng_redistribute

Rip redistribute fixes

4 years agoripd: Fix redistribute/no redistribute rinse repeate commands
Donald Sharp [Tue, 31 Dec 2019 23:48:06 +0000 (18:48 -0500)]
ripd: Fix redistribute/no redistribute rinse repeate commands

ripd was using zclient_redistribute for installation but not
for removal.  As such the lib/zclient.c was not properly tracking
add/removal.  I think it would be best to just let rip to track
this instead of zclient.

Fixes: #5599
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoripngd: Fix redistribute/no redistribute rinse repeat commands
Donald Sharp [Tue, 31 Dec 2019 23:41:16 +0000 (18:41 -0500)]
ripngd: Fix redistribute/no redistribute rinse repeat commands

ripngd was using zclient_redistribute for installation but not
for removal.  As such the lib/zclient.c was not properly tracking
add/removal.  I think it would be best to just let ripng to track
this instead of zclient.

Fixes: #5599
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5589 from ton31337/fix/send_fsm_error_notification_where_needed
Donald Sharp [Tue, 31 Dec 2019 14:11:11 +0000 (09:11 -0500)]
Merge pull request #5589 from ton31337/fix/send_fsm_error_notification_where_needed

bgpd: Send notification to the peer on FSM error

4 years agoMerge pull request #5595 from ton31337/fix/bgp_listen_definition
Donald Sharp [Tue, 31 Dec 2019 14:10:04 +0000 (09:10 -0500)]
Merge pull request #5595 from ton31337/fix/bgp_listen_definition

bgpd: Change description for `[no] bgp listen limit` commands

4 years agoMerge pull request #5598 from zoltan/bgp_cfg_typo
Donatas Abraitis [Tue, 31 Dec 2019 12:19:35 +0000 (14:19 +0200)]
Merge pull request #5598 from zoltan/bgp_cfg_typo

bgpd: fix console typo

4 years agoMerge pull request #5597 from chiragshah6/evpn_dev2
Donatas Abraitis [Tue, 31 Dec 2019 09:07:44 +0000 (11:07 +0200)]
Merge pull request #5597 from chiragshah6/evpn_dev2

bgpd: skip ra for blackhole nexthop type