]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 years agozebra: fix some coverity SA warnings 6211/head
Mark Stapp [Mon, 13 Apr 2020 14:25:48 +0000 (10:25 -0400)]
zebra: fix some coverity SA warnings

Fix several coverity scan warnings.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #6199 from opensourcerouting/bfdd-improvements
Donald Sharp [Mon, 13 Apr 2020 00:28:35 +0000 (20:28 -0400)]
Merge pull request #6199 from opensourcerouting/bfdd-improvements

bfdd: misc code improvements and fixes

5 years agoMerge pull request #6204 from opensourcerouting/fix-eigrp-neighbor
Donald Sharp [Mon, 13 Apr 2020 00:25:26 +0000 (20:25 -0400)]
Merge pull request #6204 from opensourcerouting/fix-eigrp-neighbor

yang: use the correct type for EIGRP neighbors

5 years agoyang: use the correct type for EIGRP neighbors 6204/head
Renato Westphal [Sun, 12 Apr 2020 03:12:19 +0000 (00:12 -0300)]
yang: use the correct type for EIGRP neighbors

Fixes #6193.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #6181 from volta-networks/fix_isisd_no_metric_style
Renato Westphal [Sun, 12 Apr 2020 02:29:28 +0000 (23:29 -0300)]
Merge pull request #6181 from volta-networks/fix_isisd_no_metric_style

isisd: fix two 'no X' commands

5 years agoMerge pull request #6027 from sarav511/vrfloop
Donald Sharp [Fri, 10 Apr 2020 18:02:28 +0000 (14:02 -0400)]
Merge pull request #6027 from sarav511/vrfloop

pimd: crash while finding primary address.

5 years agoMerge pull request #6176 from NaveenThanikachalam/memleaks
Quentin Young [Fri, 10 Apr 2020 17:55:52 +0000 (13:55 -0400)]
Merge pull request #6176 from NaveenThanikachalam/memleaks

bgpd: Fixes for memory leaks.

5 years agobfdd: use standard log macros 6199/head
Rafael Zalamena [Fri, 10 Apr 2020 14:06:22 +0000 (11:06 -0300)]
bfdd: use standard log macros

Remove old log_* macros and standardize on FRR's logging infrastructure.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #6189 from vivek-cumulus/unequal_cost_multipath_fixes
Russ White [Fri, 10 Apr 2020 13:03:50 +0000 (09:03 -0400)]
Merge pull request #6189 from vivek-cumulus/unequal_cost_multipath_fixes

Unequal cost multipath fixes

5 years agobfdd: fix transmission timer calculation
Rafael Zalamena [Thu, 9 Apr 2020 20:46:02 +0000 (17:46 -0300)]
bfdd: fix transmission timer calculation

According to the RFC 5880 the transmission time should be mandated by
the slowest system.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobfdd: initialize packet data with zeroes
Rafael Zalamena [Thu, 9 Apr 2020 20:44:56 +0000 (17:44 -0300)]
bfdd: initialize packet data with zeroes

Lets avoid garbage data on packets by zeroing the packet before setting
the fields/flags.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobfdd: remove BFD_*_FLAG macros
Rafael Zalamena [Thu, 9 Apr 2020 19:52:49 +0000 (16:52 -0300)]
bfdd: remove BFD_*_FLAG macros

Lets use what FRR provide us instead of implementing a new macros.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #6124 from kuldeepkash/bgp_basic_functionality
Donatas Abraitis [Thu, 9 Apr 2020 12:59:49 +0000 (15:59 +0300)]
Merge pull request #6124 from kuldeepkash/bgp_basic_functionality

tests: Adding new test suite bgp_as_allow_in

5 years agotests: Added new tests to bgp-basic-functionality-topo1 6124/head
Kuldeep Kashyap [Wed, 1 Apr 2020 05:30:38 +0000 (05:30 +0000)]
tests: Added new tests to bgp-basic-functionality-topo1

1. Added 2 new test cases to bgp-basic-functionality-topo1
2. Enhanced 2 tests to run for both static routes and network advvertise command

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
5 years agotests: Adding new test suite bgp_as_allow_in
Kuldeep Kashyap [Wed, 1 Apr 2020 04:41:45 +0000 (04:41 +0000)]
tests: Adding new test suite bgp_as_allow_in

1. Added 5 test cases to verify BGP AS-allow-in behavior in FRR
2. Enhanced framework to support BGP AS-allow-in config(lib/bgp.py)
3. Added API in bgp.py to verify BGP RIB table(lib/bgp.py)

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
5 years agoMerge pull request #6125 from kuldeepkash/bgp-communities
Donatas Abraitis [Thu, 9 Apr 2020 08:49:43 +0000 (11:49 +0300)]
Merge pull request #6125 from kuldeepkash/bgp-communities

