Rafael Zalamena [Tue, 25 Aug 2020 13:26:29 +0000 (10:26 -0300)]
lib: fix a crash in zebra style access list
When removing an IPv4 prefix configuration the wrong amount of bytes
will be read from `struct prefix_ipv4` from `DEFPY`, so lets use the
proper function for this.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Tue, 25 Aug 2020 12:29:00 +0000 (09:29 -0300)]
lib: remove ambiguous cisco command
When configuring a access list rule with type `any` it is now ambiguous
between cisco and zebra because both have the same syntax, so lets
remove the cisco command to avoid that.
YANG users will not notice this change.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Tue, 25 Aug 2020 12:09:05 +0000 (09:09 -0300)]
lib: fix filter extended address assignment
`nb_cli_enqueue_change` just points to the string values passed in
parameter, so we must use different strings for different function
calls (at least until `nb_cli_apply_changes`).
While here fix a variable name typo/copy paste error on destination host
case.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Tue, 25 Aug 2020 12:07:03 +0000 (09:07 -0300)]
yang: fix cisco extended access list mistake
The extended value must be a part of the cisco choice otherwise it will
be possible to create a destination only part which will cause a crash
when trying to access the assumed mandatory source.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Chirag Shah [Thu, 20 Aug 2020 19:09:53 +0000 (12:09 -0700)]
*: record transaction based on control flag
In case of config rollback is enabled,
record northbound transaction based on a control flag.
The actual frr daemons would set the flag to true via
nb_init from frr_init.
This will allow test daemon to bypass recording
transacation to db.
Renato Westphal [Wed, 19 Aug 2020 23:33:40 +0000 (20:33 -0300)]
lib: adapt plugin to use new Sysrepo version
Sysrepo recently underwent a complete rewrite, where some substantial
architectural changes were made (the most important one being the
extinction of the sysrepod daemon). While most of the existing API
was preserved, quite a few backward-incompatible changes [1] were
introduced (mostly simplifications). This commit adapts our sysrepo
northbound plugin to those API changes in order for it to be compatible
with the latest Sysrepo version.
Additional notes:
* The old Sysrepo version is EOL and not supported anymore.
* The new Sysrepo version requires libyang 1.x.
PR #6416 that solves opsf crash when segment routing is restarted, introduce a
regression in Extended Prefix flooding: when segment routing prefix is modified
or removed, new segment routing prefix is no more flooded. This patch correct
this regression.
Add new option to `segment-routing prefix` command to set the
Explcit Null flag in addition to the No-PHP flag. MPLS LFIB configuration
has been also updated to take into account the Explicit Null flag.
Olivier Dugeon [Thu, 18 Jun 2020 17:46:28 +0000 (19:46 +0200)]
ospfd: Add Segment Routing Local Block
RFC 8665 defines a Segment Routing Local Block for Adjacency SID.
This patch provides the possibility to modify the SRLB as well as
reserved the block range from the Label Manager.
- Introduce new CLI 'segment-routing local-block'
- Add local block to SRDB structure
- Parse / Serialize SRLB in Router Information LSA
- Update OSPF-SR topotest
- Update documentation
Olivier Dugeon [Tue, 16 Jun 2020 14:49:38 +0000 (16:49 +0200)]
ospfd: Add Label Manager for Segment Routing
Segment Routing Global Block is now using the Label Manager to reserved
label range. Label Manager connection uses the synchronous mode and dedicated
thread timer is used to establish the connection in safe manner without
blocking OSPFd is the Label Manager is not available.
Renato Westphal [Wed, 19 Aug 2020 22:48:21 +0000 (19:48 -0300)]
staticd: fix warning when creating routes without SR-TE colors
The SR-TE color YANG leaf is optional so it shouldn't be created
unconditionally (it doesn't have a default value).
Fixes warnings like this when routes are created without specifying
a SR-TE color:
STATIC: libyang: Invalid value "" in "srte-color" element.
(/frr-routing:routing/control-plane-protocols/control-plane-protocol[type='frr-s
taticd:staticd'][name='staticd'][vrf='default']/frr-staticd:staticd/route-list[p
refix='99.0.0.1/32'][afi-safi='frr-routing:ipv4-unicast']/path-list[distance='1'
]/frr-nexthops/nexthop[nh-type='ip4'][vrf='default'][gateway='192.168.1.2'][inte
rface='(null)']/srte-color)
Donald Sharp [Wed, 19 Aug 2020 14:11:06 +0000 (10:11 -0400)]
zebra: Add table id to debug output
There are a bunch of places where the table id is not being outputed
in debug messages for routing changes. Add in the table id we
are operating on. This is especially useful for the case where
pbr is working.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
GalaxyGorilla [Mon, 17 Aug 2020 13:04:41 +0000 (13:04 +0000)]
ospfd: bring back some P2P SPF interface code
In the case of P2P links it is possible to use IP unnumbered which
yields a strong dependency to the interface data for nexthop
resolution in the SPF calculations. While the SPF code strives to
be as independent of non-LSA data as possible there is no way
around here: one has to resolve the nexthop for such a special case
using the interface data.
For this purpose a new flag 'spf_root_node' is introduced to signal
that interface data can be used for P2P links. For now this flag is
always 'true' since the SPF currently always uses the calculating
node as the root node. This will change with the introduction of
TI-LFA where other nodes can be root nodes.
GalaxyGorilla [Fri, 7 Aug 2020 12:13:07 +0000 (12:13 +0000)]
ospfd: introduce a 'dry run' into SPF code
in OSPF interface data is used for the nexthop resolution
during the SPF algorithm, see RFC2328 16.1.1. However, for
certain technologies like TI-LFA it is desirable to be able
to calculate SPFs for arbitrary root nodes, not just the
calculating node. Since interface data is not available for
other nodes it is necessary to remove this dependency and
make its usage optional, depending on the intent of
changing the RIB with the generated tree (or not).
To signal that a SPF run is used without the intent to
change the RIB an additional flag `spf_dry_run` is
introduced to the ospf_area struct. This flag is currently
only used within the pure SPF code but will be extended
to the SPF postprocessing later on.
Donald Sharp [Mon, 17 Aug 2020 17:52:19 +0000 (13:52 -0400)]
bgpd: Actually respect RFC 6286 for router_id
The RFC states:
The BGP Identifier is a 4-octet, unsigned, non-zero integer that
should be unique within an AS. The value of the BGP Identifier
for a BGP speaker is determined on startup and is the same for
every local interface and every BGP peer.
We were going slightly beyond this and ensuring that the address
was a specific range of addresses which is no longer relevant.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Renato Westphal [Fri, 14 Aug 2020 22:49:41 +0000 (19:49 -0300)]
lib: don't ignore error messages generated during the commit apply phase
While a configuration transaction can't be rejected once it reaches
the APPLY phase, we should allow NB callbacks to generate error
or warning messages when a configuration change is being applied.
That should be useful, for example, to return warnings back to
the user informing that the applied configuration has some kind of
inconsistency or is missing something in order to be effectively
activated. The infrastructure for this was already present, but the
northbound layer was ignoring all errors/warnings generated during
the apply/abort phases instead of returning them to the user. This
commit changes that.
In the gRPC plugin, extend the Commit() RPC adding a new
"error_message" field to the response type. This is necessary to
allow errors/warnings to be returned even when the commit operation
succeeds (since grpc::Status::OK doesn't support error messages
like the other status codes).
isisd : Transformational changes to support different VRFs.
1. Created a structure "isis master".
2. All the changes are related to handle ISIS with different vrf.
3. A new variable added in structure "isis" to store the vrf name.
4. The display commands for isis is changed to support different VRFs.
Donald Sharp [Thu, 13 Aug 2020 00:59:47 +0000 (20:59 -0400)]
tools: Remove zebra commands that have never existed
The support bundle feature(tm) asks for some data
from zebra in the form of a command that has
never existed in FRR. Looks like some
cruft snuck in remove.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Rafael Zalamena [Wed, 12 Aug 2020 11:26:45 +0000 (08:26 -0300)]
topotests: fix default BFD peer shutdown state
The commit `bfdd: simplify and remove duplicated code` fixed a problem
that was causing the protocol configuration to override the user
configuration.
In this test case: the peer was configured to be disabled (default is
`shutdown`) and the test was expecting it to get activated (`no shutdown`)
when the protocol converged. I changed the peer default state to
`no shutdown`, however another way to get the same effect is to
configure the protocol to use a profile or don't configure a peer at all
(and use the defaults).
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Donald Sharp [Wed, 12 Aug 2020 13:49:20 +0000 (09:49 -0400)]
lib: Properly handle POLLERR from poll()
There are situations where POLLERR will be returned. But
since we were not handling it. Thread processing effectively
is turned into an infinite loop, which is bad.
Modify the code so that if we receive a POLLERR we turn it
into a read event to be handled as an error from the handler
function.
Chirag Shah [Fri, 7 Aug 2020 20:01:58 +0000 (13:01 -0700)]
zebra: Revert "zebra: probe local inactive neigh"
Reverting probing of neigh entry. There is a timing where
probe and remote macip add request comes at the same time resulting
in neigh to remain in local state event though it should be remote.
In mobility case, the host moves to remote VTEP, first MAC only type-2
route is received which triggers a PROBE of neighs (associated to MAC).
PROBE request can go via network port to remote VTEP.
PROBE request picks up local neigh with MAC entry's outgoing port is
remote VTEP tunnel port.
The PROBE reply and MAC-IP (containing IP) almost comes same time at
DUT.
DUT first processes remote macip and installs neigh as remote.
Followed by receives neigh as REACHABLE which marks neigh as LOCAL.
FRR does have BPF filter which does not allow its own netlink request
to receive. Otherwise frr's request to program neigh as remote can move
neigh from local to remote.
Though ordering can not be guranteed that REACHABLE (PROBE's repsonse)
can come at anytime and move it to LOCAL.
This fix would not suffice the needs of converging LOCAL inactive neighs
to remove from DB. As mobility draft sugges to PROBE local neigh when
MAC moves to remote but it is not working with current framework.
Warning logs -
Logic error: Dereference of null pointer in zebra_evpn_mh.c, function zebra_evpn_es_evi_show_vni, line 360
See https://ci1.netdef.org/browse/FRR-FRRPULLREQ-13544/artifact/shared/static_analysis/report-b1eb72.html#EndPath