]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 years agobgpd: fix memory leaks in bgp_alias2community_str 9358/head
Igor Ryzhov [Wed, 11 Aug 2021 09:09:15 +0000 (12:09 +0300)]
bgpd: fix memory leaks in bgp_alias2community_str

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: BGP extended [l]community-list regexp match must work with aliases
Donatas Abraitis [Mon, 9 Aug 2021 10:34:57 +0000 (13:34 +0300)]
bgpd: BGP extended [l]community-list regexp match must work with aliases

We have to convert BGP alias to numerical format to compare in regexp.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9349 from opensourcerouting/rpm-keep-config
Donald Sharp [Tue, 10 Aug 2021 14:12:29 +0000 (10:12 -0400)]
Merge pull request #9349 from opensourcerouting/rpm-keep-config

redhat: Install frr.conf only if no per daemon config exists

3 years agoredhat: Install frr.conf only if no per daemon config exists 9349/head
Martin Winter [Mon, 9 Aug 2021 23:52:05 +0000 (01:52 +0200)]
redhat: Install frr.conf only if no per daemon config exists

Install frr.conf template as a template file, but only install it
as a config file if no per daemon file exists. This will use the
integrated config with new setups, but keeps the per-daemon config
for existing users

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
3 years agoMerge pull request #9277 from FRRouting/mergify/bp/stable/8.0/pr-9238
Donatas Abraitis [Mon, 9 Aug 2021 07:38:16 +0000 (10:38 +0300)]
Merge pull request #9277 from FRRouting/mergify/bp/stable/8.0/pr-9238

