]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agobgpd: More `const struct prefix` work
Donald Sharp [Sun, 22 Mar 2020 18:50:46 +0000 (14:50 -0400)]
bgpd: More `const struct prefix` work

Modify more code to use `const struct prefix` throughout
bgp.  This is all prep work for adding an accessor function
for bgp_node to get the prefix and reduce all the places that
code needs to be touched when we get that work done.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5825 from pguibert6WIND/nhrp_vty
Donatas Abraitis [Sun, 22 Mar 2020 12:21:42 +0000 (14:21 +0200)]
Merge pull request #5825 from pguibert6WIND/nhrp_vty

nhrpd: add json support to show nhrp vty commands

4 years agoMerge pull request #6066 from donaldsharp/isis_mtu_buffer
David Lamparter [Sat, 21 Mar 2020 17:18:07 +0000 (18:18 +0100)]
Merge pull request #6066 from donaldsharp/isis_mtu_buffer

isisd: Expand send/receive buffers to allow for larger mtu

4 years agoMerge pull request #6059 from ton31337/fix/int_to_bool
Donald Sharp [Sat, 21 Mar 2020 16:39:30 +0000 (12:39 -0400)]
Merge pull request #6059 from ton31337/fix/int_to_bool

bgpd: Convert lots of int type functions to bool/void

4 years agoMerge pull request #6029 from donaldsharp/coverity_pim
Donatas Abraitis [Sat, 21 Mar 2020 13:03:28 +0000 (15:03 +0200)]
Merge pull request #6029 from donaldsharp/coverity_pim

Coverity pim

4 years agobgpd: Convert lots of int type functions to bool/void
Donatas Abraitis [Fri, 20 Mar 2020 09:57:54 +0000 (11:57 +0200)]
bgpd: Convert lots of int type functions to bool/void

Some were converted to bool, where true/false status is needed.
Converted to void only those, where the return status was only false or true.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotools: Convert type int functions to bool where possible
Donatas Abraitis [Fri, 20 Mar 2020 09:40:41 +0000 (11:40 +0200)]
tools: Convert type int functions to bool where possible

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6065 from ton31337/doc/rfc_supported_bgp
Donald Sharp [Sat, 21 Mar 2020 12:41:03 +0000 (08:41 -0400)]
Merge pull request #6065 from ton31337/doc/rfc_supported_bgp

doc: Add rfc7606 to BGP supported RFCs list

4 years agoisisd: Expand send/receive buffers to allow for larger mtu
Donald Sharp [Sat, 21 Mar 2020 12:22:51 +0000 (08:22 -0400)]
isisd: Expand send/receive buffers to allow for larger mtu

User is reporting:
2020/03/21 03:12:36 ISIS: isis_send_pdu_bcast: sock_buff size 8192 is less than output pdu size 9014 on circuit em0
2020/03/21 03:12:36 ISIS: [EC 67108865] ISIS-Adj (1): Send L2 IIH on em0 failed

MTU's can frequently hit 9k in size, we have buffer limits
that prevent this from being fully used and creating errors.

Modify the code to allow for up to 16k mtu

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #6064 from opensourcerouting/topo_set_locale
Donald Sharp [Sat, 21 Mar 2020 10:29:55 +0000 (06:29 -0400)]
Merge pull request #6064 from opensourcerouting/topo_set_locale

Topotest fixes for Kernel 5.3 & locale

4 years agodoc: Add rfc7606 to BGP supported RFCs list
Donatas Abraitis [Sat, 21 Mar 2020 09:19:24 +0000 (11:19 +0200)]
doc: Add rfc7606 to BGP supported RFCs list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #6023 from vivek-cumulus/strip_rts_for_vrf_route_leak
Sri Mohana Singamsetty [Sat, 21 Mar 2020 01:11:06 +0000 (18:11 -0700)]
Merge pull request #6023 from vivek-cumulus/strip_rts_for_vrf_route_leak

bgpd: Strip route targets during VRF-to-VRF route leaking

4 years agoMerge pull request #6040 from vivek-cumulus/evpn_advertise_map_allow_sets
Sri Mohana Singamsetty [Sat, 21 Mar 2020 01:10:35 +0000 (18:10 -0700)]
Merge pull request #6040 from vivek-cumulus/evpn_advertise_map_allow_sets

Allow 'sets' in EVPN advertise route-map

4 years agoMerge pull request #6060 from donaldsharp/bgp_defines_to_enum
Sri Mohana Singamsetty [Sat, 21 Mar 2020 01:10:07 +0000 (18:10 -0700)]
Merge pull request #6060 from donaldsharp/bgp_defines_to_enum

Bgp defines to enum

4 years agotests: fix check for nhid in ipv6 table output
Martin Winter [Fri, 20 Mar 2020 22:53:39 +0000 (23:53 +0100)]
tests: fix check for nhid in ipv6 table output

Check based on actual output instead of assuming output based
on kernel version

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agotests: Make topotest working on different locale
Martin Winter [Fri, 20 Mar 2020 22:50:29 +0000 (23:50 +0100)]
tests: Make topotest working on different locale