tests: Adding new test suite bgp_communities_topo1

5 years agobgpd: Fixes for memory leaks. 6176/head
Naveen Thanikachalam [Tue, 7 Apr 2020 12:03:34 +0000 (05:03 -0700)]
bgpd: Fixes for memory leaks.

This commit addresses the memory leaks when certain BGP JSON
show commands are executed

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
5 years agobgpd: Trigger EVPN type-5 injection upon link-bandwidth change 6189/head
vivek [Thu, 9 Apr 2020 01:46:59 +0000 (18:46 -0700)]
bgpd: Trigger EVPN type-5 injection upon link-bandwidth change

Ensure that upon a link-bandwidth change - for e.g., due to change in
the number of multipaths - EVPN type-5 route injection is triggered.
In the absence of this, the proper link-bandwidth is not updated in
EVPN type-5 routes originated by the router.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
5 years agobgpd: Fix overflow in bandwidth calc
vivek [Thu, 9 Apr 2020 01:14:19 +0000 (18:14 -0700)]
bgpd: Fix overflow in bandwidth calc

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
5 years agoMerge pull request #6175 from ton31337/fix/avoid_same_type_typecasting
David Lamparter [Wed, 8 Apr 2020 20:44:53 +0000 (22:44 +0200)]
Merge pull request #6175 from ton31337/fix/avoid_same_type_typecasting

*: Do not cast to the same type

5 years agoMerge pull request #6185 from opensourcerouting/build-assorted-20200408
Donald Sharp [Wed, 8 Apr 2020 17:29:45 +0000 (13:29 -0400)]
Merge pull request #6185 from opensourcerouting/build-assorted-20200408

assorted build fixes

5 years agoMerge pull request #6186 from ton31337/fix/no_magic_numbers_community
Donald Sharp [Wed, 8 Apr 2020 17:28:56 +0000 (13:28 -0400)]
Merge pull request #6186 from ton31337/fix/no_magic_numbers_community

bgpd: Use COMMUNITY_SIZE instead of just 4

5 years agoMerge pull request #6041 from donaldsharp/wang_a_yump
Renato Westphal [Wed, 8 Apr 2020 16:33:17 +0000 (13:33 -0300)]
Merge pull request #6041 from donaldsharp/wang_a_yump

Wang a yump

5 years agobgpd: Use COMMUNITY_SIZE instead of just 4 6186/head
Donatas Abraitis [Wed, 8 Apr 2020 15:09:25 +0000 (18:09 +0300)]
bgpd: Use COMMUNITY_SIZE instead of just 4

Easier to maintain and read.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #6128 from donaldsharp/more_static_routes_tests
Renato Westphal [Wed, 8 Apr 2020 14:59:15 +0000 (11:59 -0300)]
Merge pull request #6128 from donaldsharp/more_static_routes_tests

tests: Add a couple more static route tests

5 years agobuild: fix git detection for worktrees 6185/head
David Lamparter [Wed, 8 Apr 2020 13:18:34 +0000 (15:18 +0200)]
build: fix git detection for worktrees

When using additional git worktrees, .git is not a directory.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoyang/embedmodel.py: create output dir if needed
David Lamparter [Wed, 8 Apr 2020 13:21:17 +0000 (15:21 +0200)]
yang/embedmodel.py: create output dir if needed

For builds with separate build directory, just to be on the safe side.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotests: fix parallel build race
David Lamparter [Wed, 8 Apr 2020 13:17:21 +0000 (15:17 +0200)]
tests: fix parallel build race

If we're building with a separate build directory, these two build
targets can fail in case their output directory hasn't been created by
some other target that may or may not have run earlier.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotests: Add tests to rip and ripngd to show func works 6041/head
Donald Sharp [Thu, 19 Mar 2020 02:29:00 +0000 (22:29 -0400)]
tests: Add tests to rip and ripngd to show func works

Add some basic tests to show that network and passive-interface
commands work with interface names in rip and ripngd.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoyang: Temp change interface type to string to allow configuration
Donald Sharp [Wed, 8 Apr 2020 14:17:24 +0000 (10:17 -0400)]
yang: Temp change interface type to string to allow configuration

