Rafael Zalamena [Thu, 30 Apr 2020 21:21:12 +0000 (18:21 -0300)]
lib: bump filter CLI XPath buffers size
Bump the size of the buffers so the new compilers don't complain about
possible truncation:
```
lib/filter_cli.c: In function ‘ipv6_prefix_list_magic.isra.0’:
lib/filter_cli.c:1336:5: error: ‘%lld’ directive output may be truncated writing between 1 and 20 bytes into a region of size between 16 and 527 [-Werror=format-truncation=]
1336 | "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
| ^~~~~~~~~~~~~~~~~~~~~~
lib/filter_cli.c:1336:25: note: format string is defined here
1336 | "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
lib/filter_cli.c:1336:5: note: directive argument in the range [-9223372036854775803, 9223372036854775807]
1336 | "%s/entry[sequence='%" PRId64 "']", xpath, sseq);
| ^~~~~~~~~~~~~~~~~~~~~~
```
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Thu, 30 Apr 2020 20:23:51 +0000 (17:23 -0300)]
lib: fix prefix list description command
Changes:
- Use `description` on CLI but `remark` on YANG like access-list (also
because `description` is a reserved word).
- Rename YANG model field and northbound code.
- Fix wrong sequence type get.
- Fix wrong action XPath in action callback.
- Fix wrong concat in (ipv6|mac) access-list.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Wed, 29 Apr 2020 18:28:38 +0000 (15:28 -0300)]
lib: fix rebase conflicts
Changes:
- Remove unused variable.
- Make prototypes static like the declaration.
- Fix new compilers complaint about uninitialized values.
- Fix new compilers complaint about small buffer for `snprintf` concatenation.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Richard Wu [Wed, 3 Jun 2020 01:44:16 +0000 (09:44 +0800)]
zebra: Fix zebra crashed in building FPM netlink message when bgp sends aggregation routes to zebra.
Issue:
When BGP sends aggregation routes to zebra, the next hop is black hole.
Then Zebra will try to build the netlink FPM message, but there is no
next hop as it is a black hole route. Then the netlink_route_info_fill
function returns 0. In the result, zebra will crashed in
"assert(data_len)" of zfpm_build_route_updates.
This issue also happen when I create a static black hole route via
staticd.
Fix:
As the netlink message of the blackhole route is legal, it should return
success.
Donald Sharp [Tue, 2 Jun 2020 16:23:09 +0000 (12:23 -0400)]
bgpd: Fix crash in `match ip next-hop address` command
When issuing the command `match ip next-hop address`
bgp would crash. This is because the no form of the
command was making the address optional and we would
try to read data we should not be.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Mark Stapp [Tue, 21 Apr 2020 12:41:35 +0000 (08:41 -0400)]
zebra: handle OPAQUE registrations and forward messages
Add initial support to maintain client daemon registrations for
OPAQUE messages. Use the registered zapi client info to forward
copies of OPAQUE messages sent to zebra.
Mark Stapp [Wed, 8 Apr 2020 20:39:49 +0000 (16:39 -0400)]
zebra: call zapi message handler with a batch
The zapi code processes a batch of incoming messages, using a
fifo. Hand the entire batch into the main zebra handling code,
and let it loop through the individual messages.
Divert the special OPAQUE messages from the normal processing
flow, and offer them to the new zebra_opaque module instead.
Mark Stapp [Tue, 7 Apr 2020 13:50:53 +0000 (09:50 -0400)]
zebra: add lock and busy counter for zclients
Add a mutex used to manage the list of zclients. Add a busy
counter to the zapi client session, so that we can use a
client session from another pthread.
Mark Stapp [Sun, 19 Apr 2020 17:23:09 +0000 (13:23 -0400)]
zebra: add zebra opaque module
Add the zebra_opaque module, designed to offload some opaque zapi
message processing to a new, dedicated pthread. Add to the build;
also re-sort the lists of zebra files in subdir.am.
Start, stop, and clean-up the opaque module, integrate with zebra
start and shutdown.
Mark Stapp [Mon, 6 Apr 2020 20:10:13 +0000 (16:10 -0400)]
lib: add OPAQUE zapi message
Add a zapi message type designed to carry opaque data. Add
'send' api, and prototype for client handler function. Also
add registration/unreg messages, so that clients can 'subscribe'
to receive these messages as they're passing through zebra.
Mark Stapp [Sun, 5 Apr 2020 15:48:05 +0000 (11:48 -0400)]
lib: add stream_fifo_init, more const
Add utilities that init and deinit a stream_fifo - this lets us
use an on-stack fifo in some places, avoiding malloc'ing. Also
add const to some apis (no functional changes there).
Karen Schoener [Thu, 28 May 2020 20:36:35 +0000 (16:36 -0400)]
ldpd: Relay data plane pseudowire status in LDP notification
Provide a way for the data plane to indicate pseudowire
status (such as: not forwarding, AC failure).
On a data plane pseudowire install failure, data plane
sets the pseudowire status.
Zebra relays the pseudowire status to LDP.
LDP includes the pseudowire status in the LDP notification
to the LDP peer.
Quentin Young [Fri, 22 May 2020 20:12:38 +0000 (16:12 -0400)]
bgpd: avoid spamming bgp_accept() on bad vrf sock
bgp_accept() gets called over and over again when a VRF device is
deleted out from under a bgp listener socket that is bound to it.
Prevent this by noting the error and cancelling ourselves, allowing the
vrf status code to clean up the mess when it receives word about the
change from Zebra.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Quentin Young [Sun, 31 May 2020 08:10:33 +0000 (04:10 -0400)]
alpine: update packages
Alpine builds have been failing for some time as a consequence of only
installing python 2 development packages when we have build scripts that
require python 3.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Donald Sharp [Sat, 30 May 2020 19:44:54 +0000 (15:44 -0400)]
bgpd: Improve connection rejection messages
Try to give a bit more useful data about where we
think the connection is trying to come in from.
Hopefully this will let us debug connection issues
a bit faster in cases where there are config issues.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Appu Joseph [Fri, 29 May 2020 14:23:36 +0000 (10:23 -0400)]
bgpd: Fix "malformed communities" for accept-own-nexthop
"set community accept-own-nexthop" returns "malformed communities"
error. This is because the token matching hits an earlier "accept-own"
and leaves "-nexthop" as a separate token to be processed.
Reorder the switch cases so that both are processed correctly.
we were not correctly checking the MPLS-TE status of the area when
adding an IP address to a circuit, and this was preventing the local
address TLV to be populated after an interfaced flap.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Bart Vrancken [Tue, 26 May 2020 07:35:46 +0000 (09:35 +0200)]
doc: Update snmp.rst
Updated documentation for routers with a large route table, which breaks
SNMP/AgentX and in some conditions even crashes FRR. The documentation
proposal amends the SNMP configuration to exclude certain OID's that
are not needed in normal cases.
Format-fixed-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Bart Vrancken <bart@abuse.io>