Donald Sharp [Wed, 17 Jul 2019 00:41:01 +0000 (20:41 -0400)]
pbrd: Do not install nexthop group until we have nexthops
The creation of a nexthop group results in a callback with
just the nexthop group name. At this point in time we
do not have any nexthop information so there is nothing to
install.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Quentin Young [Mon, 15 Jul 2019 17:16:30 +0000 (17:16 +0000)]
tests: remove strlen assert in inet_ntop tests
Some platform libc's like to render some v6 addresses as v4 mapped where
others render the same addresses as v6 with leading zeroes. Binary
equivalence checks pass but strlen checks sometimes fail here. Remove
assert causing the failure.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Donald Sharp [Sat, 13 Jul 2019 19:37:02 +0000 (15:37 -0400)]
vtysh: Make nexthop-group submode line unique
Now that multiple daemons understand nexthop-groups, we need
to ensure that vtysh doesn't double print out the individual
nexthops that are part of a nexthop-group.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Effectively we had encountered situations on system startup
where the interface speed for a device was not properly setup
when zebra learns about the interface ( Imagine a bond being
brought up and the controlling software creating the bond
is not fast given system load, the bond's speed changes
upwards for each interface added ).
The initial workup on this was to allow a 15 second window
and then just reread the interface speed. We've since noticed
that under heavy system load on startup this is not always sufficient.
So modify the code to wait the 15 seconds and then check the interfaces
speed. If the interfaces speed is still MAX_UINT32T or it has changed
let's wait a bit longer and try again.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
Donald Sharp [Thu, 11 Jul 2019 18:40:31 +0000 (14:40 -0400)]
tests: Topotests are not giving sufficient time to propagate data
A bunch of our current tests setup data and redistribute
it across some bgp connections and then test for it
being there. A delay of 2 seconds that was initially
there to ensure that the data has propagated does not
actually work all the time when you have a loaded
virtualized environment.
Make the sleep 10 seconds. I agree this is not the ideal
solution but I would rather get the damn tests up and running
again.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
LDP opens two sockets to zebra, one through ldpd (always using
instance 0) and another through lde (using whatever instance
was set through the -n command line parameter). If no instance
was set, both connections would use the same protocol and instance,
making it impossible to distinguish them through zserv_find_client.
This meant that a response to a lm connect would erroneously go to
the wrong process. Fix this by having a default instance value of 1,
in case the user does not specify a different one.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
in order to both streamline the code and allow users to
define their own specialized versions of the LM api handlers,
define hooks for the 4 main primitives offered by the label
manager (i.e. connect, disconnect, get_chunk and release_chunk),
and have the existing code be run in response to a hook_call.
Additionally, have the responses to the requesting daemon be
callable from an external API.
Note that the proxy version of the label manager was a source of
issues and hardly used in practice. With the new hooks, users with
more complex requirements can simply plug in their own code to
handle label distribution remotely, so there is no longer a reason
to maintain this code.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This is not part of the make check tests and it has been broken
for a while, apparently. The way the label manager is coded makes
it very hard to code unit tests, and testing the relay of requests
to an external label manager is probably better done through
a topotest, so remove this.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
when requesting a specific label chunk (e.g. for the SRGB),
it might happen that we cannot get what we want. In this
event, we must be prepared to receive a response with no
label chunk. Without this fix, if the remote label manager
was not able to alloate the chunk we requested, we would
hang indefinitely trying to read data from the stream which
was not there.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
For SRGB, we need to support chunk requests starting at a
specific point in the label space, rather than just asking
for any sufficiently large chunk. To this purpose, we extend
the label manager api to request a chunk with a base value;
if the base is set to 0, the label manager will behave as it
currently does, i.e. fetching the first free chunk big enough
to satisfy the request.
update all the existing calls to get chunks from the label
manager so that they use MPLS_LABEL_BASE_ANY as the base
for the requested chunk
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Matthew Smith [Tue, 9 Jul 2019 17:59:44 +0000 (12:59 -0500)]
bgpd: honor max prefix timer on inbound sessions
When using the maximum-prefix restart option with a BGP peer,
if the peer exceeds the limit of prefixes, bgpd causes the
connection to be closed and sets a timer. It will not attempt
to connect to that peer until the timer expires. But if the
peer attempts to connect to it before the timer expires, it
accepts the connection and starts exchanging routes again.
When accepting a connection from a peer, reject the connection
if the max prefix restart timer is set.
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
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>
pimd, zebra: request for replay of SG entries on startup
zvni setup in zebra is controlled via bgpd i.e. advertise_all_vni
from bgpd triggers this setup. As a part of zvni creation we may need
to setup BUM mcast SG entries which are propagated to pimd for MDT setup.
Now pimd may not be present at the time of zvni creation or may restart
post zvni creation so we need a mechanism to replay (on pimd startup) and
to cleanup (on pimd stop). This is addressed via zebra_vxlan_sg_replay and
zebra_evpn_pim_cfg_clean_up.
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>