Temporarily change the interface types in rip and ripng to
strings to allow us to work, since the yang uplift to 1.0
is proving difficult.

Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com>
5 years agotools: Add coccinelle script to catch typecasts to same type 6175/head
Donatas Abraitis [Wed, 8 Apr 2020 05:57:37 +0000 (08:57 +0300)]
tools: Add coccinelle script to catch typecasts to same type

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years ago*: Do not cast to the same type
Donatas Abraitis [Wed, 8 Apr 2020 05:57:15 +0000 (08:57 +0300)]
*: Do not cast to the same type

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5928 from xThaid/rt_link_cleanup
David Lamparter [Wed, 8 Apr 2020 13:38:46 +0000 (15:38 +0200)]
Merge pull request #5928 from xThaid/rt_link_cleanup

zebra: make common function for RTM_NEWNEIGH calls

5 years agoMerge pull request #5917 from Spantik/ospf_redis
Russ White [Wed, 8 Apr 2020 13:35:56 +0000 (09:35 -0400)]
Merge pull request #5917 from Spantik/ospf_redis

Zebra: Default route distribute handling.

5 years agotests: Add a couple more static route tests 6128/head
Donald Sharp [Wed, 1 Apr 2020 12:56:22 +0000 (08:56 -0400)]
tests: Add a couple more static route tests

Add a couple more tests to static route installation
Do some very very basic work to make sure that they are working
the way we want.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agotests: Adding new test suite bgp_communities_topo1 6125/head
Kuldeep Kashyap [Wed, 1 Apr 2020 06:56:54 +0000 (06:56 +0000)]
tests: Adding new test suite bgp_communities_topo1

1. Added 1 test case to verify NO-ADVERTISE Community functionality
2. Enhanced bgp.py to exclude routers from verification, if doesn't have bgp config

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
5 years agotests: Added new tests to bgp-basic-functionality-topo1
Kuldeep Kashyap [Wed, 1 Apr 2020 05:30:38 +0000 (05:30 +0000)]
tests: Added new tests to bgp-basic-functionality-topo1

1. Added 2 new test cases to bgp-basic-functionality-topo1
2. Enhanced 2 tests to run for both static routes and network advvertise command

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
5 years agotests: Adding new test suite bgp_as_allow_in
Kuldeep Kashyap [Wed, 1 Apr 2020 04:41:45 +0000 (04:41 +0000)]
tests: Adding new test suite bgp_as_allow_in

1. Added 5 test cases to verify BGP AS-allow-in behavior in FRR
2. Enhanced framework to support BGP AS-allow-in config(lib/bgp.py)
3. Added API in bgp.py to verify BGP RIB table(lib/bgp.py)

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
5 years agoMerge pull request #6166 from volta-networks/fix_isis_lsp_timers
Olivier Dugeon [Wed, 8 Apr 2020 08:00:03 +0000 (10:00 +0200)]
Merge pull request #6166 from volta-networks/fix_isis_lsp_timers

isisd, yang: unified lsp-timers command

5 years agoMerge pull request #6180 from mjstapp/fix_bgp_ecomm_sa
Renato Westphal [Wed, 8 Apr 2020 02:00:06 +0000 (23:00 -0300)]
Merge pull request #6180 from mjstapp/fix_bgp_ecomm_sa

bgpd: clean up SA warning in bgp_ecommunity.c

5 years agoMerge pull request #6174 from volta-networks/fix_lm_async_log
Renato Westphal [Wed, 8 Apr 2020 01:59:09 +0000 (22:59 -0300)]
Merge pull request #6174 from volta-networks/fix_lm_async_log

zebra: minor fix to label manager log

5 years agoMerge pull request #6183 from qlyoung/doc-isis-lsp-mtu-knob
Renato Westphal [Wed, 8 Apr 2020 01:44:42 +0000 (22:44 -0300)]
Merge pull request #6183 from qlyoung/doc-isis-lsp-mtu-knob

doc: document lsp-mtu knob for IS-IS

5 years agodoc: document lsp-mtu knob for IS-IS 6183/head
Quentin Young [Wed, 8 Apr 2020 00:11:18 +0000 (20:11 -0400)]
doc: document lsp-mtu knob for IS-IS

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoisisd: fix two 'no X' commands 6181/head
Emanuele Di Pascale [Tue, 7 Apr 2020 16:41:15 +0000 (18:41 +0200)]
isisd: fix two 'no X' commands

for some reason, when issuing a 'no metric-style' command we were
setting the metric-style to narrow, even though the default is
actually wide. Use NULL to avoid similar problems in the future.

