Jakub Urbańczyk [Sun, 24 May 2020 17:03:25 +0000 (19:03 +0200)]
zebra: convert ip rule installation to use dplane thread
* Implement new dataplane operations
* Convert existing code to use dataplane context object
* Modify function preparing netlink message to use dataplane
context object
Jakub Urbańczyk [Sun, 24 May 2020 16:44:36 +0000 (18:44 +0200)]
zebra: prepare dplane to deal with pbr rules
This commit is the first step to convert IP rule installation to
use dplane thread.
* Add dataplane's internal representation of a pbr rule
* Add dplane stats related to rules
* Introduce a new type of dplane operation
Quentin Young [Wed, 10 Jun 2020 04:20:04 +0000 (00:20 -0400)]
docker: don't fail on chown /etc/frr
If we can chown /etc/frr then fine, but there's circumstances where we
won't be able to - for instance, if running FRR in Kubernetes where
/etc/frr/* is actually a virtual filesystem.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
there are some paths, e.g. when an established neighbor
sends us hellos with a different IS level, where we go
from adj_state UP to INIT. In such cases we might not
update our SPFs or the circuit state, as the state change
function was only testing for the UP and DOWN cases.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
When a peer is bound to a peer-group, the GR flags set on the
peer are over-written.
Update the GR flags for the peer after it has been bound to a
peer-group.
Rafael Zalamena [Mon, 4 May 2020 20:32:06 +0000 (17:32 -0300)]
lib: implement additional CLI prefix list check
Changes:
- Move the `TODO` to the appropriated place and hint how to resolve
it.
- Apply mask to prefix when storing it in the data structures. We
can't just add a validation for it otherwise it will break old
CLIs.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Sat, 2 May 2020 01:14:00 +0000 (22:14 -0300)]
lib: fix route map crash on prefix list removal
Changes:
- Refactor list entry deletion to use a function that properly notifies
route map on deletion (fixes a heap-use-after-free).
- Prefix list entry wild card sets `le` to maximum IP mask value and
`any` is a boolean.
- Fix prefix list trie removal order (in `prefix_list_entry_update_start`).
- Let only the `any` callback change the value of field `any`.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Fri, 1 May 2020 13:34:03 +0000 (10:34 -0300)]
lib: fix prefix list installation
Based on the function `prefix_list_entry_add` and
`prefix_list_entry_delete` it was created two functions to replicate
its functionality without the assumption we are always alocating a new
prefix list entry.
Since the prefix list entry is stored in the YANG private data
structures, we want to avoid the allocation/free of memory that is
hold by the schema.
Every time a prefix list entry values change we must call
`prefix_list_entry_update_start` to uninstall the entry from prefix
list internal structures and then call
`prefix_list_entry_update_finish` to put them back.
The variable `installed` in the prefix list entry tracks the
installation status of the internal structure. It is possible that a
user unconfigures or forgets to add a `prefix` value and so we can't
install the entry until then.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Fri, 1 May 2020 13:06:14 +0000 (10:06 -0300)]
lib: add 'no ... remark LINE' commands
Implement the commands `no ... remark LINE` for cisco and zebra style
access lists to match `ipX prefix-list description LINE` command set.
It useful when you just want to go through the command history and
prepend a `no` to a `remark` or `description` command. Example:
```
access-list foo remark just another acl
!
! ...
!
! Suddenly we decide we no longer think that remark is useful,
! lets press up key to find that line in history and append `no`:
no access-list foo remark just another acl
```
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
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>
Donald Sharp [Tue, 2 Jun 2020 20:10:48 +0000 (16:10 -0400)]
bgpd: Actually find the sequence number for `bgp extcommunity-list...`
The code in the bgp extcommunity-list function was using
argv_find to get the correct idx. The problem was that
we had already done argv_finds before and idx was non-zero
thus having us always set the seq pointer to what was last
looked up. This causes us to pass in a value to the
underlying function and it would just wisely ignore it
causing a seq number of 0.
We would then write this seq number of 0 and then immediately
reject it on read in again. BOO!
Actually handle argv_find the way it was meant to be.
Ticket:CM-29926 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Olivier Dugeon [Tue, 2 Jun 2020 17:24:46 +0000 (19:24 +0200)]
ospfd: Move Segment Routing Zebra functions
For coherency, move and rename functions that send MPLS labels configurations
from ospf_sr.c to ospf_zebra.c:
- ospf_zebra_update_prefix_sid()
- ospf_zebra_delete_prefix_sid()
- ospf_zebra_send_adjacency_sid()
Olivier Dugeon [Tue, 12 May 2020 14:42:38 +0000 (16:42 +0200)]
ospfd: Update Prefix & Adjacency SIDs Management
SIDs are not uninstall in LFIB when ospf adjacenyi or loopback goes down as
self LSA flusing is not handle by ospf_ext_link_lsa_update(). The patch
introduces new functions ospf_sr_ext_itf_add() and ospf_sr_ext_itf_delete() in
ospf_sr.c to directly manage LFIB for SIDs when change is detected in
ospf_ext_link_ism_change() and ospf_ext_link_nsm_change().
Update OSPF Segment Routing topotest in conformity to ECMP
- Add one more interface between r1 and r2 for ECMP
- Anonymize Adjacency SID
- Update expected json output
- Improve parsing of Router Information, especially when a router
stops advertising Segment Routing capabilities
- Finish conversion to '%pFX' and '%pI4'
Olivier Dugeon [Fri, 20 Mar 2020 10:34:52 +0000 (11:34 +0100)]
ospfd: Add ECMP support to OSPF Segment Routing
* Change sr_prefix structure in ospf_sr.h to add support to ECMP
* Add new Segment Routing information to ospf_paths in ospf_route.h
* Backport MPLS label configuration from IS-IS Segment Routing implementation
* Re-write log message in ospf_sr.c and ospf_ext.c
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 [Wed, 3 Jun 2020 02:14:24 +0000 (22:14 -0400)]
tests: Allow a useful amount of time for bgp to converge
The bgp_as_wide_bgp_identifier test can time out after
30 seconds waiting for convergence. This is of course
a problem in our test setup where we know that convergence
can fail on first startup due to load issues in the
topology. Additionally we also know that our default time
for bgp sessions is 120 seconds to retry. Give things
a bit longer than 120 seconds to actually fail
instead of 30 seconds
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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.