Daniel Walton [Mon, 12 Jun 2017 20:09:09 +0000 (20:09 +0000)]
bgpd: "no neighbor x.x.x.x send-community" not displayed correctly
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
We would only diplay one "no neighbor 2.2.2.2 send-community XYZ" but
there might be multiple that need to be displayed.
Donald Sharp [Thu, 8 Jun 2017 12:48:10 +0000 (08:48 -0400)]
tools, zebra: Fix netlink notification of who owns the routes
For NHRP, EIGRP and LDP( This is for consistency as opposed to correctness )
assign some new values to routes to be installed into the kernel
so we can know who owns them later.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Quentin Young [Mon, 5 Jun 2017 20:18:48 +0000 (20:18 +0000)]
lib: allow infinite sleep in poll()
If fd_poll() is called with no file descriptors, an incorrect check in
the function prelude causes it to return instantly; for a thread that
wishes to poll but has no file descriptors, this results in busy
waiting. Desired behavior is to block.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Chirag Shah [Tue, 6 Jun 2017 01:21:52 +0000 (18:21 -0700)]
pimd: fix pim bfd crash and bfd neigh down
During running config, all IFPs are traversed, bfd interface config write
need to check for ifp->info null in case pim info is missing and skip the interface.
bfd update for address change need to check if particular pim neighbor's address matches
with bfd address update
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Renato Westphal [Fri, 2 Jun 2017 14:14:54 +0000 (11:14 -0300)]
ldpd: fix bug in pseudowire control-word negotiation
Bingen discovered a bug in the pseudowire control-word negotiation that
might happen when the "control-word exclude" command is used. Under some
very specific conditions, ldpd might ignore a PWID label mapping when
it shouldn't.
This patch removes a wrong optimization that was preventing ldpd to call
l2vpn_pw_reset() every time we change the configuration of a pseudowire.
When the transport address is changed, all interfaces and targeted
neighbors are temporary disabled in the ldpe process until new sockets
bound to the new transport address are received from the parent.
This patch fixes a problem in which adjacencies weren't being removed
after the associated targeted neighbors were disabled. This was causing
ldpd not to set some MD5 sockoptions for new neighbors are thus preventing
MD5-protected sessions to come up after a change in the transport-address.
It's doesn't make sense to enforce that a targeted-hello is received
on an LDP-enabled interface. It should be possible, for example, to use
LDP only to signal pseudowires and other another protocol (e.g. RSVP-TE)
to create end-to-end LSPs.
ldpd: schedule the sending of label messages when necessary
Once we send a Label Withdraw, we can't send a Label Mapping for the
same FEC until we receive a Label Release from the peer. This is due to
some limitations in the LDP algorithms described in Appendix A. ("LDP
Label Distribution Procedures") of RFC 5036.
To workaround this issue, make it possible to schedule the sending of
a Label Mapping as soon as a Label Release is received for the same FEC.
The easiest way to test this patch is by typing the "label local advertise
explicit-null" command. ldpd will withdraw all null labels using a
Wildcard FEC and then send new Label Mappings as soon the corresponding
Label Releases are received.
On unstable networks, routes can be lost and relearned very often. If
we deallocate the input label every time a route is lost and allocate
a new one when the route is relearned, a lot of changes are made in vain.
This patch introduces a logic in which labels are preserved for at least
five minutes before being deallocated by the LIB garbage collector. This
is consistent with what other implementations do.
ldpd: accept notifications during the session establishment process
If we don't do this, we'll never trigger the backoff exponential timer
since it's impossible to distinguish between Initialization NAK's and
general errors.
Also:
* Implement some missing bits from RFC 5036;
* remove superfluous log message in session_shutdown()
(send_notification() logs that we're sending a fatal notification).
ldpd: use synchronous channels for sending log messages
This is necessary to guarantee that all log messages sent from the child
processes are received in the parent process right away.
Without this patch, when a child process calls fatal() or fatalx(),
the log messages don't make it to the parent because the child doesn't
have a chance to flush its buffers before exiting.
When ldpd fails to start for some reason, like failing to create a pid
file, the child processes call their shutdown functions without being
completely initialized. This patch adds some protections to prevent a
segmentation fault on such circumstances.
ldpd: simplify initialization of the child processes
In order to have separate ASLR/cookies per process, ldpd calls exec()
in the child processes after fork() (this is also known as the fork+exec
model).
This is an important security feature but it makes the initialization
of the child processes a bit more complicated as they're not a copy of
the parent anymore, so all parameters given via command line are lost.
To solve this problem, we were creating an argv array by hand with all
necessary parameters and providing it to the exec() syscall. This works
but it's a very ugly solution. This patch introduces a different approach
to solve the problem: send an IMSG_INIT message to the child processes
with all parameters they need in order to initialize properly. This
makes adding additional initialization parameters much more convenient
and less error prone.
Don Slice [Mon, 5 Jun 2017 13:13:57 +0000 (13:13 +0000)]
bgpd: fix ipv6 network statement label-index node
Problem reported with the inability to define "network x:x:x::/64 label-index" to
the config. Found that the install_element was pointing to the wrong node.
Ticket: CM-16615 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Renato Westphal [Fri, 2 Jun 2017 22:08:14 +0000 (19:08 -0300)]
ldpd: further improvements in the configuration handling
This patch attempts to make the code easier to read by removing a
global variable and changing a few other things. Also, ldpd now calls
merge_config() only after reading the whole initial configuration at
startup, instead of doing that for every command in the configuration
file.
Renato Westphal [Fri, 2 Jun 2017 14:14:54 +0000 (11:14 -0300)]
ldpd: fix bug in pseudowire control-word negotiation
Bingen discovered a bug in the pseudowire control-word negotiation that
might happen when the "control-word exclude" command is used. Under some
very specific conditions, ldpd might ignore a PWID label mapping when
it shouldn't.
This patch removes a wrong optimization that was preventing ldpd to call
l2vpn_pw_reset() every time we change the configuration of a pseudowire.
Donald Sharp [Wed, 17 May 2017 20:20:29 +0000 (16:20 -0400)]
lib, zebra: Pass up kernel table_id for vrf's
pim controls the vrf table creation for due to the way that
pim must interact with the kernel. In order to match the
table_id for unicast <-> multicast( not necessary but a
real nice to have ) we need to pass up from zebra the
table_id associated with the vrf.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 1 Jun 2017 11:26:25 +0000 (07:26 -0400)]
zebra: Refactor 'struct rib' to be 'struct route_entry'
The 'struct rib' data structure is missnamed. It really
is a 'struct route_entry' as part of the 'struct route_node'.
We have 1 'struct route_entry' per route src. As such
1 route node can have multiple route entries if multiple
protocols attempt to install the same route.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>