Likewise, the 'no is-type' command was still trying to implement
the old logic of applying a different default for the first area.
In practice this had no effect because the value would now be the
same in both cases, but it's better to remove useless code anyway.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
5 years agoZebra: Default route distribute handling. 5917/head
Santosh P K [Tue, 7 Apr 2020 14:02:21 +0000 (07:02 -0700)]
Zebra: Default route distribute handling.

When default route is requested from client, default
route is sent to client if present. When route gets
deleted then delete is sent to clients.

Signed-off-by: Santosh P K <sapk@vmware.com>
5 years agoMerge pull request #6178 from opensourcerouting/debian-backprop
Quentin Young [Tue, 7 Apr 2020 17:03:21 +0000 (13:03 -0400)]
Merge pull request #6178 from opensourcerouting/debian-backprop

feed debian/ changes back into master

5 years agobgpd: clean up SA warning in bgp_ecommunity.c 6180/head
Mark Stapp [Tue, 7 Apr 2020 16:56:43 +0000 (12:56 -0400)]
bgpd: clean up SA warning in bgp_ecommunity.c

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #6179 from ton31337/fix/typecast_to_biger_sizes
Quentin Young [Tue, 7 Apr 2020 16:42:38 +0000 (12:42 -0400)]
Merge pull request #6179 from ton31337/fix/typecast_to_biger_sizes

tools: Add coccinelle script to catch typecasts to larger sizes

5 years agoMerge pull request #6097 from mjstapp/fix_nhg_cli_dups
Stephen Worley [Tue, 7 Apr 2020 16:14:44 +0000 (12:14 -0400)]
Merge pull request #6097 from mjstapp/fix_nhg_cli_dups

lib: support replacement in the nexthop-group cli

5 years agoMerge pull request #6173 from ton31337/fix/treat-as-withdraw_community
Russ White [Tue, 7 Apr 2020 15:42:01 +0000 (11:42 -0400)]
Merge pull request #6173 from ton31337/fix/treat-as-withdraw_community

bgpd: Treat-as-withdraw if [el]community length is zero

5 years agotools: Add coccinelle script to catch typecasts to larger sizes 6179/head
Donatas Abraitis [Tue, 7 Apr 2020 14:25:10 +0000 (17:25 +0300)]
tools: Add coccinelle script to catch typecasts to larger sizes

That's valid only for uint*_t

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agodebian: 7.2.1 prep 6178/head
David Lamparter [Mon, 20 Jan 2020 15:57:10 +0000 (16:57 +0100)]
debian: 7.2.1 prep

Just the odd housekeeping bits.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agodebian: remove outdated README content
David Lamparter [Mon, 20 Jan 2020 15:53:55 +0000 (16:53 +0100)]
debian: remove outdated README content

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agolib: support replacement in the nexthop-group cli 6097/head
Mark Stapp [Thu, 26 Mar 2020 18:11:56 +0000 (14:11 -0400)]
lib: support replacement in the nexthop-group cli

Use more limited matching logic so that nexthops within a
nexthop-group are unique based only on vrf, type, and gateway.
Treat configuration of a nexthop that matches an existing
nexthop as a replace operation.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: minor fix to label manager log 6174/head
Emanuele Di Pascale [Thu, 2 Apr 2020 22:05:44 +0000 (00:05 +0200)]
zebra: minor fix to label manager log

zebra should only check whether a get_chunk operation succeeded
when processing the response, rather than insde the get_chunk
call itself. Spllitting the request and response hooks was done
precisely to allow for asynchronous calls to an external label
manager; in this case, the requested chunk is not necessarily
going to be available at request time.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
5 years agobgpd: Treat-as-withdraw if [el]community length is zero 6173/head
Donatas Abraitis [Tue, 7 Apr 2020 07:08:16 +0000 (10:08 +0300)]
bgpd: Treat-as-withdraw if [el]community length is zero

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #6167 from qlyoung/fix-cluster-list-uaf
Donatas Abraitis [Tue, 7 Apr 2020 06:47:28 +0000 (09:47 +0300)]
Merge pull request #6167 from qlyoung/fix-cluster-list-uaf

bgpd: treat 0-length cluster_list as withdraw

5 years agoMerge pull request #6160 from qlyoung/fix-pim-bsm-negative-shift
David Lamparter [Mon, 6 Apr 2020 18:26:13 +0000 (20:26 +0200)]
Merge pull request #6160 from qlyoung/fix-pim-bsm-negative-shift

pimd: fix negative bitshift in BSM code

5 years agobgpd: treat 0-length cluster_list as withdraw 6167/head
Quentin Young [Mon, 6 Apr 2020 16:30:35 +0000 (12:30 -0400)]
bgpd: treat 0-length cluster_list as withdraw