"sort" as used in all-protocol-startup used sort which causes
different sort order based on locale settings. Specify the
correct one to make output matching our expected result

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoMerge pull request #6043 from pguibert6WIND/nhrp_clear_cache
Donald Sharp [Fri, 20 Mar 2020 22:22:51 +0000 (18:22 -0400)]
Merge pull request #6043 from pguibert6WIND/nhrp_clear_cache

nhrpd: fix clear nhrp cache dynamic entries

4 years agopimd: Prevent uninited use of tmp_oil in pim_mroute_add
Donald Sharp [Wed, 18 Mar 2020 11:42:36 +0000 (07:42 -0400)]
pimd: Prevent uninited use of tmp_oil in pim_mroute_add

There exists a path where tmp_oil is used uninited, prevent
this from happening.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Note when rpf_update fails
Donald Sharp [Wed, 18 Mar 2020 11:41:03 +0000 (07:41 -0400)]
pimd: Note when rpf_update fails

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: Ensure pointer exists before using in mlag
Donald Sharp [Wed, 18 Mar 2020 11:15:05 +0000 (07:15 -0400)]
lib: Ensure pointer exists before using in mlag

Ensure that the s pointer is valid and usable before
grabbing data off of it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Prevent use after free
Donald Sharp [Wed, 18 Mar 2020 11:12:57 +0000 (07:12 -0400)]
pimd: Prevent use after free

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Convert status defines to enum
Donald Sharp [Fri, 20 Mar 2020 13:03:08 +0000 (09:03 -0400)]
bgpd: Convert status defines to enum

Convert some status defines for the fsm to an enum
so that we cannot mix and match them in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Convert #define of bgp fsm events to an enum
Donald Sharp [Fri, 20 Mar 2020 00:19:50 +0000 (20:19 -0400)]
bgpd: Convert #define of bgp fsm events to an enum

In PR #6052 which fixes issue #5963 the bgp fsm events
were confused with the bgp fsm status leading
to a bug.  Let's start separating those out
so these types of failures cannot just
easily occur.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5977 from rubenk/treewide-add-noreturn
Sri Mohana Singamsetty [Fri, 20 Mar 2020 21:55:49 +0000 (14:55 -0700)]
Merge pull request #5977 from rubenk/treewide-add-noreturn

treewide: add attribute to functions that do not return

4 years agoMerge pull request #5971 from rubenk/ospdf-remove-workaround-for-old-openbsd
David Lamparter [Fri, 20 Mar 2020 19:55:42 +0000 (20:55 +0100)]
Merge pull request #5971 from rubenk/ospdf-remove-workaround-for-old-openbsd

ospfd: stop checking for ancient OpenBSD

4 years agoMerge pull request #6033 from rubenk/lib-do-not-use-aliased-inet-ntop-on-apple
David Lamparter [Fri, 20 Mar 2020 19:52:28 +0000 (20:52 +0100)]
Merge pull request #6033 from rubenk/lib-do-not-use-aliased-inet-ntop-on-apple

lib: cannot use aliased function on Darwin

4 years agoMerge pull request #5986 from sworleys/Include-Not-Current-Mem
David Lamparter [Fri, 20 Mar 2020 19:40:06 +0000 (20:40 +0100)]
Merge pull request #5986 from sworleys/Include-Not-Current-Mem

lib: include any mem ever allocd in `show memory`

4 years agoMerge pull request #6061 from volta-networks/fix_isis_show_metric
Renato Westphal [Fri, 20 Mar 2020 18:15:41 +0000 (15:15 -0300)]
Merge pull request #6061 from volta-networks/fix_isis_show_metric

isisd: fix vty show isis metric

4 years agoMerge pull request #6046 from Naveenaidu/builddoc-archlinux
Donatas Abraitis [Fri, 20 Mar 2020 17:11:33 +0000 (19:11 +0200)]
Merge pull request #6046 from Naveenaidu/builddoc-archlinux

doc: Add build instructions for Arch Linux

4 years agoMerge pull request #6042 from rubenk/build-disable-pimd-on-macos
Stephen Worley [Fri, 20 Mar 2020 17:05:08 +0000 (13:05 -0400)]
Merge pull request #6042 from rubenk/build-disable-pimd-on-macos

Disable pimd on MacOS

4 years agoisisd: fix vty show isis metric
Emanuele Di Pascale [Fri, 20 Mar 2020 15:38:39 +0000 (16:38 +0100)]
isisd: fix vty show isis metric

the vtysh command to set the isis metric on an interface
is 'isis metric level-1 X', but when showing the running
config we were displaying it as 'isis metric X level-1'.
This would confuse frr-reload.py when attempting to apply
a config file populated with the correct command; on the
other hand, using the show command format would return an
error when running vtysh -C on the file.

Fix this by making the show command return the same format
as the vtysh setting command.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agolib: include any mem ever allocd in `show memory`
Stephen Worley [Wed, 11 Mar 2020 19:04:49 +0000 (15:04 -0400)]
lib: include any mem ever allocd in `show memory`

Include memory types that were ever allocated when doing
a `show memory`.

Before, we were only including memory that existed currently
in the system, so we lost memory that was alloc'd/dealloc'd.

With this patch, we check max number rather than current number.

