]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
3 years agoFRR Release 8.2.2 frr-8.2.2.rc
Jafar Al-Gharaibeh [Sat, 12 Mar 2022 23:00:13 +0000 (17:00 -0600)]
FRR Release 8.2.2

- Fix zebra nexthop tracking with import check
- Fix bgp graceful restart double config

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agoMerge pull request #10784 from FRRouting/mergify/bp/stable/8.2/pr-10783
David Lamparter [Sat, 12 Mar 2022 22:22:11 +0000 (23:22 +0100)]
Merge pull request #10784 from FRRouting/mergify/bp/stable/8.2/pr-10783

3 years agozebra: prefixlen is not afi/safi dependant in encoding nexthops
Donald Sharp [Sat, 12 Mar 2022 16:05:23 +0000 (11:05 -0500)]
zebra: prefixlen is not afi/safi dependant in encoding nexthops

When encoding a response to the upper level protocol the
prefixlen is not something that needs to be part of the
switch statement for handling of a prefix.

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

3 years ago*: When matching against a nexthop send and process what it matched against
Donald Sharp [Sat, 12 Mar 2022 15:47:16 +0000 (10:47 -0500)]
*: When matching against a nexthop send and process what it matched against

Currently the nexthop tracking code is only sending to the requestor
what it was requested to match against.  When the nexthop tracking
code was simplified to not need an import check and a nexthop check
in b8210849b8ac1abe2d5d9a5ab2459abfde65efa5 for bgpd.  It was not
noticed that a longer prefix could match but it would be seen
as a match because FRR was not sending up both the resolved
route prefix and the route FRR was asked to match against.

This code change causes the nexthop tracking code to pass
back up the matched requested route (so that the calling
protocol can figure out which one it is being told about )
as well as the actual prefix that was matched to.

Fixes: #10766
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 06e4e90132ad23815c6f288dd7e6be334f5ab233)

3 years agozebra: Remove unused ZEBRA_NHT_EXACT_MATCH
Donald Sharp [Sat, 12 Mar 2022 13:27:22 +0000 (08:27 -0500)]
zebra: Remove unused ZEBRA_NHT_EXACT_MATCH

This usage was removed in an earlier bit of code
do some final cleanup

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

3 years agoMerge pull request #10777 from FRRouting/mergify/bp/stable/8.2/pr-10767
Donald Sharp [Fri, 11 Mar 2022 19:14:42 +0000 (14:14 -0500)]
Merge pull request #10777 from FRRouting/mergify/bp/stable/8.2/pr-10767

bgpd: Do not fail when going from GR mode to GR (backport #10767)

3 years agobgpd: Do not fail when going from GR mode to GR
Donald Sharp [Thu, 10 Mar 2022 14:33:57 +0000 (09:33 -0500)]
bgpd: Do not fail when going from GR mode to GR

If you enter:

router bgp 325
  bgp graceful-restart
  bgp graceful-restart
!

The second command entered will fail.  This is not
something that should be failing as that it's a no-op.

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

3 years agoFRR Release 8.2.1 docker/8.2.1 frr-8.2.1 frr-8.2.1.rc
Jafar Al-Gharaibeh [Wed, 9 Mar 2022 19:50:09 +0000 (13:50 -0600)]
FRR Release 8.2.1

- bgp RPKI fix
- grpc fixes

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agoMerge pull request #10752 from FRRouting/mergify/bp/stable/8.2/pr-10741
Donatas Abraitis [Tue, 8 Mar 2022 07:22:07 +0000 (09:22 +0200)]
Merge pull request #10752 from FRRouting/mergify/bp/stable/8.2/pr-10741

critical fixes for grpc (backport #10741)

3 years agolib: grpc: fix handling of "empty" yang type
Christian Hopps [Sun, 6 Mar 2022 16:58:26 +0000 (11:58 -0500)]
lib: grpc: fix handling of "empty" yang type

- rather than coerce `const char *` to std:string&, just pass the
C ptr, as that's what is used anyway.

fixes #10578

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit fe095adc24a91eef3265ac803bb805cd297b3522)

3 years agolib: grpc: fix shutdown code
Christian Hopps [Sat, 5 Mar 2022 16:04:43 +0000 (11:04 -0500)]
lib: grpc: fix shutdown code

fixes #9732

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 83f6fce7d2fece4617bd85e3da0894fc820dab8d)

3 years agolib: grpc: initialize uninitialized member variables
Christian Hopps [Sat, 26 Feb 2022 12:55:32 +0000 (07:55 -0500)]
lib: grpc: initialize uninitialized member variables

fixes #9732, fixes #10578

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit c85ecd64050faccd9796ff9e8b935c3b0868eb7b)

3 years agolib: grpc: do not remove candidate entry too soon
Christian Hopps [Sun, 6 Mar 2022 11:58:22 +0000 (06:58 -0500)]
lib: grpc: do not remove candidate entry too soon

Fix from Rafael Zalamena <rzalamena@opensourcerouting.org>

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 96d434f8530b9b096c661a7ac30fffe47f57c774)

3 years agolib: tweak northbound gRPC default timeout
Rafael Zalamena [Mon, 21 Feb 2022 11:28:11 +0000 (06:28 -0500)]
lib: tweak northbound gRPC default timeout

Don't let open sockets hang for too long. This will fix an issue where a
improperly coded client (e.g. socat) could exaust the amount of open
file descriptors.

Documentation:
https://grpc.github.io/grpc/cpp/md_doc_keepalive.html

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 673e4407700b90c5ecbbcec5e06fec07fc1149b1)

3 years agoMerge pull request #10736 from ton31337/fix/backport_rpki_to_8.2
Jafar Al-Gharaibeh [Sat, 5 Mar 2022 15:14:03 +0000 (09:14 -0600)]
Merge pull request #10736 from ton31337/fix/backport_rpki_to_8.2

bgpd: [8.2] RPKI fixes backport

3 years agobgpd: Fix while(read()) for RPKI sync callback
Donatas Abraitis [Fri, 4 Mar 2022 21:36:34 +0000 (23:36 +0200)]
bgpd: Fix while(read()) for RPKI sync callback

Bad formatting applied and it worked with small amount of prefixes (lurking).

With full BGP feed and full RPKI table, this causes infinity loop.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 years agobgpd: Pass struct pfx_record to sizeof
Donatas Abraitis [Wed, 2 Feb 2022 11:30:52 +0000 (13:30 +0200)]
bgpd: Pass struct pfx_record to sizeof