See source comment...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agopimd: fix negative bitshift 6160/head
Quentin Young [Mon, 6 Apr 2020 03:40:47 +0000 (23:40 -0400)]
pimd: fix negative bitshift

Valid range for hashmasklen is 0-32 under IPv4; failure to validate this
results in a negative bitshift later

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #6150 from ton31337/feature/black_topotests_developer_guide
David Lamparter [Mon, 6 Apr 2020 15:39:20 +0000 (17:39 +0200)]
Merge pull request #6150 from ton31337/feature/black_topotests_developer_guide

doc: Mention that we should use `black` code formatter for topotests

5 years agoisisd, yang: unified lsp-timers command 6166/head
Emanuele Di Pascale [Mon, 6 Apr 2020 15:05:41 +0000 (17:05 +0200)]
isisd, yang: unified lsp-timers command

Yang constraints enforced by the northbound callbacks require that
the maximum lifetime be >= than (refresh interval + 300). When we are
moving from one config to another through frr-reload.py, we issue
a number of vtysh -c commands ('no lsp-refresh-interval level-1 500',
'no max-lsp-lifetime level-1 1000'), which reset these parameters to their
default values, respectively 900 and 1200. Depending on the actual
values in the current config, the order in which these commands are sent
might be the wrong one, in that we hit an invalid intermediate state and
make vtysh (and by extension frr-reload.py) return an error.

As a workaround, let's add a one-liner command that sets all these
inter-related parameters in one go, and make isisd display them as a
single line too, so that the diff will be computed as a single command.
The old individual commands are kept to ensure backwards compatibility.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
5 years agoMerge pull request #6158 from qlyoung/fix-cluster-list-uaf
David Lamparter [Mon, 6 Apr 2020 15:38:27 +0000 (17:38 +0200)]
Merge pull request #6158 from qlyoung/fix-cluster-list-uaf

bgpd: fix multiple bugs with cluster_list attrs

5 years agoMerge pull request #6155 from qlyoung/fix-unsigned-cmp-lt-zero
David Lamparter [Mon, 6 Apr 2020 15:37:11 +0000 (17:37 +0200)]
Merge pull request #6155 from qlyoung/fix-unsigned-cmp-lt-zero

bgpd, zebra: don't compare unsigned < 0

5 years agoMerge pull request #6159 from qlyoung/fix-pim-tlv-unaligned-pointer-access
David Lamparter [Mon, 6 Apr 2020 15:33:01 +0000 (17:33 +0200)]
Merge pull request #6159 from qlyoung/fix-pim-tlv-unaligned-pointer-access

pimd: fix unaligned pointer access

5 years agoMerge pull request #6161 from qlyoung/fix-bsm-json-keys
Donatas Abraitis [Mon, 6 Apr 2020 07:37:32 +0000 (10:37 +0300)]
Merge pull request #6161 from qlyoung/fix-bsm-json-keys

pimd: fix BSM JSON keys

5 years agopimd: fix unaligned access parsing tlvs 6159/head
Quentin Young [Mon, 6 Apr 2020 04:14:14 +0000 (00:14 -0400)]
pimd: fix unaligned access parsing tlvs

Can't use a uint8_t as a uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agopimd: fix BSM JSON keys 6161/head
Quentin Young [Mon, 6 Apr 2020 03:53:02 +0000 (23:53 -0400)]
pimd: fix BSM JSON keys

We use camelCase keys in FRR.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: fix multiple bugs with cluster_list attrs 6157/head 6158/head
Quentin Young [Sun, 5 Apr 2020 21:11:25 +0000 (17:11 -0400)]
bgpd: fix multiple bugs with cluster_list attrs

Multiple different issues causing mostly UAFs but maybe other more
subtle things.

- Cluster lists were the only attributes whose pointers were not being
  NULL'd when freed, resulting in heap UAF
- When performing an insert into the cluster hash, our temporary struct
  used for hash_get() was inconsistent with our hash keying and
  comparison functions. In the case of a zero length cluster list, the
  ->length field is 0 and the ->list field is NULL. When performing an
  insert, we set the ->list field regardless of whether the length is 0.
  This resulted in the two cluster lists hashing equal but not comparing
  equal. Later, when removing one of them from the hash before freeing
  it, because the key matched and the comparison succeeded (because it
  was set to NULL *after* the search but *before* inserting into the
  hash) we would sometimes release the duplicated copy of the struct,
  and then free the one that remained in the hash table. Later accesses
  constitute UAF. This is fixed by making sure the fields used for the
  existence check match what is actually inserted into the hash when
  that check fails.