Ex) dataplane context objects

Old:
==============================================================================
Type                          : Current#   Size       Total     Max#  MaxBytes
--- qmem zebra ---
Type                          : Current#   Size       Total     Max#  MaxBytes
Zebra Interface Information   :       48    360       17280       48     17280
Router Advertisement Prefix   :        3     48         168        3       168
Route Entry                   :      128     80       11264      128     11264
RIB destination               :       64     88        5632       64      5632
Zebra DPlane Provider         :        1    232         232        1       232
Nexthop Group Entry           :       78     80        6928      114     10032
Nexthop Group Connected       :       78     40        3168      114      4560
Zebra Name Space              :       13 variable      1000       13      1000
RIB table info                :       12     16         288       12       288
ZEBRA VRF                     :        3   4744       14232        3     14232

New:
==============================================================================
Type                          : Current#   Size       Total     Max#  MaxBytes
--- qmem zebra ---
Type                          : Current#   Size       Total     Max#  MaxBytes
Zebra Interface Information   :       48    360       17280       48     17280
Router Advertisement Prefix   :        3     48         168        3       168
Route Entry                   :      128     80       11264      128     11264
RIB destination               :       64     88        5632       64      5632
Zebra DPlane Ctx              :        0   2424           0       87    210888
Zebra DPlane Provider         :        1    232         232        1       232
Nexthop Group Entry           :       78     80        6928      114     10032
Nexthop Group Connected       :       78     40        3168      114      4560
Zebra Name Space              :       13 variable      1000       13      1000
RIB table info                :       12     16         288       12       288
ZEBRA VRF                     :        3   4744       14232        3     14232

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agobuild: disable pimd on MacOS
Ruben Kerkhof [Thu, 19 Mar 2020 10:55:42 +0000 (11:55 +0100)]
build: disable pimd on MacOS

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
4 years agoMerge pull request #6053 from LabNConsulting/working/lb/centos6
Donald Sharp [Fri, 20 Mar 2020 11:26:28 +0000 (07:26 -0400)]
Merge pull request #6053 from LabNConsulting/working/lb/centos6

docs: document libyang build magic (from Martin) for centos 6

4 years agoMerge pull request #6021 from vivek-cumulus/weighted_routes_rfc5549_fix
Sri Mohana Singamsetty [Fri, 20 Mar 2020 03:04:14 +0000 (20:04 -0700)]
Merge pull request #6021 from vivek-cumulus/weighted_routes_rfc5549_fix

zebra: Install nexthop's weight for IPv4 routes with IPv6 next hops

4 years agoMerge pull request #6052 from pureport/PE-2051_fix_snmp_trap
Donald Sharp [Fri, 20 Mar 2020 01:06:48 +0000 (21:06 -0400)]
Merge pull request #6052 from pureport/PE-2051_fix_snmp_trap

bgpd: Fixed snmp and bmp 'just Established' test.

4 years agodocs: document libyang build magic (from Martin) for centos 6
Lou Berger [Thu, 19 Mar 2020 23:51:20 +0000 (19:51 -0400)]
docs: document libyang build magic (from Martin) for centos 6

Signed-off-by: Lou Berger <lberger@labn.net>
4 years agobgpd: Fixed snmp and bmp 'just Established' test.
Josh Cox [Thu, 19 Mar 2020 21:52:10 +0000 (17:52 -0400)]
bgpd: Fixed snmp and bmp 'just Established' test.

It was previously comparing an fsm event variable with an fsm status constant.
This fixes issue #5963.

Signed-off-by: Josh Cox <josh.cox@pureport.com>
4 years agobgpd: Allow EVPN advertise route-map to modify attributes
vivek [Wed, 18 Mar 2020 22:40:04 +0000 (15:40 -0700)]
bgpd: Allow EVPN advertise route-map to modify attributes

Ensure that the EVPN advertise route-map is applied on a copy of the
original path_info and associated attribute, so that if the route-map
has SET clauses, they can operate properly. This closely follows
the model already in use in other route-map application code.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Reverse route-map check for consistency
vivek [Wed, 18 Mar 2020 22:16:23 +0000 (15:16 -0700)]
bgpd: Reverse route-map check for consistency

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agoMerge pull request #6045 from rubenk/bgpd-use-correct-format-specifier
Quentin Young [Thu, 19 Mar 2020 17:55:04 +0000 (13:55 -0400)]
Merge pull request #6045 from rubenk/bgpd-use-correct-format-specifier

bgpd: use the right format specifier

4 years agolib: cannot use aliased function on Darwin
Ruben Kerkhof [Wed, 18 Mar 2020 15:11:44 +0000 (16:11 +0100)]
lib: cannot use aliased function on Darwin

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
4 years agotreewide: add attribute to functions that do not return
Ruben Kerkhof [Thu, 12 Mar 2020 09:57:04 +0000 (10:57 +0100)]
treewide: add attribute to functions that do not return

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
4 years agoMerge pull request #5755 from slankdev/bgpd-fix-prefix-sid-parse-error
Quentin Young [Thu, 19 Mar 2020 16:28:36 +0000 (12:28 -0400)]
Merge pull request #5755 from slankdev/bgpd-fix-prefix-sid-parse-error