Passing argument "&rec" of type "struct pfx_record *" and argument
"1UL" to function "read" is suspicious because
"sizeof (struct pfx_record) /*40*/" is expected.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoFRR Release 8.2 docker/8.2.0 frr-8.2
Jafar Al-Gharaibeh [Wed, 2 Mar 2022 06:14:46 +0000 (00:14 -0600)]
FRR Release 8.2

  The FRRouting community would like to announce FRR Release 8.2.
  This release consists of just over 800 commits from 62 authors.
  Selected features and bug fixes are listed below.

babeld:
    Fix the checks for truncated packets

bfdd:
    Correct one spelling error of comment
    Fix detection timeout update
    Fix possibly wrong counter of control packets

bgpd:
    Add "json" option to a few more show commands
    Add 'show bgp <afi> <safi> json detail' header data
    Add a 6 hour warning to missing policy
    Add an ability to match ipv6 next-hop by prefix-list
    Add autocomplete for access-list under bmp node
    Add autocomplete for as-path filters
    Add autocomplete for set/match community/large/ext lists
    Add long-lived graceful restart capability
    Add peer-groups to neighbor autocomplete
    Adjust symbolic names for cease notifications according to rfc4486
    Deprecate dpa, advertiser and rcid_path path attributes
    Extended bgp administrative shutdown communication
    Fix crash when using "show bgp vrf all"
    Fix inconsistency of match ip/ipv6 next-hop commands
    Fix missing name of default vrf
    Handle TCP connection errors with connection callbacks for RPKI
    Implement llgr helper mode
    Implement rfc9072
    Support redirect import more than one route-target ipv6

docker:
    Update alpine build enable set own version

isisd:
    Add link state traffic engineering support
    Fix router capability tlv parsing issues
    Fix running-config for fast-reroute
    Make isis work with default vrf name different than 'default'

ospf6d:
    Add missing vrf parameter to "clear ipv6 ospf6 interface"
    Add prompt for commands with non-exist vrf
    Add support for nssa type-7 address ranges
    Add the ability of specifying router-id/area-id in no debug ospf6
    Do not originate type-4 lsa when nssa
    Do not send type-5 into stub area
    Fix ecmp inter-area route nexthop update
    Fix memory leak for `show ipv6 ospf6 zebra json`

ospfd:
    Fix wrong comparison of routemap name
    Fix crash on "ospf send-extra-data zebra"
    Fix incorrect detection of topology changes in helper mode
    Fix loss of mixed form in "range" command
    Fix no-form of "graceful-restart" command
    Fix summary-address deletion
    Fix wrong parsing of te subtlv

pbrd:
    Add vlan actions to vty
    Pbr route maps get addr family of nhgs
    Protect from a possible null dereference

pimd:
    Do not allow 224.0.0.0/24 range in igmp join
    Fix igmp user config
    Fix msdp mesh grp with wildcard member addr
    Fix stale forwarding entries left around after join goes away
    Fix FRR drops IGMP packets for TOS value other than 0XC0

redhat:
    Check if frr.conf already exists
    Logrotate file has typo for staticd

ripd:
    Fix packet send for non primary addresses

vtysh:
    Add missing rpki node when showing config
    Improve startup time by ca. ×6
    remove `address-family evpn`

watchfrr:
    Allow an integrated config to work within a namespace

zebra:
    Add optional nhg id output to `show ip ro`
    Add resolver flag for nexthop in json
    Add support for json output in srv6 locator detail command
    Don't lose next hop weights while exporting via fpm
    Fix buffer overflow
    Fix netns deletion
    Fix route-map application when when using vrfs

* Contributors
Abhishek Naik
Adriano Marto Reis
Ahmad Caracalli
anlan_cs
Anuradha Karuppiah
ARShreenidhi
Baptiste Jonglez
Chirag Shah
Christian Hopps
ckishimo
David Lamparter
David Schweizer
Donald Lee
Donald Sharp
Donatas Abraitis
Eli Baum
ewlumpkin
Fabrice Fontaine
Fredi Raspall
github login name
Hiroki Shirokura
Igor Ryzhov
Iqra Siddiqui
Jafar Al-Gharaibeh
Javier Garcia
Jonas Gorski
Juraj Vijtiuk
Kantesh Mundaragi
Karel Van Hecke
kiselev99
LEI BAO
Lou Berger
Louis Scalbert
Manoj Naragund
Mark Stapp
Marlin Cremers
Martin Buck
Martin Winter
Mobashshera Rasool
Olivier Dugeon
Philippe Guibert
Punith Kumar
qingkaishi
Quentin Young
Rafael Zalamena
Renato Westphal
rgirada
ron
Ruslan Babayev
Ryoga Saito
Sai Gomathi
Sarita Patra
Solyn
Stephen Worley
Tomi Salminen
Trey Aspelund
wangshengjun
Xiao Liang
Yamato Sugawara
Yuan Yuan
zyxwvu Shi

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agodebian, redhat: update changelog for new release
Jafar Al-Gharaibeh [Wed, 2 Mar 2022 06:09:40 +0000 (00:09 -0600)]
debian, redhat: update changelog for new release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agoMerge pull request #10703 from FRRouting/mergify/bp/dev/8.2/pr-10652
Jafar Al-Gharaibeh [Tue, 1 Mar 2022 21:47:31 +0000 (15:47 -0600)]
Merge pull request #10703 from FRRouting/mergify/bp/dev/8.2/pr-10652