This patch also makes cluster_unintern static, because it should be.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #6105 from vivek-cumulus/bgp_link_bandwidth_unequal_cost_multipath
Sri Mohana Singamsetty [Sun, 5 Apr 2020 18:41:42 +0000 (11:41 -0700)]
Merge pull request #6105 from vivek-cumulus/bgp_link_bandwidth_unequal_cost_multipath

Unequal cost multipath (a.ka. weighted ECMP) with BGP link-bandwidth

5 years agoMerge pull request #6143 from ton31337/fix/remove_prefixReceivedCount
Sri Mohana Singamsetty [Sun, 5 Apr 2020 18:41:04 +0000 (11:41 -0700)]
Merge pull request #6143 from ton31337/fix/remove_prefixReceivedCount

bgpd: Remove `prefixReceivedCount` from JSON

5 years agoMerge pull request #6144 from ton31337/fix/python_formatter
Quentin Young [Sun, 5 Apr 2020 17:20:30 +0000 (13:20 -0400)]
Merge pull request #6144 from ton31337/fix/python_formatter

tests: Run python formatter (black) for topotests

5 years agoMerge pull request #6153 from opensourcerouting/nb-stuff
Quentin Young [Sun, 5 Apr 2020 17:19:22 +0000 (13:19 -0400)]
Merge pull request #6153 from opensourcerouting/nb-stuff

Minor NB improvements

5 years agodoc: Mention that we should use `black` code formatter for topotests 6150/head
Donatas Abraitis [Fri, 3 Apr 2020 19:26:19 +0000 (22:26 +0300)]
doc: Mention that we should use `black` code formatter for topotests

black - https://github.com/psf/black

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #6134 from taspelund/unlink_warning
Donatas Abraitis [Sun, 5 Apr 2020 15:52:08 +0000 (18:52 +0300)]
Merge pull request #6134 from taspelund/unlink_warning

vtysh: don't warn when saving conf the first time

5 years agoMerge pull request #6156 from qlyoung/fix-bgp-null-memcp-again
Donatas Abraitis [Sun, 5 Apr 2020 07:53:23 +0000 (10:53 +0300)]
Merge pull request #6156 from qlyoung/fix-bgp-null-memcp-again

bgpd: fix memcmp(null, *) when parsing bgp attrs

5 years agobgpd: fix memcmp(null, *) when parsing bgp attrs 6156/head
Quentin Young [Sun, 5 Apr 2020 05:02:42 +0000 (01:02 -0400)]
bgpd: fix memcmp(null, *) when parsing bgp attrs

My first patch for this only fixed the memcmp(NULL, NULL) case.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd, zebra: don't compare unsigned < 0 6155/head
Quentin Young [Sun, 5 Apr 2020 03:26:19 +0000 (23:26 -0400)]
bgpd, zebra: don't compare unsigned < 0

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #6146 from AnuradhaKaruppiah/evpn-null-fix
Sri Mohana Singamsetty [Sat, 4 Apr 2020 03:57:42 +0000 (20:57 -0700)]
Merge pull request #6146 from AnuradhaKaruppiah/evpn-null-fix

zebra: fix NULL deref reported by coverity in evpn-pim cleanup

5 years agolib: consolidate flexible array hack in a single place 6153/head
Renato Westphal [Fri, 3 Apr 2020 23:10:04 +0000 (20:10 -0300)]
lib: consolidate flexible array hack in a single place

Old gcc versions (< 5.x) have a bug that prevents C99 flexible
arrays from working properly on shared libraries.

We already have a hack in place to work around this problem, but it
needs to be replicated in every declaration of a frr_yang_module_info
variable within libfrr. This clearly isn't a good solution if we
consider that many more libfrr YANG modules are about to come in
the future.

This commit introduces a different workaround that operates within
the northbound layer itself, such that implementers of libfrr YANG
modules won't need to worry about this problem anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib, tools: silence harmless warnings in the northbound tools
Renato Westphal [Fri, 3 Apr 2020 22:43:02 +0000 (19:43 -0300)]
lib, tools: silence harmless warnings in the northbound tools

Our two northbound tools don't have embedded YANG modules like the
other FRR binaries. As such, ly_ctx_set_module_imp_clb() shouldn't be
called when the YANG subsystem it being initialized by a northbound
tool. To make that possible, add a new "embedded_modules" parameter
to the yang_init() function to control whether libyang should look
for embedded modules or not.