bgpd: fix Prefix-SID parse error

4 years agoospfd: stop checking for ancient OpenBSD
Ruben Kerkhof [Wed, 11 Mar 2020 12:11:04 +0000 (13:11 +0100)]
ospfd: stop checking for ancient OpenBSD

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
4 years agoMerge pull request #6044 from donaldsharp/bfd_increase_timers_in_test
Mark Stapp [Thu, 19 Mar 2020 14:41:35 +0000 (10:41 -0400)]
Merge pull request #6044 from donaldsharp/bfd_increase_timers_in_test

tests: Increase some wait time in tests

4 years agodoc: Add build instructions for Arch Linux
Naveen Naidu [Thu, 19 Mar 2020 13:29:08 +0000 (18:59 +0530)]
doc: Add build instructions for Arch Linux

Signed-off-by: Naveen Naidu <naveennaidu479@gmail.com>
4 years agobgpd: use the right format specifier
Ruben Kerkhof [Thu, 19 Mar 2020 13:00:20 +0000 (14:00 +0100)]
bgpd: use the right format specifier

Fixes:
/Library/Developer/CommandLineTools/usr/bin/make  all-am
  CC       bgpd/bgp_attr.o
bgpd/bgp_attr.c:2664:5: warning: format specifies type 'unsigned char' but the argument has type 'uint16_t' (aka 'unsigned short') [-Wformat]
                                length, STREAM_READABLE(peer->curr));
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/log.h:94:50: note: expanded from macro 'flog_err'
        zlog_err("[EC %" PRIu32 "] " format, ferr_id, ##__VA_ARGS__)
                                     ~~~~~~             ^~~~~~~~~~~
1 warning generated.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
4 years agotests: Increase some wait time in tests
Donald Sharp [Thu, 19 Mar 2020 12:24:37 +0000 (08:24 -0400)]
tests: Increase some wait time in tests

The bfd-bgp-cbit-topo3 test is testing bfd timers
with some timers that only wait 4 seconds.  The CI
system is failing in various places due to bfd
not converging properly.  Upon logging into a
CI system and running tests with intensive disk i/o
I was able to make the tests fail repeatedly in
a couple of different places.  Add some additional
time to allow the system to converge on our CI
systems that are running in vm's and may not
always have complete control of cpu's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agonhrpd: fix clear nhrp cache dynamic entries
Philippe Guibert [Thu, 19 Mar 2020 11:09:06 +0000 (12:09 +0100)]
nhrpd: fix clear nhrp cache dynamic entries

as the helper said, the dynamic cache entries should be flushed once the
vty command 'clear ip/ipv6 nhrp cache' mentions. This was not the case.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agobgpd: Strip Route Targets during VRF-to-VRF route leak
vivek [Wed, 18 Mar 2020 03:36:05 +0000 (20:36 -0700)]
bgpd: Strip Route Targets during VRF-to-VRF route leak

During VRF-to-VRF route leaking, strip any extraneous route targets. This
ensures that source-VRF-specific route targets or route targets that are
internally assigned for the VRF-to-VRF route leaking don't get attached
to the route in the target VRF.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
4 years agobgpd: Make strip extcommunity handle multiple extcommunities
vivek [Wed, 18 Mar 2020 03:27:23 +0000 (20:27 -0700)]
bgpd: Make strip extcommunity handle multiple extcommunities

Extended communities like the BGP Route Target can be present multiple
times in a route's path attribute. Ensure that the strip function for a
particular extended community (type and subtype) handles this and
strips all occurrences.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
4 years agoMerge pull request #6036 from rubenk/build-really-disable-pimd-on-openbsd
Quentin Young [Thu, 19 Mar 2020 00:26:29 +0000 (20:26 -0400)]
Merge pull request #6036 from rubenk/build-really-disable-pimd-on-openbsd

build: really disable pimd on OpenBSD

4 years agoMerge pull request #6037 from donaldsharp/fus
Martin Winter [Wed, 18 Mar 2020 17:04:22 +0000 (18:04 +0100)]
Merge pull request #6037 from donaldsharp/fus

*: Remove weird directory

4 years ago*: Remove weird directory
Donald Sharp [Wed, 18 Mar 2020 17:02:57 +0000 (13:02 -0400)]
*: Remove weird directory

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobuild: really disable pimd on OpenBSD
Ruben Kerkhof [Wed, 18 Mar 2020 16:49:37 +0000 (17:49 +0100)]
build: really disable pimd on OpenBSD

For some reason the check did not work

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
4 years agoMerge pull request #6030 from mjstapp/fix_config_vrrp
Quentin Young [Wed, 18 Mar 2020 16:11:59 +0000 (12:11 -0400)]
Merge pull request #6030 from mjstapp/fix_config_vrrp

build: disable VRRPD if not linux

4 years agoMerge pull request #6028 from mjstapp/fix_func_macros
Quentin Young [Wed, 18 Mar 2020 15:53:58 +0000 (11:53 -0400)]
Merge pull request #6028 from mjstapp/fix_func_macros

bgpd,zebra: replace some more FUNCTION macros with __func__

4 years agoMerge pull request #6020 from donaldsharp/cbit_bs
Donatas Abraitis [Wed, 18 Mar 2020 12:29:27 +0000 (14:29 +0200)]
Merge pull request #6020 from donaldsharp/cbit_bs

zebra: Add missing c-bit uint8_t

4 years agobuild: disable VRRPD if not linux
Mark Stapp [Tue, 17 Mar 2020 21:26:20 +0000 (17:26 -0400)]
build: disable VRRPD if not linux

Only allow configure to try to build VRRPD on linux; other
platforms disable it.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agobgpd,zebra: replace some more FUNCTION macros
Mark Stapp [Tue, 17 Mar 2020 12:57:42 +0000 (08:57 -0400)]
bgpd,zebra: replace some more FUNCTION macros

Replace some remaining __FUNCTION__ macros with __func__,
now that we're trying to converge that way.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #5882 from patrasar/2386429
Donatas Abraitis [Wed, 18 Mar 2020 09:26:44 +0000 (11:26 +0200)]
Merge pull request #5882 from patrasar/2386429

pimd: fix pim interface traffic & pim rp-info json command

4 years agoMerge pull request #5945 from pguibert6WIND/match_rmap_ipv4
Donatas Abraitis [Wed, 18 Mar 2020 09:22:19 +0000 (11:22 +0200)]
Merge pull request #5945 from pguibert6WIND/match_rmap_ipv4

bgpd: support for match ip address next-hop address command

4 years agoMerge pull request #5992 from pguibert6WIND/bgp_bfd_reset_with_remote
Donatas Abraitis [Wed, 18 Mar 2020 09:19:59 +0000 (11:19 +0200)]
Merge pull request #5992 from pguibert6WIND/bgp_bfd_reset_with_remote

bgpd: reset bfd session when bgp comes up

4 years agoMerge pull request #6022 from vivek-cumulus/refine_multiaccess_check
Donatas Abraitis [Wed, 18 Mar 2020 08:47:27 +0000 (10:47 +0200)]
Merge pull request #6022 from vivek-cumulus/refine_multiaccess_check

bgpd: Refine multiaccess check for next hop resetting

4 years agoMerge pull request #6013 from donaldsharp/bgp_reason_it
Donatas Abraitis [Wed, 18 Mar 2020 08:37:02 +0000 (10:37 +0200)]
Merge pull request #6013 from donaldsharp/bgp_reason_it

bgpd: Fix certain code paths that reset reason code

4 years agobgpd: Refine multiaccess check for next hop resetting
vivek [Wed, 18 Mar 2020 02:59:52 +0000 (19:59 -0700)]
bgpd: Refine multiaccess check for next hop resetting

A BGP update-group is dynamically created to group together a set of peers
such that any BGP updates can be formed just once for the entire group and
only the next hop attribute may need to be modified when the update is sent
out to each peer in the group. The update formation code attempts to
determine as much as possible if the next hop will be set to our own IP
address for every peer in the group. This helps to avoid additional checks
at the point of sending the update (which happens on a per-peer basis) and
also because some other attributes may/could vary depending on whether the
next hop is set to our own IP or not. Resetting the next hop to our own IP
address is the most common behavior for EBGP peerings in the absence of
other user-configured or internal (e.g., for l2vpn/evpn) settings and
peerings on a shared subnet.

The code had a flaw in the multiaccess check to see if there are peers in
the update group which are on a shared subnet as the next hop of the path
being announced - the source peer could itself be in the same update group
and cause the check to give an incorrect result. Modify the check to skip
the source peer so that the check is more accurate.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
4 years agozebra: Install nexthop's weight for IPv4 routes with IPv6 next hops
vivek [Wed, 18 Mar 2020 02:25:13 +0000 (19:25 -0700)]
zebra: Install nexthop's weight for IPv4 routes with IPv6 next hops

Ensure that any weight associated with the next hop is installed for
IPv4 routes with IPv6 next hops too.
Updates: lib, zebra: Allow for installation of a weighted nexthop

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
4 years agobgpd: support for match ip address next-hop address command
Philippe Guibert [Mon, 9 Mar 2020 15:13:19 +0000 (16:13 +0100)]
bgpd: support for match ip address next-hop address command

this command is missing, compared with 'match ipv6 next-hop' command
available. Adding it by taking into account the backward compatible
effect when supposing that some people have configured acls with name
being an ipv4 address.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agozebra: Add missing c-bit uint8_t
Donald Sharp [Tue, 17 Mar 2020 20:01:59 +0000 (16:01 -0400)]
zebra: Add missing c-bit uint8_t

Add to the ZEBRA_INTERFACE_BFD_DEST_UPDATE code path
in zebra_ptm_redistribute.c the missing c-bit data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Fix certain code paths that reset reason code
Donald Sharp [Mon, 16 Mar 2020 21:23:34 +0000 (17:23 -0400)]
bgpd: Fix certain code paths that reset reason code

The bgp reason code was being reset in bgp_best_selection
by rerunning bgp_path_info_cmp multiple times under certain
receiving patterns of data from peers.

This is the debugs that show this issue:
2020/03/16 19:17:22.523780 BGP: 2001:20:1:1::6 rcvd UPDATE w/ attr: nexthop 20.1.1.6, origin i, metric 600, community 1000:1006, path 20
2020/03/16 19:17:22.523819 BGP: 2001:20:1:1::6 rcvd 20.10.0.6/32 IPv4 unicast
2020/03/16 19:17:22.556168 BGP: 20.1.1.6 rcvd UPDATE w/ attr: nexthop 20.1.1.6, origin i, metric 500, community 1000:1006, path 20
2020/03/16 19:17:22.556209 BGP: 20.1.1.6 rcvd 20.10.0.6/32 IPv4 unicast
2020/03/16 19:17:22.572358 BGP: bgp_process_main_one: p=20.10.0.6/32 afi=IPv4, safi=unicast start
2020/03/16 19:17:22.572408 BGP: 20.10.0.6/32: Comparing path 2001:20:1:1::6 flags 0x410 with path 20.1.1.6 flags 0x410
2020/03/16 19:17:22.572415 BGP: 20.10.0.6/32: path 2001:20:1:1::6 loses to path 20.1.1.6 due to MED 600 > 500
2020/03/16 19:17:22.572422 BGP: 20.10.0.6/32: path 20.1.1.6 is the bestpath from AS 20
2020/03/16 19:17:22.572429 BGP: 20.10.0.6/32: path 20.1.1.6 is the initial bestpath
2020/03/16 19:17:22.572435 BGP: bgp_best_selection: pi 0x5627187c66c0 dmed
2020/03/16 19:17:22.572441 BGP: 20.10.0.6/32: After path selection, newbest is path 20.1.1.6 oldbest was NONE
2020/03/16 19:17:22.572447 BGP: 20.10.0.6/32: path 20.1.1.6 is the bestpath, add to the multipath list
2020/03/16 19:17:22.572453 BGP: 20.10.0.6/32: path 2001:20:1:1::6 has the same nexthop as the bestpath, skip it
2020/03/16 19:17:22.572460 BGP: 20.10.0.6/32: starting mpath update, newbest 20.1.1.6 num candidates 1 old-mpath-count 0 old-cum-bw u0
2020/03/16 19:17:22.572466 BGP: 20.10.0.6/32: comparing candidate 20.1.1.6 with existing mpath NONE
2020/03/16 19:17:22.572473 BGP: 20.10.0.6/32: New mpath count (incl newbest) 1 mpath-change NO all_paths_lb 0 cum_bw u0

Effectively if BGP receives 2 paths it could end up running bgp_path_info_cmp multiple times
and in some situations overwrite the reason selected the first time through.

In this example path selection is run and the MED is the reason for the choice.
Then in bgp_best_selection is run again this time clearing new_select
to NULL before calling path selection for the first time. This second
call into path selection resets the reason, since it is only passing in one
path.  So save the last reason selected and restore in this case.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5849 from donaldsharp/pim_register_prefix_list
Russ White [Tue, 17 Mar 2020 18:57:10 +0000 (14:57 -0400)]
Merge pull request #5849 from donaldsharp/pim_register_prefix_list

Pim register prefix list

4 years agoMerge pull request #6006 from sarav511/zbr_crsh
Mark Stapp [Tue, 17 Mar 2020 18:47:58 +0000 (14:47 -0400)]
Merge pull request #6006 from sarav511/zbr_crsh

zebra: Disable rmap update thread before routemap_finish while shutting down Zebra

4 years agoMerge pull request #5880 from patrasar/2371558
Donald Sharp [Tue, 17 Mar 2020 17:40:53 +0000 (13:40 -0400)]
Merge pull request #5880 from patrasar/2371558

pimd: fix OIL not removed after IGMP prune

4 years agoMerge pull request #5779 from mjstapp/sharp_with_lsps
Donald Sharp [Tue, 17 Mar 2020 15:40:35 +0000 (11:40 -0400)]
Merge pull request #5779 from mjstapp/sharp_with_lsps

sharpd: add support to install/remove lsps

4 years agoMerge pull request #5954 from ton31337/feature/rfc7607
Russ White [Tue, 17 Mar 2020 14:27:35 +0000 (10:27 -0400)]
Merge pull request #5954 from ton31337/feature/rfc7607

 bgpd: Proscribe the use of AS 0 (zero)

4 years agoMerge pull request #5848 from ton31337/feature/show_rpki_prefix_asn
Russ White [Tue, 17 Mar 2020 14:12:22 +0000 (10:12 -0400)]
Merge pull request #5848 from ton31337/feature/show_rpki_prefix_asn

bgpd: Show RPKI prefixes filtered by ASN

4 years agoMerge pull request #5868 from ghasemnaddaf/nhrp_bugfix
Russ White [Tue, 17 Mar 2020 14:07:51 +0000 (10:07 -0400)]
Merge pull request #5868 from ghasemnaddaf/nhrp_bugfix

nhrpd: fix shortcut expiry and route installation

4 years agobgpd: Proscribe the use of AS 0 (zero)
Donatas Abraitis [Tue, 10 Mar 2020 05:35:35 +0000 (07:35 +0200)]
bgpd: Proscribe the use of AS 0 (zero)

Implements https://tools.ietf.org/html/rfc7607

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #5927 from mjstapp/interval_string_api
Donald Sharp [Tue, 17 Mar 2020 10:47:15 +0000 (06:47 -0400)]
Merge pull request #5927 from mjstapp/interval_string_api

lib, *: add a common time interval formatting api

4 years agoMerge pull request #5940 from patrasar/214257
Donald Sharp [Tue, 17 Mar 2020 10:38:41 +0000 (06:38 -0400)]
Merge pull request #5940 from patrasar/214257

pimd: add flags in show ip mroute command

4 years agozebra: Disable rmap update thread before routemap_finish while shutting down zebra
saravanank [Mon, 16 Mar 2020 02:23:38 +0000 (19:23 -0700)]
zebra: Disable rmap update thread before routemap_finish while shutting down zebra

Problem: While zebra going down, rmap update thread is being called as part of
timer event. This make zebra to crash.

RCA: At this time route_map_master_hash is made to 0 by sig int handler.
This is causing Zebrad to crash while executing rmap update thread

Fix: As part of SIGINT handler, before calling routemap_finish,
thread off any routemap update scheduled at that point and make sure that
it wont get scheduled again by making the timeout as 0.

Signed-off-by: Saravanan K <saravanank@vmware.com>
4 years agopimd: fix OIL not removed after IGMP prune
Sarita Patra [Mon, 2 Mar 2020 08:55:22 +0000 (00:55 -0800)]
pimd: fix OIL not removed after IGMP prune

Issue: Client1------LHR-----(int-1)RP(int-2)------client2
Client2 send IGMP join for group G.
Client1 send IGMP join for group G.
verify show ip mroute in RP, will have 2 OIL.
Client2 send IGMP leave.
Verify show ip mroute in RP, will still have 2.

Root cause: When RP receives IGMP join from client2, it creates
a (s,g) channel oil and add the interface int-2 into oil list and
set the flag PIM_OIF_FLAG_PROTO_IGMP to int-2
Client1 send IGMP join, LHR will send a (*,G) join to RP. RP will
add the interface int-1 into the oil list of (s,g) channel_oil and
will set the flag PIM_OIF_FLAG_PROTO_IGMP and PIM_OIF_FLAG_PROTO_PIM
to the int-1 and set PIM_OIF_FLAG_PROTO_PIM to int-2 as well. It is
happening because of the pim_upstream_inherited_olist_decide() and
forward_on() get all the oil and update the flag wrongly.
So now when client 2 sends IGMP prune, RP will not remove the int-2
from oil list since both PIM_OIF_FLAG_PROTO_PIM & PIM_OIF_FLAG_PROTO_IGMP
are set, it just unset the flag PIM_OIF_FLAG_PROTO_IGMP.

Fix: Introduced new flags in if_channel, PIM_IF_FLAG_MASK_PROTO_PIM
& PIM_IF_FLAG_MASK_PROTO_IGMP. If a if_channel is created because of
pim join or pim (s,g,rpt) prune received, then set the flag
PIM_IF_FLAG_MASK_PROTO_PIM. If a if_channel is created becuase of IGMP
join received, then set the flag PIM_IF_FLAG_MASK_PROTO_IGMP.
When an interface needs to be added into the oil list check if
PIM_IF_FLAG_MASK_PROTO_PIM or PIM_IF_FLAG_MASK_PROTO_IGMP is set, then
update oil flag accordingly.

Signed-off-by: Sarita Patra <saritap@vmware.com>
4 years agopimd: fix pim interface traffic & pim rp-info json command
Sarita Patra [Mon, 2 Mar 2020 09:10:22 +0000 (01:10 -0800)]
pimd: fix pim interface traffic & pim rp-info json command

Issue 1: "show ip pim interface traffic" not show prune TX/RX
Rootcause : not added the variable in the json
Fix : add prune TX/RX in show ip pim interface traffic json

Issue 2: "show ip pim rp-info" not shows the key iAmRp when it is false
Rootcause: Only display the key when the value is true.
Fix: add iAmRp as false in show ip pim rp-info json

Issue 3: "show ip pim rp-info" not showing outbound interface if it is empty
Rootcause: Only display when there is any OIL

Fix: When RP is not reachable then, the outbound interface is Unknown
The command "show ip pim rp-info json" not displaying the outbound
interafce if it is unknown

Signed-off-by: Sarita Patra <saritap@vmware.com>
4 years agopimd: add flags in show ip mroute command
Sarita Patra [Mon, 9 Mar 2020 06:23:16 +0000 (23:23 -0700)]
pimd: add flags in show ip mroute command

S - Sparse Mode
C - indicates there is a member of the group directly connected to the router.
R -set on an (S, G) by the receipt of an (S, G) RP bit prune message.
F -This indicates that this router is a FHR and send register messages to RP to inform RP of this active source
P - OIL list is NULL. That means the router will send a prune.
T - At least one packet received via SPT.

Signed-off-by: Sarita Patra <saritap@vmware.com>
4 years agoMerge pull request #6009 from kuldeepkash/bgp_basic_functionality
Donald Sharp [Tue, 17 Mar 2020 01:37:07 +0000 (21:37 -0400)]
Merge pull request #6009 from kuldeepkash/bgp_basic_functionality

tests: Optimize bgp-basic-functionality-topo1 test suite

4 years agoMerge pull request #6012 from ton31337/fix/add_rfc6608_to_supported_list
Donald Sharp [Tue, 17 Mar 2020 01:19:08 +0000 (21:19 -0400)]
Merge pull request #6012 from ton31337/fix/add_rfc6608_to_supported_list

doc: Add rfc6608 to supported list

4 years agodoc: Add rfc6608 to supported list
Donatas Abraitis [Mon, 16 Mar 2020 19:57:45 +0000 (21:57 +0200)]
doc: Add rfc6608 to supported list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotests: Optimize bgp-basic-functionality-topo1 test suite
Kuldeep Kashyap [Mon, 16 Mar 2020 19:51:41 +0000 (19:51 +0000)]
tests: Optimize bgp-basic-functionality-topo1 test suite

1. Used aggresive values to verify keepalive and holddown timers functionality
2. Modified variable name in lib/bgp.py

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
4 years agoMerge pull request #5976 from rubenk/build-detect-python-3.8
Quentin Young [Mon, 16 Mar 2020 19:22:44 +0000 (15:22 -0400)]
Merge pull request #5976 from rubenk/build-detect-python-3.8

build: Add Python 3.8

4 years agoMerge pull request #5998 from donaldsharp/more_spelling
Santosh P K [Mon, 16 Mar 2020 18:16:53 +0000 (23:46 +0530)]
Merge pull request #5998 from donaldsharp/more_spelling

More spelling

4 years agoMerge pull request #6002 from ton31337/feature/rfc6608_fsm_sub_error_codes
Quentin Young [Mon, 16 Mar 2020 18:13:56 +0000 (14:13 -0400)]
Merge pull request #6002 from ton31337/feature/rfc6608_fsm_sub_error_codes

bgpd: Add subcodes for BGP Finite State Machine Error

4 years agoMerge pull request #5970 from rubenk/build-cleanup-configure-tests
Quentin Young [Mon, 16 Mar 2020 18:00:21 +0000 (14:00 -0400)]
Merge pull request #5970 from rubenk/build-cleanup-configure-tests

Build: cleanup configure tests

4 years agotests/isisd: Update expected output to match corrected spelling
Christian Franke [Mon, 16 Mar 2020 14:36:12 +0000 (15:36 +0100)]
tests/isisd: Update expected output to match corrected spelling

The update was performed using wuschl [1] like this:

$ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
$ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

[1] https://pypi.org/project/wuschl/

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
4 years agoMerge pull request #6000 from ton31337/fix/distinguish_src_destination_pbr
Donald Sharp [Mon, 16 Mar 2020 12:25:27 +0000 (08:25 -0400)]
Merge pull request #6000 from ton31337/fix/distinguish_src_destination_pbr

zebra: Distinguish source/destination PBR IP in zlog_warn messages

4 years agoMerge pull request #6005 from sarav511/bsr_json
Donald Sharp [Mon, 16 Mar 2020 12:24:44 +0000 (08:24 -0400)]
Merge pull request #6005 from sarav511/bsr_json

pimd: show ip pim bsr json output - removing vtysh caption

4 years agoMerge pull request #6007 from sarav511/unlck
Donald Sharp [Mon, 16 Mar 2020 12:24:10 +0000 (08:24 -0400)]
Merge pull request #6007 from sarav511/unlck

pimd: moving the route_unlock_node outside debug function

4 years agoMerge pull request #5941 from patrasar/217793
Donald Sharp [Mon, 16 Mar 2020 12:14:28 +0000 (08:14 -0400)]
Merge pull request #5941 from patrasar/217793

pimd: Don't refresh mroute_creation for kernel-installed mroute

4 years agobgpd: Add subcodes for BGP Finite State Machine Error
Donatas Abraitis [Sun, 15 Mar 2020 12:19:11 +0000 (14:19 +0200)]
bgpd: Add subcodes for BGP Finite State Machine Error

Implement https://tools.ietf.org/html/rfc6608

I used python scapy library to send a notification message in OpenSent state:
```
send(IP(dst="192.168.0.1")/TCP(sport=sp,
dport=179,
seq=rec.ack,
ack=rec.seq + 1,
flags=0x18)/BGPHeader(type=3)/BGPNotification(error_code=4,
error_subcode=0))
```

Logs from FRR:
```
%NOTIFICATION: sent to neighbor 192.168.0.2 5/1 (Neighbor Events Error/Receive Unexpected Message in OpenSent State) 0 bytes
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agopimd: moving the route_unlock_node outside debug function
saravanank [Mon, 16 Mar 2020 02:36:33 +0000 (19:36 -0700)]
pimd: moving the route_unlock_node outside debug function

Problem: Route node is not de referenced after search when pim debug events are
not enabled when pim_rp_find_match_group is called. So this memory will not get
released when route node is deleted after hitting this path.

RCA: Dereferencing is done inside debug condition.

Fix: Moving outside debug condition

Signed-off-by: Saravanan K <saravanank@vmware.com>