Rafael Zalamena [Fri, 12 Jul 2019 20:24:17 +0000 (17:24 -0300)]
isisd: improvements based on feedback
* Remove sanity checks that are already done by northbound;
* Show error message on circuit absence;
* Use a better idiom for the configuration display code;
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Mon, 8 Jul 2019 18:56:56 +0000 (15:56 -0300)]
bfdd: keep source information for single hop
Add source address to northbound when creating sessions with this
information. It is not possible to change source address after the
session was created, but we should be able to set it to make IPv6 work.
Spotted by Philippe Guibert.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Rafael Zalamena [Mon, 8 Jul 2019 20:38:28 +0000 (17:38 -0300)]
yang: change single hop `leaf` order
Move `source-address` to after the list keys, otherwise the CLI would
get into an invalid state and be unable to set any other configuration
inside that node.
Spotted by Philippe Guibert.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
frr-reolad.py invocation sends info message to stderror channel
Redirected stderror from frr-reload.py to stdout
Fixed verify_convergence when more than one link is present
Ashish Pant [Tue, 25 Jun 2019 05:56:46 +0000 (11:26 +0530)]
tests: Fix logdir creation
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Creates logdir everytime in start_topology, removed stop_topoloy.
Using tgen.stop_topology in test case now.
Ashish Pant [Tue, 25 Jun 2019 04:25:24 +0000 (09:55 +0530)]
tests: Adding example cases for topojson
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Example JSON and test cases for 3 types being added:
1. Single link between routers
2. Multiple linke between routers.
3. BGP session over loopback interface
Ashish Pant [Tue, 25 Jun 2019 00:34:17 +0000 (06:04 +0530)]
tests: Adding timers and bgp 4 bytes ASN test
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Adding verify and config apis for bgp timer testcase
Adding verify and config apis for changing ASN to 4 bytes
Ashish Pant [Mon, 24 Jun 2019 11:54:07 +0000 (17:24 +0530)]
tests: Adding api for BGP configuration
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Adding mulitple methods to form BGP configuration and other
helper methods.
If "bgp" is given in JSON the configuration will be created
Ashish Pant [Mon, 24 Jun 2019 11:37:00 +0000 (17:07 +0530)]
tests: Adds basic config load and interface API
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Adds method to load configuration on the router. Save configuration
for resetting.
Adds method for configuring interfaces ip address on router.
Adds logdir and other pytest.ini option
Donald Sharp [Fri, 14 Jun 2019 10:05:18 +0000 (06:05 -0400)]
bgpd: extend bgp routemap prefix-list to flowspec entries
Some code to cleanup bgp routemap.c a bit.
Addint to this, if a bgp flowspec entry contains a destination IP address,
then the ip address is compared against the prefix-list referenced into
the route-map used.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: Donald Sharp <sharpd@cumulunetworks.com>
bgpd: discard traffic when at least traffic-rate 0 is observed
when multiple action rules are analysed in the BGP flowspec entry, if at
least the traffic-rate set to 0 is seen, then immediately create a rule
with drop rule. Previously this was not the case in case a forwarding
rule was seen.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
David Lamparter [Fri, 10 May 2019 13:31:04 +0000 (15:31 +0200)]
bgpd: add instance delete & config write hooks
Both of these hooks are necessary for proper operation of extensions
that need to latch on to a particular instance.
- without the delete hook, it's impossible to get rid of stale
references, leading to crashes with invalid instance pointers.
- the config-write hook is necessary because per-instance config needs
to be written inside the "router bgp" block to have the appropriate
context; adding a separate config node can't do that.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 24 Apr 2019 18:14:19 +0000 (20:14 +0200)]
bgpd: fix last_reset_cause setup
last_reset_cause_size is the length *used* in last_reset_cause[]. It's
straight up used wrong here; we're saving off a reset cause and need to
check against the *available* size in last_reset_cause[].
This could actually have led to (hopefully rare) crashes in the assert
there, since the assert condition might fail incorrectly.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Donald Sharp [Tue, 2 Jul 2019 23:06:22 +0000 (19:06 -0400)]
ospfd: Do not modify list when using _RO loop
The shutdown of ospf was causing crashes because the shutdown
was calling a ALL_LIST_ELEMENTS_RO macro and modifying the
underlying data structures. Switch to using ALL_LIST_ELEMENTS.
ospfd: Cleanup ospf->redist and ospf->external on shutdown
Effectively my original testing for this only had one external
route and as such we would not have a crash here. It only
showed up after multiple externals have been introduced.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Mark Stapp [Tue, 2 Jul 2019 18:05:18 +0000 (14:05 -0400)]
lib: add process pids to 'show modules'
Add the process pids to the output produced by 'show modules'.
At least in a development setting, where there may be multiple
instances of frr running, it can be handy to be able to id
the exact pids, for debugging e.g.
bgp update messages were not correctly calculating the size
for a labeled-unicast prefix, as they were not accounting
for the label. If the update message was large enough to
overflow the maximum packet size (4096 bytes) this could
cause bgpd to send a malformed update packet.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Chirag Shah [Fri, 28 Jun 2019 17:42:08 +0000 (10:42 -0700)]
zebra: evpn entries are not cleaned upon frr stop
As part of PR 4458, when a client (bgpd) goes down,
zebra cleans up any evpn state including remotely learned
neighs, macs and vteps are suppose to be cleaned up,
uninstall from kernel tables.
Neighs (arps), macs and vteps (HREP entries) were not
removed from kernel tables as the uninstall flag as not set.
Clean up l3vni associated remote neighs, macs and vteps.
Validated in evpn symmetric routing topology where
remotely learned l2/l3 vnis neigh, macs and remote
vtep (hrep) entries are installed in kernel table,
perform systemctl stop frr.service and validated
all remotely learned entries cleaned up from kernel
tables.
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
lib: use flag from new libyang version to simplify the code
When using the LYD_PATH_OPT_NOPARENTRET flag, lyd_new_path() returns
the path-referenced node instead of the first created node. This
flag wasn't available in libyang 0.16-r1 so we couldn't use it
before. Use it now to simplify the code where possible.
Biswajit Sadhu [Mon, 24 Jun 2019 07:50:33 +0000 (00:50 -0700)]
bgpd: 'show bgp ipv6 neighbors <X::Y> prefix-counts' prefix-count is
not getting displayed.
Neighbour prefix-count is not getting displayed with IPV6 neighbours
and displays the o/p “ % No such neighbor or address family ”.
However, I observed it is working fine for IPV4 neighbour.
build, lib: bump libyang requirement version to >= 0.16.105
After ~4 months of deprecation period [1], drop support for older
libyang versions that don't support embedded extensions.
In addition to support for embedded extensions, libyang 0.16-r3
contains several bug fixes and performance improvements compared
to libyang-0.16-r1. It was about time to update.
ripd: fix problems with the "ip rip authentication" command
libyang-0.16-r3 doesn't allow the creation of data nodes if their
corresponding "when" statement (if any) resolves to false. This
change broke the "ip rip authentication" command.
This commit adapts this command so that it's not affected by the
new libyang stricter validation checks.
libyang-0.16-r3 contains a commit[1] that changed the autodelete
behavior of subtrees when validating data. A few FRR commands were
affected by this change since they relied on the old autodelete
behavior.
To fix these commands, use the LYD_OPT_WHENAUTODEL flag when
validating data to restore the old autodelete behavior (which adds
a lot of convenience for us).
Stephen Worley [Mon, 24 Jun 2019 18:04:13 +0000 (14:04 -0400)]
lib: Private api for nexthop_group manipulation
Add a file that exposes functions which modify nexthop groups.
Nexthop groups are techincally immutable but there are a
few special cases where we need direct access to add/remove
nexthops after the group has been made. This file provides a
way to expose those functions in a way that makes it clear
this is a private/hidden api.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Stephen Worley [Mon, 24 Jun 2019 15:37:49 +0000 (11:37 -0400)]
lib: Add a nexthop_dup() that allocates and copies
Add a nexthop_dup() api that both allocates and copies
a new nexthop from an old one. Still retain the old exposed
function nexthop_copy() so we can copy without allocation.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Donald Sharp [Thu, 20 Sep 2018 17:59:35 +0000 (13:59 -0400)]
lib: Add a couple functions to nexthop_group.c
Add nexthop_group_copy and nexthop_group_add_sorted functions.
nexthop_group_copy -> Copy src nexthop_group into dst nexthop_group
nexthop_group_add_sorted -> Adds a new nexthop to the nexthop group
in a sorted manner.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 26 Jun 2019 00:14:25 +0000 (20:14 -0400)]
vtysh: Try to be perscriptive about pam failures
When using pam for authentication, the code just silently
fails and gives no indication to the end user what has gone
wrong. Try to increase messaging about what has gone wrong
by outputting some more data.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Tue, 25 Jun 2019 21:10:12 +0000 (17:10 -0400)]
zebra: import table entries are not showing up in the right table
When we are importing/removing the table entry from table X into the
default routing table we are not properly setting the table_id
of the route entry. This is causing the route to be pushed
into the wrong internal table and to not be found for deletion.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Tue, 25 Jun 2019 21:07:30 +0000 (17:07 -0400)]
zebra: Push VRF_DEFAULT outside of import table code
The import table code assumes that they will only work
in the default vrf. This is ok, but we should push the
vrf_id and zvrf to be passed in instead of just using
VRF_DEFAULT.
This will allow us to fix a couple of things:
1) A bug in import where we are not creating the
route entry with the appropriate table so the imported
entry is showing up in the wrong spot.
2) In the future allow `ip import-table X` to become
vrf aware very easily.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>