With this fix, "gen_northbound_callbacks" and "gen_yang_deviations"
won't emit "YANG model X not embedded, trying external file"
warnings anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #6149 from Spantik/route-map-yang
Donald Sharp [Fri, 3 Apr 2020 22:32:29 +0000 (18:32 -0400)]
Merge pull request #6149 from Spantik/route-map-yang

lib: [YANG] Route-map inteface forward ref

5 years agolib: [YANG] Route-map inteface forward ref 6149/head
Santosh P K [Fri, 3 Apr 2020 19:15:20 +0000 (12:15 -0700)]
lib: [YANG] Route-map inteface forward ref

To satisfy forward reference for interface in route-map.
Libyang 0.16 does not support leafref yet.

Signed-off-by: Santosh P K <sapk@vmware.com>
5 years agotests: Run python formatter (black) for topotests 6144/head
reformat [Fri, 3 Apr 2020 11:05:24 +0000 (14:05 +0300)]
tests: Run python formatter (black) for topotests

Mostly ' => ", whitespace changes.

Using https://github.com/psf/black

Signed-off-by: reformat <reformat@nobody.nobody>
5 years agoMerge pull request #6071 from ton31337/feature/rfc6286
David Lamparter [Fri, 3 Apr 2020 13:16:59 +0000 (15:16 +0200)]
Merge pull request #6071 from ton31337/feature/rfc6286

bgpd: Add support for Autonomous-System-Wide Unique BGP Identifier

5 years agobgpd: Remove `prefixReceivedCount` from JSON 6143/head
Donatas Abraitis [Fri, 3 Apr 2020 13:16:06 +0000 (16:16 +0300)]
bgpd: Remove `prefixReceivedCount` from JSON

This is already covered by pfxRcd. Removed due to consistency
between CLI and JSON.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agotests: Replace prefixReceivedCount to pfxRcd in JSONs
Donatas Abraitis [Fri, 3 Apr 2020 13:15:55 +0000 (16:15 +0300)]
tests: Replace prefixReceivedCount to pfxRcd in JSONs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agozebra: fix NULL deref reported by coverity in evpn-pim cleanup 6146/head
Anuradha Karuppiah [Fri, 3 Apr 2020 12:56:27 +0000 (05:56 -0700)]
zebra: fix NULL deref reported by coverity in evpn-pim cleanup