lib, zebra: Preserve user-configured VRF on netns deletion (backport #9238)

3 years agoMerge pull request #9329 from FRRouting/mergify/bp/stable/8.0/pr-9315
Donatas Abraitis [Mon, 9 Aug 2021 07:30:59 +0000 (10:30 +0300)]
Merge pull request #9329 from FRRouting/mergify/bp/stable/8.0/pr-9315

pathd: a couple of cli/doc fixes (backport #9315)

3 years agodoc: fix pathd example config 9329/head
Igor Ryzhov [Thu, 5 Aug 2021 20:57:24 +0000 (23:57 +0300)]
doc: fix pathd example config

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

3 years agopathd: fix indentation and redundant space in index config
Igor Ryzhov [Thu, 5 Aug 2021 20:47:27 +0000 (23:47 +0300)]
pathd: fix indentation and redundant space in index config

Before:
```
segment-routing
 traffic-eng
  segment-list SL1
 index  10 mpls label 16010
```

After:
```
segment-routing
 traffic-eng
  segment-list SL1
   index 10 mpls label 16010
```

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

3 years agopathd: fix indentation for mpls-te config
Igor Ryzhov [Thu, 5 Aug 2021 20:45:44 +0000 (23:45 +0300)]
pathd: fix indentation for mpls-te config

Before:
```
segment-routing
 traffic-eng
 mpls-te on
 mpls-te import ospfv2
```

After:
```
segment-routing
 traffic-eng
  mpls-te on
  mpls-te import ospfv2
```

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

3 years agoMerge pull request #9266 from FRRouting/mergify/bp/stable/8.0/pr-9249
Donald Sharp [Sat, 7 Aug 2021 20:08:28 +0000 (16:08 -0400)]
Merge pull request #9266 from FRRouting/mergify/bp/stable/8.0/pr-9249

bgpd: Use strict AS4 capability when processing parsing/generating pkts (backport #9249)

3 years agoMerge pull request #9268 from FRRouting/mergify/bp/stable/8.0/pr-9239
Donald Sharp [Sat, 7 Aug 2021 20:08:08 +0000 (16:08 -0400)]
Merge pull request #9268 from FRRouting/mergify/bp/stable/8.0/pr-9239

ospfd: fix "no ip ospf passive" command (backport #9239)

3 years agoMerge pull request #9311 from idryzhov/bgp-opaque-fix
Donald Sharp [Sat, 7 Aug 2021 19:10:42 +0000 (15:10 -0400)]
Merge pull request #9311 from idryzhov/bgp-opaque-fix

[8.0] bgpd: limit the length of opaque data sent to zebra

3 years agoMerge pull request #9320 from idryzhov/8.0-bgp-dampening-revert
Donald Sharp [Sat, 7 Aug 2021 19:08:43 +0000 (15:08 -0400)]
Merge pull request #9320 from idryzhov/8.0-bgp-dampening-revert

[8.0] bgp per-peer dampening revert

3 years agoRevert "bgpd: peer / peer group dampening profiles" 9320/head
Igor Ryzhov [Mon, 2 Aug 2021 10:26:58 +0000 (13:26 +0300)]
Revert "bgpd: peer / peer group dampening profiles"

This reverts commit 40ec3340be9cdda62eea349fe9ee21e65156f422.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoRevert "bgpd: vtysh commands for peer/group dampening profiles"
Igor Ryzhov [Mon, 2 Aug 2021 10:19:10 +0000 (13:19 +0300)]
Revert "bgpd: vtysh commands for peer/group dampening profiles"

This reverts commit 0221327c75d370648d20c2bc4d281c23f5738f74.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoRevert "bgpd: Do not output peer doppleganger dampened output"
Igor Ryzhov [Mon, 2 Aug 2021 10:43:28 +0000 (13:43 +0300)]
Revert "bgpd: Do not output peer doppleganger dampened output"

This reverts commit 783492c7cdeaca5c73fb2debaeaa0b378ee734de.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoRevert "bgpd: Consolidate dampening show run output with the rest of that code"
Igor Ryzhov [Mon, 2 Aug 2021 10:42:56 +0000 (13:42 +0300)]
Revert "bgpd: Consolidate dampening show run output with the rest of that code"

This reverts commit 39d8dd2d176e26cff9c62f48048b18cf4df9168a.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoRevert "doc: user doc for route-flap dampening commands"
Igor Ryzhov [Mon, 2 Aug 2021 10:17:42 +0000 (13:17 +0300)]
Revert "doc: user doc for route-flap dampening commands"

This reverts commit 54b34709f8603be3f7d13ae224aa8cade49b1741.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoRevert "tests: topotests for route-flap dampening"
Igor Ryzhov [Mon, 2 Aug 2021 10:15:45 +0000 (13:15 +0300)]
Revert "tests: topotests for route-flap dampening"

This reverts commit cd32a1a4eecf2a29dbfd2493573f7473e20096d9.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoRevert "bgpd: clear ip bgp dampening was not triggering the route calculation for...
Igor Ryzhov [Mon, 2 Aug 2021 10:05:22 +0000 (13:05 +0300)]
Revert "bgpd: clear ip bgp dampening was not triggering the route calculation for the prefix"

This reverts commit c8ddbd48040be6bf33c4f0ab3e470f290f9b165a.

3 years agoRevert "bgpd: Remove useless reuselist_node assignment before while loop"
Igor Ryzhov [Mon, 2 Aug 2021 10:01:48 +0000 (13:01 +0300)]
Revert "bgpd: Remove useless reuselist_node assignment before while loop"

This reverts commit 53048d33d124e60ce01ae6bf149ae03561930694.

3 years agoRevert "bgpd: fix double free in dampening code"
Igor Ryzhov [Mon, 2 Aug 2021 10:01:38 +0000 (13:01 +0300)]
Revert "bgpd: fix double free in dampening code"

This reverts commit 96d6b8cc29bf5124ae93433ecfc16b3fd69be5ea.

3 years agoRevert "bgpd: Drop double-pointer for bgp_damp_info_free()"
Igor Ryzhov [Mon, 2 Aug 2021 10:01:32 +0000 (13:01 +0300)]
Revert "bgpd: Drop double-pointer for bgp_damp_info_free()"

This reverts commit 19971c9a9218b31e6e1c3f7ebb23654f833bb4ef.

3 years agoRevert "bgpd: fix missing list add in dampening"
Igor Ryzhov [Mon, 2 Aug 2021 10:01:26 +0000 (13:01 +0300)]
Revert "bgpd: fix missing list add in dampening"

This reverts commit cd58568b1889df753aa258ee61b6d949b1ce6fb9.

3 years agoRevert "bgpd: fix incorrect usage of slist in dampening"
Igor Ryzhov [Mon, 2 Aug 2021 10:01:18 +0000 (13:01 +0300)]
Revert "bgpd: fix incorrect usage of slist in dampening"

This reverts commit 5054cfcbbc8c776a91e9390d36cff891d0890b4f.

3 years agoRevert "bgpd: cleanup bgp_damp_info_free"
Igor Ryzhov [Mon, 2 Aug 2021 10:01:06 +0000 (13:01 +0300)]
Revert "bgpd: cleanup bgp_damp_info_free"

This reverts commit 97766ac8aa40ff8868a854ba8515c9e6441e4b7c.

3 years agoRevert "bgpd: fix missing damp info free when cleaning bgp path"
Igor Ryzhov [Mon, 2 Aug 2021 10:33:09 +0000 (13:33 +0300)]
Revert "bgpd: fix missing damp info free when cleaning bgp path"

This reverts commit 4538f89552a01e6ab3504f8a59ef156b9a14ce1c.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: limit the length of opaque data sent to zebra 9311/head
Igor Ryzhov [Fri, 6 Aug 2021 13:15:41 +0000 (16:15 +0300)]
bgpd: limit the length of opaque data sent to zebra

Previously, when aspath->str was longer than sizeof(api.opaque.data), we
were overwriting the wrong memory.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9296 from FRRouting/mergify/bp/stable/8.0/pr-9108
Donald Sharp [Thu, 5 Aug 2021 21:02:15 +0000 (17:02 -0400)]
Merge pull request #9296 from FRRouting/mergify/bp/stable/8.0/pr-9108

ospf6d: fix argument processing in the "area ... range" command (backport #9108)

3 years agoMerge pull request #9278 from FRRouting/mergify/bp/stable/8.0/pr-9231
Donald Sharp [Wed, 4 Aug 2021 17:08:41 +0000 (13:08 -0400)]
Merge pull request #9278 from FRRouting/mergify/bp/stable/8.0/pr-9231

zebra: remove checks for src address existence when using "set src" (backport #9231)

3 years agoMerge pull request #9297 from FRRouting/mergify/bp/stable/8.0/pr-9085
Donald Sharp [Wed, 4 Aug 2021 17:04:36 +0000 (13:04 -0400)]
Merge pull request #9297 from FRRouting/mergify/bp/stable/8.0/pr-9085

pimd: memory leak fix and issue fix (backport #9085)

3 years agodoc: document ospf6d's "area ... range" command 9296/head
Renato Westphal [Thu, 22 Jul 2021 02:23:10 +0000 (23:23 -0300)]
doc: document ospf6d's "area ... range" command

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

3 years agopimd : memory leak in rp_table cleanup. 9297/head
github login name [Mon, 19 Jul 2021 11:30:58 +0000 (04:30 -0700)]
pimd : memory leak in rp_table cleanup.

Problem Statement:
==================
valgrind shows memleaks in rp_table, when pimd shuts down gracefully.
2020-05-05 22:09:29,451 ERROR: Memory leaks in router [r4] for daemon [pimd]
2020-05-05 22:09:29,451 ERROR: Memory leaks in router [r4] for daemon [zebra]
2020-05-05 22:09:29,637 ERROR: Found memory leak in module pimd
2020-05-05 22:09:29,638 ERROR: ==6178== 184 (56 direct, 128 indirect) bytes in 1 blocks are definitely lost in loss record 21 of 21
2020-05-05 22:09:29,638 ERROR: ==6178== at 0x4C2FFAC: calloc (vg_replace_malloc.c:762)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x4E855EE: qcalloc (memory.c:111)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x4EAA43C: route_table_init_with_delegate (table.c:52)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x1281A1: pim_rp_init (pim_rp.c:114)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x11D0F8: pim_instance_init (pim_instance.c:117)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x11D0F8: pim_vrf_new (pim_instance.c:150)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x4EB1BEC: vrf_get (vrf.c:209)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x4EB2B2F: vrf_init (vrf.c:493)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x11D227: pim_vrf_init (pim_instance.c:217)
2020-05-05 22:09:29,638 ERROR: ==6178== by 0x11BBAB: main (pim_main.c:121)

Fix:
====
rp_info is allocated in pim_rp_init API. rp_info pointer is present
in rp_list and rp_table. In rp_list cleanup, the memory for rp_info
gets freed. rp_table clean up should be done first and then rp_list.

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

3 years agopimd: pim_ifchannel_local_membership_add should not inherit if (S,G) rpf unresolved
github login name [Mon, 19 Jul 2021 10:57:25 +0000 (03:57 -0700)]
pimd: pim_ifchannel_local_membership_add should not inherit if (S,G) rpf unresolved

Problem:
S,G entry has iif = oif in FHR is LHR case.

Setup:-

R11-----R2----R4

R11 :- FHR and LHR
R2 :- RP
R4 :- LHR

Issue :-

1) shut mapped interface in R11
2) wait for 5 min
3) do FRR restart
5) No shut of mapped interface

OIL is added for local interface also where OIL is same as IIF
and duplicate traffic observed on R4 receives in Ixia

RCA:
pim_ifchannel_local_membership_add adds inherited oif from starg when iif for
SG is unavailable.
When  rpf for that SG resolves to this inherited oif from starg, iif is also in oif.
This results in dup traffic.

Fix:
If iif is not available, do not inherit from starg.

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

3 years agoospf6d: fix argument processing in the "area ... range" command
Renato Westphal [Wed, 21 Jul 2021 16:34:56 +0000 (13:34 -0300)]
ospf6d: fix argument processing in the "area ... range" command

* When the "cost" argument isn't present, the default cost should be
  used instead of preserving the previously configured one (if any);
* When the "not-advertise" argument isn't present, the "not-advertise"
  flag should be unset regardless if it was previously configured or
  not.

Configuration commands should be deterministic and work in the same
way regardless of the current state.

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

3 years agoMerge pull request #9274 from FRRouting/mergify/bp/stable/8.0/pr-9237
Donald Sharp [Wed, 4 Aug 2021 00:52:06 +0000 (20:52 -0400)]
Merge pull request #9274 from FRRouting/mergify/bp/stable/8.0/pr-9237

doc: Fix code-block display for example shell commands (backport #9237)

3 years agoMerge pull request #9275 from FRRouting/mergify/bp/stable/8.0/pr-9214
Donald Sharp [Wed, 4 Aug 2021 00:51:38 +0000 (20:51 -0400)]
Merge pull request #9275 from FRRouting/mergify/bp/stable/8.0/pr-9214

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

3 years agoMerge pull request #9276 from FRRouting/mergify/bp/stable/8.0/pr-9246
Donald Sharp [Wed, 4 Aug 2021 00:51:00 +0000 (20:51 -0400)]
Merge pull request #9276 from FRRouting/mergify/bp/stable/8.0/pr-9246

doc: fix bgp user doc colons (backport #9246)

3 years agoMerge pull request #9279 from FRRouting/mergify/bp/stable/8.0/pr-9264
Donald Sharp [Wed, 4 Aug 2021 00:50:32 +0000 (20:50 -0400)]
Merge pull request #9279 from FRRouting/mergify/bp/stable/8.0/pr-9264

nhrp: fix display of nhs command. (backport #9264)

3 years agoMerge pull request #9267 from FRRouting/mergify/bp/stable/8.0/pr-9191
Donald Sharp [Wed, 4 Aug 2021 00:39:40 +0000 (20:39 -0400)]
Merge pull request #9267 from FRRouting/mergify/bp/stable/8.0/pr-9191

ripd: fix authentication key length (backport #9191)

3 years agonhrp: fix display of nhs command. 9279/head
Dmitrii Turlupov [Tue, 3 Aug 2021 11:00:24 +0000 (14:00 +0300)]
nhrp: fix display of nhs command.

Before:
ip nhrp nhs dynamicnbma 192.168.1.1

After:
ip nhrp nhs dynamic nbma 192.168.1.1

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
(cherry picked from commit 7a807a20d90e0833979c9cfb82ab4e319c5ea175)

3 years agozebra: remove checks for src address existence when using "set src" 9278/head
Igor Ryzhov [Thu, 29 Jul 2021 17:21:00 +0000 (20:21 +0300)]
zebra: remove checks for src address existence when using "set src"

1. This check is absolutely useless. Nothing keeps user from deleting
   the address right after this check.
2. This check prevents zebra from correctly reading the user config with
   "set src" because of a race with interface startup (see #4249).
3. NO OPERATIONAL DATA USAGE ON VALIDATION STAGE.

Fixes #7319.

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

3 years agolib, zebra: Preserve user-configured VRF on netns deletion 9277/head
Xiao Liang [Fri, 30 Jul 2021 05:00:06 +0000 (13:00 +0800)]
lib, zebra: Preserve user-configured VRF on netns deletion

Don't clear VRF's user-configured flag when netns is deleted.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
(cherry picked from commit 6910315f6f3ddd66d8929cb82deaf96d13a2bfbf)

3 years agodoc: fix bgp user doc 9276/head
Mark Stapp [Fri, 30 Jul 2021 17:54:01 +0000 (13:54 -0400)]
doc: fix bgp user doc

Too many colons in the bgp doc source file.

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

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

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

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

3 years agodoc: Fix code-block display for example shell commands 9274/head
Donald Sharp [Fri, 30 Jul 2021 01:42:06 +0000 (21:42 -0400)]
doc: Fix code-block display for example shell commands

the code-block was jumbled and not displaying properly.

Reported by: Drew Bloechl
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 01af2696ebee84cb90427aa56066ea88b05083ed)

3 years agoMerge pull request #9263 from FRRouting/mergify/bp/stable/8.0/pr-9056
Russ White [Tue, 3 Aug 2021 17:43:34 +0000 (13:43 -0400)]
Merge pull request #9263 from FRRouting/mergify/bp/stable/8.0/pr-9056

bgpd: Clear capabilities field when resetting a bgp neighbor (backport #9056)

3 years agoMerge pull request #9270 from FRRouting/mergify/bp/stable/8.0/pr-8789
Igor Ryzhov [Tue, 3 Aug 2021 17:06:20 +0000 (20:06 +0300)]
Merge pull request #9270 from FRRouting/mergify/bp/stable/8.0/pr-8789

doc: bump sphinx version to 4.0.2, remove deprecated API (backport #8789)

3 years agodoc: use add_css_file(); not deprecated 9270/head
Quentin Young [Thu, 3 Jun 2021 17:41:13 +0000 (13:41 -0400)]
doc: use add_css_file(); not deprecated

add_stylesheet() is deprecated and removed in Sphinx 4.x

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
(cherry picked from commit d6ba203d2fb190e38956082429a34c747cf9de9d)

3 years agodoc: add requirements.txt
Quentin Young [Thu, 3 Jun 2021 17:35:34 +0000 (13:35 -0400)]
doc: add requirements.txt

Add a minimum sphinx version requirement for the docs; RTD needs this to
know what version of sphinx to install.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
(cherry picked from commit 826186eab217a590d86a7bdfaab6174da51c79b2)

3 years agoospfd: fix "no ip ospf passive" command 9268/head
Igor Ryzhov [Fri, 30 Jul 2021 11:11:33 +0000 (14:11 +0300)]
ospfd: fix "no ip ospf passive" command

This command is currently always treated as an "unset" command, assuming
that active is the default type of the interface. In reality, the default
type of the interface can be changed using "passive-interface default"
command. Both "no" and regular commands can be "set" commands, depending
on the default value. They are treated as an "unset" when there's already
a config of the opposite type.

All this logic is in ospf_passive_interface_update.

Fixes #9240.

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

3 years agoripd: fix authentication key length 9267/head
Igor Ryzhov [Mon, 26 Jul 2021 19:31:41 +0000 (22:31 +0300)]
ripd: fix authentication key length

We were overwriting the last byte of the key when it's exactly 16 bytes.

Fixes #8151.

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

3 years agoMerge pull request #9257 from FRRouting/mergify/bp/stable/8.0/pr-9255
Russ White [Tue, 3 Aug 2021 13:23:25 +0000 (09:23 -0400)]
Merge pull request #9257 from FRRouting/mergify/bp/stable/8.0/pr-9255

bgpd: Set extended msg size only if we advertised and received capability (backport #9255)

3 years agoMerge pull request #9245 from ton31337/fix/backport_9217
Russ White [Tue, 3 Aug 2021 13:18:56 +0000 (09:18 -0400)]
Merge pull request #9245 from ton31337/fix/backport_9217

bgpd: [8.0] BGP dampening backports

3 years agotests: Check if BGP connection established if using no capabilities adv 9266/head
Donatas Abraitis [Sun, 1 Aug 2021 06:44:27 +0000 (09:44 +0300)]
tests: Check if BGP connection established if using no capabilities adv

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

3 years agobgpd: Use strict AS4 capability when processing parsing/generating pkts
Donatas Abraitis [Sun, 1 Aug 2021 06:29:31 +0000 (09:29 +0300)]
bgpd: Use strict AS4 capability when processing parsing/generating pkts

PeerA sets `dont-capability-negotiate` for PeerB. It does not send any
capabilities to PeerB. This leads to situation when PeerA received AS4 cap,
while it doesn't send AS4 to PeerB and tries parsing AS_PATH using 32bits.

[GTTPK-RX2GP][EC 33554436] Malformed AS path from 192.168.0.2, length is 4
[SM0KX-WXMGK] bgp_attr_malformed: attributes: , origin ?
[P7TRR-4J6XT][EC 33554487] 192.168.0.2: Attribute AS_PATH, parse error - treating as withdrawal
[WX70K-6XXVF][EC 33554454] 192.168.0.2 rcvd UPDATE with errors in attr(s)!! Withdrawing route.
[Z2KFR-ZGJC8] 192.168.0.2 rcvd UPDATE w/ attr: , origin ?
[P9VY3-5B6NX] 192.168.0.2 rcvd UPDATE wlen 0 attrlen 80 alen 73
[QMZ79-K2DH7][EC 33554454] 192.168.0.2 [Error] Update packet error (wrong prefix length 64 for afi 1)
[P9SYB-54XRZ][EC 33554454] 192.168.0.2 [Error] Error parsing NLRI
[V1CHF-JSGRR] %NOTIFICATION: sent to neighbor 192.168.0.2 3/10 (UPDATE Message Error/Invalid Network Field) 0 bytes
[HTHRX-GQYGJ][EC 33554454] bgp_process_packet: BGP UPDATE receipt failed for peer: 192.168.0.2

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

3 years agobgpd: Clear capabilities field when resetting a bgp neighbor 9263/head
Alexander Skorichenko [Wed, 14 Jul 2021 20:43:37 +0000 (16:43 -0400)]
bgpd: Clear capabilities field when resetting a bgp neighbor

Currently, the following sequence of events between peers could
result in erroneous capability reports on the peer
with enabled dont-capability-negotiate option:
- having some of the capabilities advertised to a bgp neighbor,
- then disabling capability negotiation to that neighbor,
- then resetting connection to it,
- and no capabilities are actually sent to the neighbor,
- but "show bgp neighbors" on the host still displays them
as advertised to the neighbor.

There are two possibilities for establishing a new connection
- the established connection was initiated by us with bgp_start(),
- the connection was initiated on the neighbor side and processed by
us via bgp_accept() in bgp_network.c.
The former case results in "show bgp neighbors" displaying only
"received" in capabilities, as the peer's cap is initiated to zero
in bgp_start().
In the latter case, if bgp_accept() happens before bgp_start()
is called, then new peer capabilities are being transferred
from its previous record before being zeroed in bgp_start().
This results in "show bgp neighbors" still displaying
"advertised and received" in capabilities.

Following the logic of a similar af_cap field clearing,
treated correctly in both cases, we
- reset peer's capability during bgp_stop()
- don't pass it over to a new peer structure in bgp_accept().
This fix prevents transferring of the previous capabilities record
to a new peer instance in arbitrary reconnect scenario.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
(cherry picked from commit 24f569e9ccea56695ff57be71a6e108f9a7867b2)

3 years agobgpd: Set extended msg size only if we advertised and received capability 9257/head
Donatas Abraitis [Mon, 2 Aug 2021 05:59:24 +0000 (08:59 +0300)]
bgpd: Set extended msg size only if we advertised and received capability

If we don't advertise any capabilities (dont-capability-negotiate), we
shouldn't set msg size to 65k only if received this capability from another
peer.

Before:

```
~/frr# vtysh -c 'show ip bgp update-group' | grep 'Max packet size'
    Max packet size: 65535
```

After:

```
~/frr# vtysh -c 'show ip bgp update-group' | grep 'Max packet size'
    Max packet size: 4096
```

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

3 years agoMerge pull request #9155 from FRRouting/mergify/bp/stable/8.0/pr-8956
Donatas Abraitis [Fri, 30 Jul 2021 15:08:03 +0000 (18:08 +0300)]
Merge pull request #9155 from FRRouting/mergify/bp/stable/8.0/pr-8956

bgpd: prevent routes loop through itself (backport #8956)

3 years agobgpd: cleanup bgp_damp_info_free 9245/head
Igor Ryzhov [Wed, 28 Jul 2021 22:39:38 +0000 (01:39 +0300)]
bgpd: cleanup bgp_damp_info_free

bgp_damp_config, afi and safi are never used.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: fix incorrect usage of slist in dampening
Igor Ryzhov [Wed, 28 Jul 2021 22:17:50 +0000 (01:17 +0300)]
bgpd: fix incorrect usage of slist in dampening

Current code is a complete misuse of SLIST structure. Instead of just
adding a SLIST_ENTRY to struct bgp_damp_info, it allocates a separate
structure to be a node in the list.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9221 from FRRouting/mergify/bp/stable/8.0/pr-9209
Donatas Abraitis [Fri, 30 Jul 2021 14:34:18 +0000 (17:34 +0300)]
Merge pull request #9221 from FRRouting/mergify/bp/stable/8.0/pr-9209

bgpd: Mark the node as the correct type for bgp ipv6 unicast (backport #9209)

3 years agobgpd: fix missing damp info free when cleaning bgp path
Igor Ryzhov [Wed, 28 Jul 2021 22:54:03 +0000 (01:54 +0300)]
bgpd: fix missing damp info free when cleaning bgp path

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9233 from ton31337/fix/backport_cd58568b1889df753aa258ee61b6d949b...
Russ White [Fri, 30 Jul 2021 14:16:32 +0000 (10:16 -0400)]
Merge pull request #9233 from ton31337/fix/backport_cd58568b1889df753aa258ee61b6d949b1ce6fb9

bgpd: [8.0] fix missing list add in dampening

3 years agoMerge pull request #9230 from FRRouting/mergify/bp/stable/8.0/pr-9222
Russ White [Fri, 30 Jul 2021 14:16:09 +0000 (10:16 -0400)]
Merge pull request #9230 from FRRouting/mergify/bp/stable/8.0/pr-9222

bgpd: Drop double-pointer for bgp_damp_info_free() (backport #9222)

3 years agobgpd: fix missing list add in dampening 9233/head
Igor Ryzhov [Thu, 29 Jul 2021 11:42:16 +0000 (14:42 +0300)]
bgpd: fix missing list add in dampening

One more crash in dampening code...

When bgp_damp_withdraw is called, if there's already a BDI structure,
bgp_damp_info_claim is called to re-assign the bdi->config in case it
was changed. The problem is that bgp_damp_info_claim actually removes
the BDI from the reuse list of the old config and never adds it to the
reuse list of the new config. We must do this to prevent the crash
because all the code assumes that BDI is always in some list.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9226 from idryzhov/8.0-backport-8860-8920
Russ White [Thu, 29 Jul 2021 19:03:58 +0000 (15:03 -0400)]
Merge pull request #9226 from idryzhov/8.0-backport-8860-8920

[8.0] backport 8860 + 8920

3 years agobgpd: Drop double-pointer for bgp_damp_info_free() 9230/head
Donatas Abraitis [Thu, 29 Jul 2021 08:11:15 +0000 (11:11 +0300)]
bgpd: Drop double-pointer for bgp_damp_info_free()

This causes a crash using `clear ip bgp dampening <prefix>`.

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

3 years agoMerge pull request #9223 from FRRouting/mergify/bp/stable/8.0/pr-9215
Donatas Abraitis [Thu, 29 Jul 2021 14:24:45 +0000 (17:24 +0300)]
Merge pull request #9223 from FRRouting/mergify/bp/stable/8.0/pr-9215

bgpd: fix double free in dampening code (backport #9215)

3 years agobgpd: Fix SA warning about freeing an aspath 9226/head
Mark Stapp [Thu, 24 Jun 2021 11:50:23 +0000 (07:50 -0400)]
bgpd: Fix SA warning about freeing an aspath

Fix coverity warning CID 1505589

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agotests: Check if as-path prepends work with route-maps and default-originate
Donatas Abraitis [Tue, 15 Jun 2021 12:49:24 +0000 (15:49 +0300)]
tests: Check if as-path prepends work with route-maps and default-originate

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Allow aspath prepending for default-originate with route-maps
Donatas Abraitis [Tue, 15 Jun 2021 11:55:17 +0000 (14:55 +0300)]
bgpd: Allow aspath prepending for default-originate with route-maps

The initial idea was to deny prepending and just use _self_.

This patch at least allows prepending aspath with route-maps, but drops
all non-self ASNs in the path.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: fix double free in dampening code 9223/head
Igor Ryzhov [Wed, 28 Jul 2021 21:14:31 +0000 (00:14 +0300)]
bgpd: fix double free in dampening code

bgp_damp_info_unclaim already calls bgp_reuselist_del. We must not call
it again here.

Fixes #9046.

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

3 years agobgpd: Mark the node as the correct type for bgp ipv6 unicast 9221/head
Donald Sharp [Wed, 28 Jul 2021 14:56:48 +0000 (10:56 -0400)]
bgpd: Mark the node as the correct type for bgp ipv6 unicast

The bgp ipv6 unicast node should be called `bgp ipv6 unicast`
to make it consistent with other nodes where we list the afi/safi

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

3 years agoMerge pull request #9208 from FRRouting/mergify/bp/stable/8.0/pr-9189
Donald Sharp [Wed, 28 Jul 2021 19:12:24 +0000 (15:12 -0400)]
Merge pull request #9208 from FRRouting/mergify/bp/stable/8.0/pr-9189

ospfd: don't exit when socket is not created (backport #9189)

3 years agoMerge pull request #9183 from FRRouting/mergify/bp/stable/8.0/pr-9166
Donald Sharp [Wed, 28 Jul 2021 14:37:32 +0000 (10:37 -0400)]
Merge pull request #9183 from FRRouting/mergify/bp/stable/8.0/pr-9166

vtysh: another take at "enable" in vtysh user mode (backport #9166)

3 years agoospfd: don't exit when socket is not created 9208/head
Igor Ryzhov [Tue, 27 Jul 2021 13:10:35 +0000 (16:10 +0300)]
ospfd: don't exit when socket is not created

Let's be less radical. There's no reason to stop the whole daemon when
there's a socket creation error in a single VRF. The user can always
restart this single VRF to retry to create a socket.

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

3 years agoMerge pull request #9184 from FRRouting/revert-9175-mergify/bp/stable/8.0/pr-8983
Igor Ryzhov [Tue, 27 Jul 2021 12:10:49 +0000 (15:10 +0300)]
Merge pull request #9184 from FRRouting/revert-9175-mergify/bp/stable/8.0/pr-8983

Revert "pimd: Minor fixes for BSM Show CLI and Hold Timer CLI (backport #8983)"

3 years agoMerge pull request #9182 from FRRouting/revert-9179-PR9001-for-8.0
Igor Ryzhov [Tue, 27 Jul 2021 12:10:39 +0000 (15:10 +0300)]
Merge pull request #9182 from FRRouting/revert-9179-PR9001-for-8.0

Revert "Backport of PR 9001 and PR 8174 for 8.0"

3 years agobgp_basic_functionality: fix pylint errors 9155/head
Philippe Guibert [Mon, 12 Jul 2021 07:03:22 +0000 (09:03 +0200)]
bgp_basic_functionality: fix pylint errors

fix pylint errors found.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 3881d05175b848d9b95a733635d50563c286e04b)

3 years agobgpd: prevent routes loop through itself
Philippe Guibert [Wed, 30 Jun 2021 08:52:29 +0000 (10:52 +0200)]
bgpd: prevent routes loop through itself

Some BGP updates received by BGP invite local router to
install a route through itself. The system will not do it, and
the route should be considered as not valid at the earliest.

This case is detected on the zebra, and this detection prevents
from trying to install this route to the local system. However,
the nexthop tracking mechanism is called, and acts as if the route
was valid, which is not the case.

By detecting in BGP that use case, we avoid installing the invalid
routes.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 654a5978f695087af062bfc9a382321fa2ccc4ae)

3 years agoRevert "pimd: Minor fixes for BSM Show CLI and Hold Timer CLI (backport #8983)" 9184/head
Donald Sharp [Mon, 26 Jul 2021 11:51:45 +0000 (07:51 -0400)]
Revert "pimd: Minor fixes for BSM Show CLI and Hold Timer CLI (backport #8983)"

3 years agovtysh: don't install "enable" command in user mode 9183/head
Igor Ryzhov [Fri, 23 Jul 2021 15:38:20 +0000 (18:38 +0300)]
vtysh: don't install "enable" command in user mode

Recent change in d1b287e only fixed the problem for 3-letter words.

We were still displaying error for longer words starting with "ena":
```
nfware> enac
% Command not allowed: enable
nfware> enad
% Command not allowed: enable
nfware> enaena
% Command not allowed: enable
```

If we don't allow "enable" command in user mode, why add it at all?

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

3 years agoRevert "Backport of PR 9001 and PR 8174 for 8.0" revert-9179-PR9001-for-8.0 9182/head
Donald Sharp [Mon, 26 Jul 2021 11:32:35 +0000 (07:32 -0400)]
Revert "Backport of PR 9001 and PR 8174 for 8.0"

3 years agoMerge pull request #9179 from opensourcerouting/PR9001-for-8.0
Donatas Abraitis [Mon, 26 Jul 2021 11:01:49 +0000 (14:01 +0300)]
Merge pull request #9179 from opensourcerouting/PR9001-for-8.0

Backport of PR 9001 and PR 8174 for 8.0

3 years agoMerge pull request #9177 from FRRouting/mergify/bp/stable/8.0/pr-8905
Martin Winter [Sun, 25 Jul 2021 17:58:27 +0000 (19:58 +0200)]
Merge pull request #9177 from FRRouting/mergify/bp/stable/8.0/pr-8905

Isis argv (backport #8905)

3 years agoMerge pull request #9175 from FRRouting/mergify/bp/stable/8.0/pr-8983
Martin Winter [Sun, 25 Jul 2021 17:57:45 +0000 (19:57 +0200)]
Merge pull request #9175 from FRRouting/mergify/bp/stable/8.0/pr-8983

pimd: Minor fixes for BSM Show CLI and Hold Timer CLI (backport #8983)

3 years agozebra: When passing lookup information back pass the fully resolved 9179/head
Donald Sharp [Wed, 7 Jul 2021 20:52:24 +0000 (16:52 -0400)]
zebra: When passing lookup information back pass the fully resolved

In the reachability code we auto pass back the fully resolved
nexthops.  Modify the ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB code
to do the exact same thing so that the zclient_lookup_nexthop
code does not need to recursively look for the data that
zebra already has.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: add config control to hide backup nh events in nht
Mark Stapp [Mon, 1 Mar 2021 15:48:05 +0000 (10:48 -0500)]
zebra: add config control to hide backup nh events in nht

Add a config that can control hiding of backup-nexthop activation
changes in nexthop-tracking.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: optionally hide backup-nexthop events in nht
Mark Stapp [Mon, 1 Mar 2021 15:49:32 +0000 (10:49 -0500)]
zebra: optionally hide backup-nexthop events in nht

Optionally hide route changes that only involve backup nexthop
activation/deactivation. The goal is to avoid route churn during
backup nexthop switchover events, before the resolving routes
re-converge. A UI config enables this 'hiding' behavior.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoisisd: using argv as a string name is categorically wrong 9177/head
Donald Sharp [Tue, 22 Jun 2021 16:44:24 +0000 (12:44 -0400)]
isisd: using argv as a string name is categorically wrong

We are passing around the system id using the variable name
of `argv`.  Let's name the variable correctly and pass it around
correctly named.

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

3 years agoisisd: already checked for NULL
Donald Sharp [Tue, 22 Jun 2021 16:36:16 +0000 (12:36 -0400)]
isisd: already checked for NULL

in lsp_for_arg we have already checked for NULL and returned
if argv is null.  We do not need to check for it again.

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

3 years agopimd: zlog_info changed to zlog_notice for neighbor up/down event 9175/head
github login name [Mon, 5 Jul 2021 11:42:42 +0000 (04:42 -0700)]
pimd: zlog_info changed to zlog_notice for neighbor up/down event

Co-authored-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
(cherry picked from commit 69b2df12bb54f5a776dc40bb4b360a152b2cc9c8)

3 years agopimd: make pim interface hold interval range 1-630
github login name [Mon, 5 Jul 2021 11:07:25 +0000 (04:07 -0700)]
pimd: make pim interface hold interval range 1-630

Making the interface holdtime range to 3.5 times the hello-time

As per 7761, Section 4.11:
The Holdtime in a Hello message should be set to
   (3.5 * Hello_Period), giving a default value of 105 seconds.

Therefore providing the user also to configure max upto 3.5 times
the hello timer interval.

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

3 years agopimd: Adding BSM status in the show commands
github login name [Mon, 5 Jul 2021 07:16:10 +0000 (00:16 -0700)]
pimd: Adding BSM status in the show commands

Adding BSM status in the CLI and json output for
"show ip pim interface"

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

3 years agoMerge pull request #9172 from FRRouting/mergify/bp/stable/8.0/pr-8864
Donatas Abraitis [Sun, 25 Jul 2021 08:24:54 +0000 (11:24 +0300)]
Merge pull request #9172 from FRRouting/mergify/bp/stable/8.0/pr-8864

lib: fix interface configuration after vrf change (backport #8864)

3 years agoMerge pull request #9174 from FRRouting/mergify/bp/stable/8.0/pr-8731
Martin Winter [Sat, 24 Jul 2021 22:22:00 +0000 (00:22 +0200)]
Merge pull request #9174 from FRRouting/mergify/bp/stable/8.0/pr-8731

zebra: Fix pseudowires with backup nexthops (backport #8731)

3 years agoMerge pull request #9173 from FRRouting/mergify/bp/stable/8.0/pr-8824
Martin Winter [Sat, 24 Jul 2021 22:20:28 +0000 (00:20 +0200)]
Merge pull request #9173 from FRRouting/mergify/bp/stable/8.0/pr-8824

isisd, ospfd: update interface_link_params callback to check for change (backport #8824)

3 years agoMerge pull request #9171 from FRRouting/mergify/bp/stable/8.0/pr-9039
Martin Winter [Sat, 24 Jul 2021 22:17:21 +0000 (00:17 +0200)]
Merge pull request #9171 from FRRouting/mergify/bp/stable/8.0/pr-9039

bgpd: Do not check for NULL values for vni_hash_cmp() (backport #9039)

3 years agoMerge pull request #9170 from FRRouting/mergify/bp/stable/8.0/pr-9036
Martin Winter [Sat, 24 Jul 2021 22:16:38 +0000 (00:16 +0200)]
Merge pull request #9170 from FRRouting/mergify/bp/stable/8.0/pr-9036

bgpd: hash compare functions never receive null values (backport #9036)