Commit Graph

27081 Commits

Author SHA1 Message Date
Donald Sharp
ad7ffeec2a 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>
2022-03-01 12:40:43 +02:00
Jafar Al-Gharaibeh
ca5ec871ea
Merge pull request #10681 from FRRouting/mergify/bp/dev/8.2/pr-10678
staticd: Fix `make check` failures (backport #10678)
2022-02-28 17:51:50 -06:00
Jafar Al-Gharaibeh
fa0e803b0f
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)
2022-02-28 17:51:19 -06:00
Jafar Al-Gharaibeh
8e0b82e797
Merge pull request #10680 from FRRouting/mergify/bp/dev/8.2/pr-10667
Bufsize (backport #10667)
2022-02-28 15:58:16 -06:00
Donald Sharp
456fc8cf22 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 45dafca86c)
2022-02-28 20:48:19 +00:00
Donald Sharp
6b131b55e0 staticd: Fix make check failures
Recent commit:
abc246e193

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 7c1e76aa8d)
2022-02-28 15:40:54 +00:00
Donald Sharp
58db01ae1e 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 4dca0c10df)
2022-02-28 14:57:03 +00:00
Donald Sharp
2d79f0780a 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 9fb83b5506)
2022-02-28 14:57:03 +00:00
Igor Ryzhov
efcfceb05c
Merge pull request #10671 from FRRouting/mergify/bp/dev/8.2/pr-10669
*: Add necessary new line for output of vty_out() (backport #10669)
2022-02-27 18:43:48 +03:00
anlan_cs
39023bc007 *: Add necessary new line for output of vty_out()
Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit 4d4c404bf6)
2022-02-27 12:44:34 +00:00
Jafar Al-Gharaibeh
d7bae757ff
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)
2022-02-24 20:55:30 -06:00
rgirada
346441bf31 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 c16241898a)
2022-02-24 19:48:04 +00:00
Donald Sharp
489cf56c34
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)
2022-02-24 06:49:11 -05:00
Donatas Abraitis
db3aca462b 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 38775a3c5f)
2022-02-24 06:56:39 +00:00
Jafar Al-Gharaibeh
892a96beee
Merge pull request #10645 from ton31337/feature/advmap_set_8.2
bgpd: [8.2] Conditional advertisement with route-map set backports
2022-02-23 16:53:05 -06:00
Donatas Abraitis
b4c879e22a
Merge pull request #10642 from FRRouting/mergify/bp/dev/8.2/pr-10621
Cov fun (backport #10621)
2022-02-23 21:40:19 +02:00
Donatas Abraitis
cb290e57c7 bgpd: Allow setting attributes over route-maps for conditional advertisements
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-02-23 21:38:37 +02:00
Donatas Abraitis
5cb526136a 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>
2022-02-23 21:38:23 +02:00
Donatas Abraitis
a08e5c529c 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>
2022-02-23 21:38:12 +02:00
Donald Sharp
bb74f3c298 pceplib: Fix uninited data in test vehicle
Coverity SA found this.  Fix

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit bd6beab0a6)
2022-02-23 17:34:58 +00:00
Donald Sharp
82021021f0 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 c960cb28f7)
2022-02-23 17:34:57 +00:00
Donald Sharp
b487f0aff0 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 46da676a62)
2022-02-23 17:34:57 +00:00
Donald Sharp
cecb76bd3c 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 4d7aae38ab)
2022-02-23 17:34:57 +00:00
Donatas Abraitis
fa2713e7b5
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)
2022-02-23 10:34:37 +02:00
Mobashshera Rasool
bddd51838c 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 fcfd479d99)
2022-02-22 17:46:47 +00:00
Jafar Al-Gharaibeh
19ddc13183
Merge pull request #10613 from FRRouting/mergify/bp/dev/8.2/pr-10604
staticd: reject route config with too many nexthops (backport #10604)
2022-02-17 23:31:34 -06:00
Mark Stapp
44309e7a00 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 1f7ab1a2cc)
2022-02-18 00:52:51 +00:00
Mark Stapp
df8cb5aaf7 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 abc246e193)
2022-02-18 00:52:51 +00:00
Mark Stapp
0a8d3ad5f8 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 423e32cb01)
2022-02-18 00:52:51 +00:00
Jafar Al-Gharaibeh
a8adcc6d9b
Merge pull request #10611 from FRRouting/mergify/bp/dev/8.2/pr-10591
ripd: Fix packet send for non primary addresses (backport #10591)
2022-02-17 18:28:41 -06:00
Jafar Al-Gharaibeh
3b058fd2d3
Merge pull request #10610 from FRRouting/mergify/bp/dev/8.2/pr-10562
lib: Save number of times a thread is starved (backport #10562)
2022-02-17 18:28:24 -06:00
Donald Sharp
7a765edf8a 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 114918bd0b)
2022-02-17 19:59:59 +00:00
Donatas Abraitis
fdedfeb760
Merge pull request #10607 from FRRouting/mergify/bp/dev/8.2/pr-10575
bgp: Add a 6 hour warning to missing policy (backport #10575)
2022-02-17 21:56:34 +02:00
Donatas Abraitis
8db26e5853
Merge pull request #10609 from FRRouting/mergify/bp/dev/8.2/pr-10590
Bgp error codes (backport #10590)
2022-02-17 21:56:06 +02:00
Donald Sharp
11e383e75e
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)
2022-02-17 13:59:06 -05:00
Donald Sharp
d72fdb828e 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 1dd08c2243)
2022-02-17 16:09:20 +00:00
Donald Sharp
bd971829f3 bgpd: Renumber bgp_create_error_code enum values
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit e4aa4745f2)
2022-02-17 16:08:55 +00:00
Donald Sharp
152487b3e5 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 4b7e23e9f2)
2022-02-17 16:08:55 +00:00
Donald Sharp
beaab6f79f bgpd: Remove unused BGP_ERR_MAX #define
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit b5d6f2d068)
2022-02-17 16:08:54 +00:00
Donald Sharp
b462a0a7f6 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 6dcea6fe05)
2022-02-17 16:08:54 +00:00
Donald Sharp
d37c84f28b 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 8b4a0b6631)
2022-02-17 16:08:53 +00:00
kiselev99@gmail.com
d3985d3604 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 eca3256db8)
2022-02-17 16:06:24 +00:00
Donald Sharp
aeb1da0ca2 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 b17826b715)
2022-02-17 16:01:25 +00:00
Mark Stapp
c432b3c775
Merge pull request #10597 from FRRouting/mergify/bp/dev/8.2/pr-10586
bgpd: uninitialized compiler warning (backport #10586)
2022-02-16 12:57:20 -05:00
Punith Kumar
281c28cd40 bgpd: Fix uninitialized compiler warning
Signed-off-by: Punith Kumar <punithkumar.spk@gmail.com>
(cherry picked from commit 73e770b7ad)
2022-02-16 15:59:36 +00:00
Donatas Abraitis
3b71608cb9
Merge pull request #10564 from FRRouting/mergify/bp/dev/8.2/pr-10552
tools: fix frr-reload context keywords (backport #10552)
2022-02-11 09:48:31 +02:00
Igor Ryzhov
32389bfbbe 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 57692f125e)
2022-02-10 21:55:49 +00:00
Donatas Abraitis
6cb7c5d9b1
Merge pull request #10553 from FRRouting/mergify/bp/dev/8.2/pr-10551
bgpd: fix a couple of memleaks (backport #10551)
2022-02-10 14:47:13 +02:00
Igor Ryzhov
955cc29fb6 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 606c3f9fb2)
2022-02-10 06:53:50 +00:00
Igor Ryzhov
2dc64494da 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 afb254d792)
2022-02-10 06:53:50 +00:00