*** CID 1492481:  Null pointer dereferences  (NULL_RETURNS)
/zebra/zebra_vxlan.c: 10262 in zebra_evpn_pim_cfg_clean_up()
10256     }
10257
10258     static int zebra_evpn_pim_cfg_clean_up(struct zserv *client)
10259     {
10260      struct zebra_vrf *zvrf = zebra_vrf_get_evpn();
10261
>>>     CID 1492481:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "zvrf", which is known to be "NULL".
10262      if (CHECK_FLAG(zvrf->flags, ZEBRA_PIM_SEND_VXLAN_SG)) {
10263      if (IS_ZEBRA_DEBUG_VXLAN)
10264      zlog_debug("VxLAN SG updates to PIM, stop");
10265      UNSET_FLAG(zvrf->flags, ZEBRA_PIM_SEND_VXLAN_SG);
10266      }

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agoMerge pull request #6138 from donaldsharp/rtadv_respect_the_vrf
David Lamparter [Fri, 3 Apr 2020 12:04:43 +0000 (14:04 +0200)]
Merge pull request #6138 from donaldsharp/rtadv_respect_the_vrf

Rtadv respect the vrf

5 years agovtysh: don't warn when saving conf the first time 6134/head
Trey Aspelund [Wed, 1 Apr 2020 23:59:32 +0000 (19:59 -0400)]
vtysh: don't warn when saving conf the first time

This removes a warning when ENOENT is returned while backing up the
config. This also provides strerror when backup fails for other reasons.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
5 years agoMerge pull request #6130 from ton31337/fix/remove_some_redundant_attributes_from_json
Sri Mohana Singamsetty [Thu, 2 Apr 2020 23:17:24 +0000 (16:17 -0700)]
Merge pull request #6130 from ton31337/fix/remove_some_redundant_attributes_from_json

bgpd: Remove deprecated JSON fields for `show bgp ... json`

5 years agoMerge pull request #6141 from opensourcerouting/defaults-fix-bools
Donald Sharp [Thu, 2 Apr 2020 22:49:34 +0000 (18:49 -0400)]
Merge pull request #6141 from opensourcerouting/defaults-fix-bools

bgpd, ospfd, ospf6d: long is not bool :(

5 years agobgpd, ospfd, ospf6d: long is not bool :( 6141/head
David Lamparter [Thu, 2 Apr 2020 19:16:04 +0000 (21:16 +0200)]
bgpd, ospfd, ospf6d: long is not bool :(

... Oops ...

(for context, the defaults code originally didn't have a dedicated
"bool" variant and just used long for bools...  I derp'd this when
adding bool as a separate case :( )

Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #6133 from sworleys/NHG-Fix-Dup-Leak
Mark Stapp [Thu, 2 Apr 2020 17:18:30 +0000 (13:18 -0400)]
Merge pull request #6133 from sworleys/NHG-Fix-Dup-Leak

zebra: free unhashable (dup) NHEs via ID table cleanup

5 years agozebra: free unhashable (dup) NHEs via ID table cleanup 6133/head
Stephen Worley [Wed, 1 Apr 2020 19:31:40 +0000 (15:31 -0400)]
zebra: free unhashable (dup) NHEs via ID table cleanup

Free unhashable (duplicate NHEs from the kernel) via ID table
cleanup. Since the NHE ID hash table contains extra entries,
that's the one we need to be calling zebra_nhg_hash_free()
on, otherwise we will never free the unhashable NHEs.

This was found via a memleak:

==1478713== HEAP SUMMARY:
==1478713==     in use at exit: 10,267 bytes in 46 blocks
==1478713==   total heap usage: 76,810 allocs, 76,764 frees, 3,901,237 bytes allocated
==1478713==
==1478713== 208 (88 direct, 120 indirect) bytes in 1 blocks are definitely lost in loss record 35 of 41
==1478713==    at 0x483BB1A: calloc (vg_replace_malloc.c:762)
==1478713==    by 0x48E35E8: qcalloc (memory.c:110)
==1478713==    by 0x451CCB: zebra_nhg_alloc (zebra_nhg.c:369)
==1478713==    by 0x453DE3: zebra_nhg_copy (zebra_nhg.c:379)
==1478713==    by 0x452670: nhg_ctx_process_new (zebra_nhg.c:1143)
==1478713==    by 0x4523A8: nhg_ctx_process (zebra_nhg.c:1234)
==1478713==    by 0x452A2D: zebra_nhg_kernel_find (zebra_nhg.c:1294)
==1478713==    by 0x4326E0: netlink_nexthop_change (rt_netlink.c:2433)
==1478713==    by 0x427320: netlink_parse_info (kernel_netlink.c:945)
==1478713==    by 0x432DAD: netlink_nexthop_read (rt_netlink.c:2488)
==1478713==    by 0x41B600: interface_list (if_netlink.c:1486)
==1478713==    by 0x457275: zebra_ns_enable (zebra_ns.c:127)

Repro with:
ip next add id 1 blackhole
ip next add id 2 blackhole

valgrind /usr/lib/frr/zebra

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agozebra: Add some vrf information to RA logs 6138/head
Donald Sharp [Thu, 2 Apr 2020 15:33:35 +0000 (11:33 -0400)]
zebra: Add some vrf information to RA logs

Add some data about what vrf we are operating on
in the RA logs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Don't kill the global rtadv socket when a vrf is deleted
Donald Sharp [Thu, 2 Apr 2020 15:16:50 +0000 (11:16 -0400)]
zebra: Don't kill the global rtadv socket when a vrf is deleted

The rtadv code has two types of sockets:
a) namespace -> Where each zvrf get's it's own socket
b) vrf lite -> Where we get 1 socket for everything

When we were terminating a vrf we were *always*
killing the (b) socket.  This is a mistake in
that other vrf's may need to be communicating.

Modify the code on vrf shutdown to only disable
that vrf's event processing and when we actually
terminate we shut the socket.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #6132 from qlyoung/fix-bgp-vnc-ifdef
Sri Mohana Singamsetty [Thu, 2 Apr 2020 02:35:13 +0000 (19:35 -0700)]
Merge pull request #6132 from qlyoung/fix-bgp-vnc-ifdef

bgpd: #if ENABLE_BGP_VNC -> #ifdef ENABLE_BGP_VNC

5 years agoMerge pull request #6131 from qlyoung/doc-json-camelcase
Renato Westphal [Wed, 1 Apr 2020 22:52:15 +0000 (19:52 -0300)]
Merge pull request #6131 from qlyoung/doc-json-camelcase

doc: document JSON conventions

5 years agoMerge pull request #6109 from volta-networks/feat_ldp_host_only
Renato Westphal [Wed, 1 Apr 2020 22:51:22 +0000 (19:51 -0300)]
Merge pull request #6109 from volta-networks/feat_ldp_host_only

ldpd:  host only filter