pimd: FRR drops IGMP packets for TOS value other than 0XC0 (backport #10652)

3 years agoMerge pull request #10702 from FRRouting/mergify/bp/dev/8.2/pr-10697
Jafar Al-Gharaibeh [Tue, 1 Mar 2022 20:50:49 +0000 (14:50 -0600)]
Merge pull request #10702 from FRRouting/mergify/bp/dev/8.2/pr-10697

lib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going back… (backport #10697)

3 years agopimd: FRR drops IGMP packets for TOS value other than 0XC0
Mobashshera Rasool [Fri, 25 Feb 2022 06:10:52 +0000 (22:10 -0800)]
pimd: FRR drops IGMP packets for TOS value other than 0XC0

Currently the code is expecting the TOS value for received
packet to be 0xC0 and hence it is discarding packets having
TOS value other than 0xc0.

We need to make sure that we are sending the packet with
TOS 0xC0 and while receiving we can allow any TOS value.
Let's follow Postel's law.
Checked Cisco behavior as well. It also accepts all TOS values.

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

3 years agolib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going backwards
Donald Sharp [Tue, 1 Mar 2022 14:02:33 +0000 (09:02 -0500)]
lib: Fix FreeBSD clock_gettime(CLOCK_THREAD_CPUTIME_ID,..) going backwards

On FreeBSD I have noticed that subsuquent calls to clock_gettime(..)
can return an after time that is before first calls value.
This in turn is generating CPU_HOG's because the subtraction
is wrapping into very very large numbers:

2022/02/28 20:12:58 SHARP: [PTDQA-70FG5]     start: 35.741981000  now: 35.740581000
2022/02/28 20:12:58 SHARP: [XK9YH-ZD8FA][EC 100663313] CPU HOG: task zclient_read (800744240) ran for 0ms (cpu time 18446744073709550ms)

(Please note I added the first line of debug to figure this issue out).

I have been asked to open a FreeBSD bug report and have done so.
In the mean time I think that it is important that FRR does
not generate bogus CPU HOG's on FreeBSD ( especially since
this may or may not be easily fixed and FRR has no control
over what version of the operating system, operators are
going to be running with FRR.

So, add a bit of specialized code that checks to see if
the after time in FreeBSD is before the now time in
thread_consumed_time and do some quick manipulations
to not have this issue.

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

3 years agoMerge pull request #10695 from ton31337/fix/backport_10689
Jafar Al-Gharaibeh [Tue, 1 Mar 2022 17:57:46 +0000 (11:57 -0600)]
Merge pull request #10695 from ton31337/fix/backport_10689

zebra: [8.2] Bsd zebra graceful restart cleanup

3 years agoMerge pull request #10692 from FRRouting/mergify/bp/dev/8.2/pr-10691
Donald Sharp [Tue, 1 Mar 2022 15:54:48 +0000 (10:54 -0500)]
Merge pull request #10692 from FRRouting/mergify/bp/dev/8.2/pr-10691

bgpd: fix missing name of default vrf (backport #10691)

3 years agoMerge pull request #10698 from FRRouting/mergify/bp/dev/8.2/pr-10690
Donald Sharp [Tue, 1 Mar 2022 15:54:06 +0000 (10:54 -0500)]
Merge pull request #10698 from FRRouting/mergify/bp/dev/8.2/pr-10690

snapcraft: Add missing libelf-dev build package (backport #10690)

3 years agoMerge pull request #10696 from mjstapp/fix_doc_zebra_8_2
Donatas Abraitis [Tue, 1 Mar 2022 15:44:39 +0000 (17:44 +0200)]
Merge pull request #10696 from mjstapp/fix_doc_zebra_8_2

[8.2] doc: fix typo in zebra user doc

3 years agosnapcraft: Add missing libelf-dev build package
Martin Winter [Mon, 28 Feb 2022 23:41:29 +0000 (00:41 +0100)]
snapcraft: Add missing libelf-dev build package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
(cherry picked from commit 720f01c5c1edf8f952a72ee5bbf2e7b23826fe72)

3 years agodoc: fix typo in zebra user doc
Mark Stapp [Tue, 1 Mar 2022 13:43:30 +0000 (08:43 -0500)]
doc: fix typo in zebra user doc

Fix a typo in the zebra doc file that generates a warning.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
3 years agozebra: Prevent crash if ZEBRA_ROUTE_ALL is used for a route type
Donald Sharp [Sun, 27 Feb 2022 19:00:41 +0000 (14:00 -0500)]
zebra: Prevent crash if ZEBRA_ROUTE_ALL is used for a route type

FRR will crash when the re->type is a ZEBRA_ROUTE_ALL and it
is inserted into the meta-queue.  Let's just put some basic
code in place to prevent a crash from happening.  No routing
protocol should be using ZEBRA_ROUTE_ALL as a value but
bugs do happen.  Let's just accept the weird route type
gracefully and move on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Get zebra graceful restart working when restarting on *BSD
Donald Sharp [Sun, 27 Feb 2022 19:11:13 +0000 (14:11 -0500)]
zebra: Get zebra graceful restart working when restarting on *BSD

Upon restart zebra reads in the kernel state.  Under linux
there is a mechanism to read the route and convert the protocol
to the correct internal FRR protocol to allow the zebra graceful
restart efforts to work properly.

Under *BSD I do not see a mechanism to convey the original FRR
protocol into the kernel and thus back out of it.  Thus when
zebra crashes ( or restarts ) the routes read back in are kernel
routes and are effectively lost to the system and FRR cannot
remove them properly.  Why?  Because FRR see's kernel routes
as routes that it should not own and in general the admin
distance for those routes will be a better one than the
admin distance from a routing protocol.  This is even
worse because when the graceful restart timer pops and rib_sweep
is run, FRR becomes out of sync with the state of the kernel forwarding
on *BSD.

On restart, notice that the route is a self route that there
is no way to know it's originating protocol.  In this case
let's set the protocol to ZEBRA_ROUTE_STATIC and set the admin
distance to 255.

This way when an upper level protocol reinstalls it's route
the general zebra graceful restart code still works.  The
high admin distance allows the code to just work in a way
that is graceful( HA! )

The drawback here is that the route shows up as a static
route for the time the system is doing it's work.  FRR
could introduce *another* route type but this seems like
a bad idea and the STATIC route type is loosely analagous
to the type of route it has become.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: Update documentation to indicate *BSD struggles
Donald Sharp [Sun, 27 Feb 2022 19:18:09 +0000 (14:18 -0500)]
doc: Update documentation to indicate *BSD struggles

*BSD has some special struggles associated with the graceful
restart code in zebra.  Add a bit of documentation to outline
this problem and how it is solved.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: fix missing name of default vrf
anlan_cs [Sat, 5 Feb 2022 21:36:54 +0000 (16:36 -0500)]
bgpd: fix missing name of default vrf

Before:
(config-router-af)# advertise-all-vni
% Please unconfigure EVPN in VRF (null)

After:
(config-router-af)# advertise-all-vni
% Please unconfigure EVPN in VRF default

Just use `bgp->name_pretty` to make it pretty.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit 2b94e4b69ee2a883f9902920fd2b9d22614a2488)

3 years agoMerge pull request #10681 from FRRouting/mergify/bp/dev/8.2/pr-10678
Jafar Al-Gharaibeh [Mon, 28 Feb 2022 23:51:50 +0000 (17:51 -0600)]
Merge pull request #10681 from FRRouting/mergify/bp/dev/8.2/pr-10678

staticd: Fix `make check` failures (backport #10678)

3 years agoMerge pull request #10688 from FRRouting/mergify/bp/dev/8.2/pr-10683
Jafar Al-Gharaibeh [Mon, 28 Feb 2022 23:51:19 +0000 (17:51 -0600)]
Merge pull request #10688 from FRRouting/mergify/bp/dev/8.2/pr-10683

zebra: Use the routes vrf not the nexthop vrf for route-map application (backport #10683)

3 years agoMerge pull request #10680 from FRRouting/mergify/bp/dev/8.2/pr-10667
Jafar Al-Gharaibeh [Mon, 28 Feb 2022 21:58:16 +0000 (15:58 -0600)]
Merge pull request #10680 from FRRouting/mergify/bp/dev/8.2/pr-10667

Bufsize (backport #10667)

3 years agozebra: Use the routes vrf not the vrf of the nexthop for route-map application
Donald Sharp [Mon, 28 Feb 2022 18:08:01 +0000 (13:08 -0500)]
zebra: Use the routes vrf not the vrf of the nexthop for route-map application

When a end operator is doing cross vrf imports in bgp:

router bgp 3239 vrf FOO
  address-family ipv4 uni
    import vrf BAR
!

and zebra has this configuration:

vrf FOO
  ip protocol bgp route-map EVA
!

The current code in zebra_nhg.c was looking up the vrf of the
nexthop and attempting to apply the ip protocol route-map.

For most people the nexthop vrf and the re vrf are one and the
same so they never see a problem.

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

3 years agostaticd: Fix `make check` failures
Donald Sharp [Mon, 28 Feb 2022 13:18:55 +0000 (08:18 -0500)]
staticd: Fix `make check` failures

Recent commit:
abc246e19345cbd2bc74c7dc50dac0b9cf2addf8

Has broken `make check` with recently new compilers:

/usr/bin/ld: staticd/libstatic.a(static_nb_config.o): warning: relocation against `zebra_ecmp_count' in read-only section `.text'
  CCLD     tests/bgpd/test_peer_attr
  CCLD     tests/bgpd/test_packet
/usr/bin/ld: staticd/libstatic.a(static_zebra.o): in function `static_zebra_capabilities':
/home/sharpd/frr5/staticd/static_zebra.c:208: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: staticd/libstatic.a(static_zebra.o): in function `static_zebra_route_add':
/home/sharpd/frr5/staticd/static_zebra.c:418: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: staticd/libstatic.a(static_nb_config.o): in function `static_nexthop_create':
/home/sharpd/frr5/staticd/static_nb_config.c:174: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: /home/sharpd/frr5/staticd/static_nb_config.c:175: undefined reference to `zebra_ecmp_count'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:8679: tests/lib/test_grpc] Error 1
make: *** Waiting for unfinished jobs....

Essentially the newly introduced variable zebra_ecmp_count is not available in the
libstatic.a compiled and make check has code that compiles against it.

The fix is to just move the variable to the library.

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

3 years agodoc: Document a existing cli for zebra that was missing
Donald Sharp [Sat, 26 Feb 2022 20:45:47 +0000 (15:45 -0500)]
doc: Document a existing cli for zebra that was missing

The -s or --nl-bufsize option was missing, document it.

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

3 years agozebra: Allow *BSD to specify a receive buffer size
Donald Sharp [Sat, 26 Feb 2022 20:40:15 +0000 (15:40 -0500)]
zebra: Allow *BSD to specify a receive buffer size

End operator is reporting that they are receiving buffer overruns
when attempting to read from the kernel receive socket.  It is
possible to adjust this size to more modern levels especially
for when the system is under load.  Modify the code base
so that *BSD operators can use the zebra `-s XXX` option
to specify a read buffer.

Additionally setup the default receive buffer size on *BSD
to be 128k instead of the 8k so that FRR does not run into
this issue again.

Fixes: #10666
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 9fb83b55066e5cafa344d6a049e363fb631683f6)

3 years agoMerge pull request #10671 from FRRouting/mergify/bp/dev/8.2/pr-10669
Igor Ryzhov [Sun, 27 Feb 2022 15:43:48 +0000 (18:43 +0300)]
Merge pull request #10671 from FRRouting/mergify/bp/dev/8.2/pr-10669

*: Add necessary new line for output of vty_out() (backport #10669)

3 years ago*: Add necessary new line for output of vty_out()
anlan_cs [Sun, 27 Feb 2022 01:38:29 +0000 (09:38 +0800)]
*: Add necessary new line for output of vty_out()

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit 4d4c404bf6f82ec7df67baff072e4f237c47180e)

3 years agoMerge pull request #10651 from FRRouting/mergify/bp/dev/8.2/pr-10650
Jafar Al-Gharaibeh [Fri, 25 Feb 2022 02:55:30 +0000 (20:55 -0600)]
Merge pull request #10651 from FRRouting/mergify/bp/dev/8.2/pr-10650

ospfd: NULL passed instead of ei pointer in external lsa origination (backport #10650)

3 years agoospfd: NULL passed instead of ei pointer in external lsa origination
rgirada [Thu, 24 Feb 2022 17:33:08 +0000 (09:33 -0800)]
ospfd: NULL passed instead of ei pointer in external lsa origination

Description:
NULL pointer wrongly passed instead of 'ei' pointer to
ospf_external_lsa_originate() API in opaque capability enable/disable
which always make it to fail in origination.
Corrected it by passing actual ei pointer.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
(cherry picked from commit c16241898ae397ea6129111eea259850a6c9a04b)

3 years agoMerge pull request #10647 from FRRouting/mergify/bp/dev/8.2/pr-10431
Donald Sharp [Thu, 24 Feb 2022 11:49:11 +0000 (06:49 -0500)]
Merge pull request #10647 from FRRouting/mergify/bp/dev/8.2/pr-10431

bgpd: Handle TCP connection errors with connection callbacks for RPKI (backport #10431)

3 years agobgpd: Handle TCP connection errors with connection callbacks for RPKI
Donatas Abraitis [Thu, 27 Jan 2022 09:14:11 +0000 (11:14 +0200)]
bgpd: Handle TCP connection errors with connection callbacks for RPKI

Before this patch, if the first server crashed or was terminated, RPKI
connection keeps _active_ forever.

With this patch, if we catch connection problem (FATAL), we reset RPKI, to
switch to another available RTR-Server by using configured preference.

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

3 years agoMerge pull request #10645 from ton31337/feature/advmap_set_8.2
Jafar Al-Gharaibeh [Wed, 23 Feb 2022 22:53:05 +0000 (16:53 -0600)]
Merge pull request #10645 from ton31337/feature/advmap_set_8.2

bgpd: [8.2] Conditional advertisement with route-map set backports

3 years agoMerge pull request #10642 from FRRouting/mergify/bp/dev/8.2/pr-10621
Donatas Abraitis [Wed, 23 Feb 2022 19:40:19 +0000 (21:40 +0200)]
Merge pull request #10642 from FRRouting/mergify/bp/dev/8.2/pr-10621

Cov fun (backport #10621)

3 years agobgpd: Allow setting attributes over route-maps for conditional advertisements
Donatas Abraitis [Tue, 15 Feb 2022 16:08:32 +0000 (18:08 +0200)]
bgpd: Allow setting attributes over route-maps for conditional advertisements

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Add bgp_check_selected() helper for abstraction
Donatas Abraitis [Thu, 27 Jan 2022 08:12:59 +0000 (10:12 +0200)]
bgpd: Add bgp_check_selected() helper for abstraction

Just check if the path is selected to be advertised: best path or addpath
capable.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Convert bgp_addpath_encode_[tr]x() to bool from int
Donatas Abraitis [Thu, 27 Jan 2022 07:51:59 +0000 (09:51 +0200)]
bgpd: Convert bgp_addpath_encode_[tr]x() to bool from int

Rename addpath_encode[d] to addpath_capable to be consistent.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agopceplib: Fix uninited data in test vehicle
Donald Sharp [Tue, 22 Feb 2022 13:21:32 +0000 (08:21 -0500)]
pceplib: Fix uninited data in test vehicle

Coverity SA found this.  Fix

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

3 years agoeigrpd: Up convert to uint64_t before doing math
Donald Sharp [Fri, 18 Feb 2022 15:55:16 +0000 (10:55 -0500)]
eigrpd: Up convert to uint64_t before doing math

Intentionally up convert uint8_t and uint32_t values
to a uint64_t before doing math to make Coverity happy.

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

3 years agobfdd: Fix overflow possibility with time statements
Donald Sharp [Fri, 18 Feb 2022 15:45:46 +0000 (10:45 -0500)]
bfdd: Fix overflow possibility with time statements

If time ( a uint64_t ) is large enough doing division
and subtraction can still lead to situations where
the resulting number is greater than a uint32_t.
Just use uint32_t as an intermediate storage spot.
This is unlikely to every occur in a time frame
I could possibly care about but makes Coverity happy.

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

3 years agolib: Fix possible usage of uninited data
Donald Sharp [Thu, 17 Feb 2022 19:07:57 +0000 (14:07 -0500)]
lib: Fix possible usage of uninited data

assert when if_lookup_address is passed with
a family that is not AF_INET or AF_INET6 as
that we are dead in the water and this is a
dev escape

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

3 years agoMerge pull request #10631 from FRRouting/mergify/bp/dev/8.2/pr-10615
Donatas Abraitis [Wed, 23 Feb 2022 08:34:37 +0000 (10:34 +0200)]
Merge pull request #10631 from FRRouting/mergify/bp/dev/8.2/pr-10615

pimd: Do not allow 224.0.0.0/24 range in igmp join (backport #10615)

3 years agopimd: Do not allow 224.0.0.0/24 range in igmp join
Mobashshera Rasool [Fri, 18 Feb 2022 06:03:07 +0000 (22:03 -0800)]
pimd: Do not allow 224.0.0.0/24 range in igmp join

224.0.0.0/24 cannot be used by igmp since this is reserved
for routing protocols and other low-level topology discovery or
maintenance protocols.

Fixes: #10614
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
(cherry picked from commit fcfd479d99295f82ef5979fc74ca38c9787cac2d)

3 years agoMerge pull request #10613 from FRRouting/mergify/bp/dev/8.2/pr-10604
Jafar Al-Gharaibeh [Fri, 18 Feb 2022 05:31:34 +0000 (23:31 -0600)]
Merge pull request #10613 from FRRouting/mergify/bp/dev/8.2/pr-10604

staticd: reject route config with too many nexthops (backport #10604)

3 years agostaticd: reject route config with too many nexthops
Mark Stapp [Thu, 17 Feb 2022 14:49:41 +0000 (09:49 -0500)]
staticd: reject route config with too many nexthops

Restrict the number of nexthops for a route to the compiled-in
limit. Be careful with the zapi route struct's array of nexthops
too.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
(cherry picked from commit 1f7ab1a2cc2a7079c9dd2cb791fc6ba3b9c5a6aa)

3 years agostaticd: capture zebra's advertised ECMP limit
Mark Stapp [Thu, 17 Feb 2022 14:53:25 +0000 (09:53 -0500)]
staticd: capture zebra's advertised ECMP limit

Capture the ECMP limit advertised by zebra (via zapi).

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
(cherry picked from commit abc246e19345cbd2bc74c7dc50dac0b9cf2addf8)

3 years agostaticd: fix spelling in an error message
Mark Stapp [Thu, 17 Feb 2022 14:48:07 +0000 (09:48 -0500)]
staticd: fix spelling in an error message

whitespace change to fix a typo.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
(cherry picked from commit 423e32cb01bf3cf8c34674b15f1af107ca28a3eb)

3 years agoMerge pull request #10611 from FRRouting/mergify/bp/dev/8.2/pr-10591
Jafar Al-Gharaibeh [Fri, 18 Feb 2022 00:28:41 +0000 (18:28 -0600)]
Merge pull request #10611 from FRRouting/mergify/bp/dev/8.2/pr-10591

ripd: Fix packet send for non primary addresses (backport #10591)

3 years agoMerge pull request #10610 from FRRouting/mergify/bp/dev/8.2/pr-10562
Jafar Al-Gharaibeh [Fri, 18 Feb 2022 00:28:24 +0000 (18:28 -0600)]
Merge pull request #10610 from FRRouting/mergify/bp/dev/8.2/pr-10562

lib: Save number of times a thread is starved (backport #10562)

3 years agoripd: Fix packet send for non primary addresses
Donald Sharp [Wed, 16 Feb 2022 00:47:23 +0000 (19:47 -0500)]
ripd: Fix packet send for non primary addresses

When rip is configured to work on secondary addresses
on an interface, rip was not properly sending out
the packets on secondary addresses because the source of the
packet was never properly being setup and rip would
send the packet out multiple times for the primary address
not once for each address on the interface that is setup to work.

tcpdump + rip debugs output with fix:

2022/02/15 19:59:50 RIP: [ZG173-BHW0K] turn on virbr0
2022/02/15 19:59:51 RIP: [PYB7S-80D89] multicast join at virbr0
2022/02/15 19:59:51 RIP: [GZR24-FCQGG] multicast request on virbr0
2022/02/15 19:59:51 RIP: [JTNCV-XD8S1] rip_send_packet 192.168.122.1 > 224.0.0.9 (virbr0)
2022/02/15 19:59:51 RIP: [VEJY5-67P5X] SEND to  224.0.0.9520
2022/02/15 19:59:51 RIP: [JTNCV-XD8S1] rip_send_packet 73.3.3.8 > 224.0.0.9 (virbr0)
2022/02/15 19:59:51 RIP: [VEJY5-67P5X] SEND to  224.0.0.9520
19:59:51.831128 IP 192.168.122.1.route > rip2-routers.mcast.net.route: RIPv2, Request, length: 24
19:59:51.831161 IP c-73-3-3-8.hsd1.mo.comcast.net.route > rip2-routers.mcast.net.route: RIPv2, Request, length: 24

Fixes: #10588
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 114918bd0ba2a54f144bcd672973f3a3b88a4251)

3 years agoMerge pull request #10607 from FRRouting/mergify/bp/dev/8.2/pr-10575
Donatas Abraitis [Thu, 17 Feb 2022 19:56:34 +0000 (21:56 +0200)]
Merge pull request #10607 from FRRouting/mergify/bp/dev/8.2/pr-10575

bgp: Add a 6 hour warning to missing policy (backport #10575)

3 years agoMerge pull request #10609 from FRRouting/mergify/bp/dev/8.2/pr-10590
Donatas Abraitis [Thu, 17 Feb 2022 19:56:06 +0000 (21:56 +0200)]
Merge pull request #10609 from FRRouting/mergify/bp/dev/8.2/pr-10590

Bgp error codes (backport #10590)

3 years agoMerge pull request #10608 from FRRouting/mergify/bp/dev/8.2/pr-10557
Donald Sharp [Thu, 17 Feb 2022 18:59:06 +0000 (13:59 -0500)]
Merge pull request #10608 from FRRouting/mergify/bp/dev/8.2/pr-10557

Zebra FPM: don't lose next hop weights while exporting via FPM (backport #10557)

3 years agolib: Save number of times a thread is starved
Donald Sharp [Thu, 10 Feb 2022 19:10:26 +0000 (14:10 -0500)]
lib: Save number of times a thread is starved

Add a counter to the number of times a thread is starved from
a timer event and add the output to `show thread cpu`

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

3 years agobgpd: Renumber bgp_create_error_code enum values
Donald Sharp [Tue, 15 Feb 2022 21:36:30 +0000 (16:36 -0500)]
bgpd: Renumber bgp_create_error_code enum values

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

3 years agobgpd: Convert bgp error codes for cli input to an enum
Donald Sharp [Tue, 15 Feb 2022 20:53:30 +0000 (15:53 -0500)]
bgpd: Convert bgp error codes for cli input to an enum

Conversion of bgp error codes returned for cli input into
an enum and then properly handling all the error cases
in bgp_vty_return.

Because not all error codes returned were properly handled
in this function there existed configuration examples that
were accepted on the cli without an error message but not
saved.

Fixes: #10589
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 4b7e23e9f2822def568cc9dd1a942d9d36cbb3a5)

3 years agobgpd: Remove unused BGP_ERR_MAX #define
Donald Sharp [Tue, 15 Feb 2022 21:12:02 +0000 (16:12 -0500)]
bgpd: Remove unused BGP_ERR_MAX #define

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

3 years agobgpd: Move some error codes to bgp_vty_return handling
Donald Sharp [Tue, 15 Feb 2022 21:04:50 +0000 (16:04 -0500)]
bgpd: Move some error codes to bgp_vty_return handling

BGP_ERR_PEER_GROUP_MEMBER and BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT
both are not handled by bgp_vty_return, but both can be handled by
this function as that there is nothing special going on here.

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

3 years agobgpd: Remove impossible invalid state
Donald Sharp [Tue, 15 Feb 2022 20:54:53 +0000 (15:54 -0500)]
bgpd: Remove impossible invalid state

confederations are checking to see that the bgp pointer
is non-null.  But it's impossible to have a null pointer
in the cli and in all paths we have already deref'ed the bgp
pointer.  Let's remove that error code as that it is impossible
to happen.

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

3 years agozebra: FPM next hop weights
kiselev99@gmail.com [Thu, 10 Feb 2022 15:47:20 +0000 (18:47 +0300)]
zebra: FPM next hop weights

Don't lose next hop weights while exporting via FPM

Signed-off-by: Alex Kiselev <alex@bisonrouter.com>
(cherry picked from commit eca3256db8eaea0315d01f48b1037e918be629be)

3 years agobgp: Add a 15 minute warning to missing policy
Donald Sharp [Mon, 14 Feb 2022 12:57:45 +0000 (07:57 -0500)]
bgp: Add a 15 minute warning to missing policy

Add a 15 minute warning to the logging system when
bgp policy is not setup properly.  Operators keep asking
about the missing policy( on upgrade typically ).  Let's
try to give them a bit more of a hint when something is
going wrong as that they are clearly missing the other
various places FRR tells them about it.

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

3 years agoMerge pull request #10597 from FRRouting/mergify/bp/dev/8.2/pr-10586
Mark Stapp [Wed, 16 Feb 2022 17:57:20 +0000 (12:57 -0500)]
Merge pull request #10597 from FRRouting/mergify/bp/dev/8.2/pr-10586

bgpd: uninitialized compiler warning (backport #10586)

3 years agobgpd: Fix uninitialized compiler warning
Punith Kumar [Tue, 15 Feb 2022 22:07:19 +0000 (22:07 +0000)]
bgpd: Fix uninitialized compiler warning

Signed-off-by: Punith Kumar <punithkumar.spk@gmail.com>
(cherry picked from commit 73e770b7ade52ffc189eee91c2f60ba60e5865c1)

3 years agoMerge pull request #10564 from FRRouting/mergify/bp/dev/8.2/pr-10552 frr-8.2-rc
Donatas Abraitis [Fri, 11 Feb 2022 07:48:31 +0000 (09:48 +0200)]
Merge pull request #10564 from FRRouting/mergify/bp/dev/8.2/pr-10552

tools: fix frr-reload context keywords (backport #10552)

3 years agotools: fix frr-reload context keywords
Igor Ryzhov [Wed, 9 Feb 2022 23:51:49 +0000 (02:51 +0300)]
tools: fix frr-reload context keywords

There are singline-line commands inside `router bgp` that start with
`vnc ` or `bmp `. Those commands are currently treated as node-entering
commands. We need to specify such commands more precisely.

Fixes #10548.

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

3 years agoMerge pull request #10553 from FRRouting/mergify/bp/dev/8.2/pr-10551
Donatas Abraitis [Thu, 10 Feb 2022 12:47:13 +0000 (14:47 +0200)]
Merge pull request #10553 from FRRouting/mergify/bp/dev/8.2/pr-10551

bgpd: fix a couple of memleaks (backport #10551)

3 years agobgpd: fix aspath memleak on error in vnc_direct_bgp_add_nve
Igor Ryzhov [Wed, 9 Feb 2022 22:23:41 +0000 (01:23 +0300)]
bgpd: fix aspath memleak on error in vnc_direct_bgp_add_nve

bgp_attr_default_set creates a new empty aspath. If family error happens,
this aspath is not freed. Move attr initialization after we checked the
family.

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

3 years agobgpd: fix aspath memory leak in aggr_suppress_map_test
Igor Ryzhov [Wed, 9 Feb 2022 22:20:03 +0000 (01:20 +0300)]
bgpd: fix aspath memory leak in aggr_suppress_map_test

aspth_empty a couple of lines earlier creates an aspath and it must be
freed.

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

3 years agobgpd: fix missing bgp_attr_flush on errors in bgp_update
Igor Ryzhov [Wed, 9 Feb 2022 22:15:57 +0000 (01:15 +0300)]
bgpd: fix missing bgp_attr_flush on errors in bgp_update

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

3 years agoMerge pull request #10543 from FRRouting/mergify/bp/dev/8.2/pr-10511
Donald Sharp [Wed, 9 Feb 2022 15:19:25 +0000 (10:19 -0500)]
Merge pull request #10543 from FRRouting/mergify/bp/dev/8.2/pr-10511

ospfd: fix loss of mixed form in "range" command (backport #10511)

3 years agoMerge pull request #10534 from FRRouting/mergify/bp/dev/8.2/pr-10531
Donatas Abraitis [Wed, 9 Feb 2022 15:01:03 +0000 (17:01 +0200)]
Merge pull request #10534 from FRRouting/mergify/bp/dev/8.2/pr-10531

bgpd: avoid memcmp comparison of struct nexthop (backport #10531)

3 years agoMerge pull request #10541 from FRRouting/mergify/bp/dev/8.2/pr-10161
Donatas Abraitis [Wed, 9 Feb 2022 13:15:31 +0000 (15:15 +0200)]
Merge pull request #10541 from FRRouting/mergify/bp/dev/8.2/pr-10161

zebra: Fix improper usage of hash_iterate that caused crashes (backport #10161)

3 years agoMerge pull request #10542 from FRRouting/mergify/bp/dev/8.2/pr-10517
Donald Sharp [Wed, 9 Feb 2022 13:13:25 +0000 (08:13 -0500)]
Merge pull request #10542 from FRRouting/mergify/bp/dev/8.2/pr-10517

isisd: fix router capability TLV parsing issues (backport #10517)

3 years agoMerge pull request #10544 from FRRouting/mergify/bp/dev/8.2/pr-10530
Donald Sharp [Wed, 9 Feb 2022 13:12:49 +0000 (08:12 -0500)]
Merge pull request #10544 from FRRouting/mergify/bp/dev/8.2/pr-10530

*: use ipaddr_cmp instead of memcmp (backport #10530)

3 years ago*: use ipaddr_cmp instead of memcmp
Igor Ryzhov [Tue, 8 Feb 2022 17:31:34 +0000 (20:31 +0300)]
*: use ipaddr_cmp instead of memcmp

Using memcmp is wrong because struct ipaddr may contain unitialized
padding bytes that should not be compared.

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

3 years agoospfd: fix loss of mixed form in "range" command
anlan_cs [Mon, 7 Feb 2022 13:25:28 +0000 (21:25 +0800)]
ospfd: fix loss of mixed form in "range" command

Currently "range" command can only accept `cost` or `substitute`
individually, and `show running` will mix them.

So need make it accept mixed form with both of them, otherwise
configuration file in mixed form will fail to start.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit ec88a72a375bc3a228cf2752b03e5aa22d8ef206)

3 years agoisisd: fix router capability TLV parsing issues
Juraj Vijtiuk [Wed, 13 Oct 2021 16:32:53 +0000 (18:32 +0200)]
isisd: fix router capability TLV parsing issues

isis_tlvs.c would fail at multiple places if incorrect TLVs were
received causing stream assertion violations.
This patch fixes the issues by adding missing length checks, missing
consumed length updates and handling malformed Segment Routing subTLVs.

Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>
Small adjustments by Igor Ryzhov:
- fix incorrect replacement of srgb by srlb on lines 3052 and 3054
- add length check for ISIS_SUBTLV_ALGORITHM
- fix conflict in fuzzing data during rebase

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

3 years agolib: Update hash.h documentation to warn of a possible crash
Donald Sharp [Wed, 1 Dec 2021 22:03:38 +0000 (17:03 -0500)]
lib: Update hash.h documentation to warn of a possible crash

Multiple deletions from the hash_walk or hash_iteration calls
during a single invocation of the passed in function can and
will cause the program to crash.  Warn against doing such a
thing.

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

3 years agozebra: Ensure zebra_nhg_sweep_table accounts for double deletes
Donald Sharp [Wed, 1 Dec 2021 21:28:42 +0000 (16:28 -0500)]
zebra: Ensure zebra_nhg_sweep_table accounts for double deletes

I'm seeing this crash in various forms:
Program terminated with signal SIGSEGV, Segmentation fault.
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f418efbc7c0 (LWP 3580253))]
(gdb) bt
(gdb) f 4
267 (*func)(hb, arg);
(gdb) p hb
$1 = (struct hash_bucket *) 0x558cdaafb250
(gdb) p *hb
$2 = {len = 0, next = 0x0, key = 0, data = 0x0}
(gdb)

I've also seen a crash where data is 0x03.

My suspicion is that hash_iterate is calling zebra_nhg_sweep_entry which
does delete the particular entry we are looking at as well as possibly other
entries when the ref count for those entries gets set to 0 as well.

Then we have this loop in hash_iterate.c:

   for (i = 0; i < hash->size; i++)
            for (hb = hash->index[i]; hb; hb = hbnext) {
                    /* get pointer to next hash bucket here, in case (*func)
                     * decides to delete hb by calling hash_release
                     */
                    hbnext = hb->next;
                    (*func)(hb, arg);
            }
Suppose in the previous loop hbnext is set to hb->next and we call
zebra_nhg_sweep_entry. This deletes the previous entry and also
happens to cause the hbnext entry to be deleted as well, because of nhg
refcounts. At this point in time the memory pointed to by hbnext is
not owned by the pthread anymore and we can end up on a state where
it's overwritten by another pthread in zebra with data for other incoming events.

What to do?  Let's change the sweep function to a hash_walk and have
it stop iterating and to start over if there is a possible double
delete operation.

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

3 years agoMerge pull request #10538 from FRRouting/mergify/bp/dev/8.2/pr-10445
Jafar Al-Gharaibeh [Wed, 9 Feb 2022 03:22:36 +0000 (21:22 -0600)]
Merge pull request #10538 from FRRouting/mergify/bp/dev/8.2/pr-10445

tools: Stop disabled daemons when doing reload (backport #10445)

3 years agotools: Stop disabled daemons when doing reload
Donatas Abraitis [Sun, 30 Jan 2022 16:04:00 +0000 (18:04 +0200)]
tools: Stop disabled daemons when doing reload

After:
```
root@exit1-debian-11:~# grep ripngd= /etc/frr/daemons
ripngd=no
root@exit1-debian-11:~# pgrep -f ripngd -c
0
root@exit1-debian-11:~# sed -i 's/ripngd=no/ripngd=yes/' /etc/frr/daemons
root@exit1-debian-11:~# /usr/lib/frr/frrinit.sh reload
Stopped watchfrr.
Started watchfrr.
root@exit1-debian-11:~# pgrep -f ripngd -c
2
root@exit1-debian-11:~# grep ripngd= /etc/frr/daemons
ripngd=yes
root@exit1-debian-11:~# sed -i 's/ripngd=yes/ripngd=no/' /etc/frr/daemons
root@exit1-debian-11:~# /usr/lib/frr/frrinit.sh reload
Stopped watchfrr.
Started watchfrr.
Stopped ripngd.
root@exit1-debian-11:~# pgrep -f ripngd -c
0
```

Before:
```
root@exit1-debian-11:~# grep ripngd= /etc/frr/daemons
ripngd=no
root@exit1-debian-11:~# pgrep -f ripngd -c
0
root@exit1-debian-11:~# sed -i 's/ripngd=no/ripngd=yes/' /etc/frr/daemons
root@exit1-debian-11:~# /usr/lib/frr/frrinit.sh reload
Stopped watchfrr.
Started watchfrr.
root@exit1-debian-11:~# pgrep -f ripngd -c
2
root@exit1-debian-11:~# grep ripngd= /etc/frr/daemons
ripngd=yes
root@exit1-debian-11:~# sed -i 's/ripngd=yes/ripngd=no/' /etc/frr/daemons
root@exit1-debian-11:~# /usr/lib/frr/frrinit.sh reload
Stopped watchfrr.
Started watchfrr.
Stopped ripngd.
root@exit1-debian-11:~# pgrep -f ripngd -c
1 <<<<<< ripngd is running, while watchfrr skips it
```

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

3 years agobgpd: avoid memcmp comparison of struct nexthop
Igor Ryzhov [Tue, 8 Feb 2022 17:34:28 +0000 (20:34 +0300)]
bgpd: avoid memcmp comparison of struct nexthop

Using memcmp is wrong because struct nexthop may contain unitialized
padding bytes that should not be compared.

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

3 years agoMerge pull request #10528 from FRRouting/mergify/bp/dev/8.2/pr-10504
Donald Sharp [Tue, 8 Feb 2022 18:26:31 +0000 (13:26 -0500)]
Merge pull request #10528 from FRRouting/mergify/bp/dev/8.2/pr-10504

babeld: fix the checks for truncated packets (backport #10504)

3 years agobabeld: fix #10502 #10503 by repairing the checks on length
qingkaishi [Fri, 4 Feb 2022 21:41:11 +0000 (16:41 -0500)]
babeld: fix #10502 #10503 by repairing the checks on length

This patch repairs the checking conditions on length in four functions:
babel_packet_examin, parse_hello_subtlv, parse_ihu_subtlv, and parse_update_subtlv

Signed-off-by: qingkaishi <qingkaishi@gmail.com>
(cherry picked from commit c3793352a8d76d2eee1edc38a9a16c1c8a6573f4)

3 years agoMerge pull request #10526 from FRRouting/mergify/bp/dev/8.2/pr-10524
Donatas Abraitis [Tue, 8 Feb 2022 06:57:08 +0000 (08:57 +0200)]
Merge pull request #10526 from FRRouting/mergify/bp/dev/8.2/pr-10524

pimd: Modify `show ip pim assert` to only show interesting bits (backport #10524)

3 years agoMerge pull request #10521 from FRRouting/mergify/bp/dev/8.2/pr-9926
Jafar Al-Gharaibeh [Tue, 8 Feb 2022 06:10:06 +0000 (00:10 -0600)]
Merge pull request #10521 from FRRouting/mergify/bp/dev/8.2/pr-9926

zebra: Fix v6 route replace failure turned into success (backport #9926)