David Lamparter [Tue, 24 Jan 2017 20:35:08 +0000 (21:35 +0100)]
ospfd: isolate ospfapiclient lib from ospf lib
The OSPF API-client library doesn't really use anything from libospf
except some small dumping tools. Isolate these into a separate file
and detangle the ospfapiclient library.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Donald Sharp [Wed, 1 Feb 2017 15:31:40 +0000 (10:31 -0500)]
bgpd: Allow views to 'pretend' resolve nexthops
Views are supposed to be independent tables that have no connection to
routing tables. Since View's are 'independent' there is no way to do
'real' nexthop resolution since connected routes and interfaces are
associated with a particular table (or really vrf). So when we have a
bgp instance assume that nexthops specified are actually valid, since we
are propagating what our neighbors are telling us.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
[cherry-picked from master 6fa1ab2eecb39b35256739f7083196d6f556f639] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Renato Westphal [Tue, 7 Feb 2017 11:47:37 +0000 (09:47 -0200)]
zebra: fix installation of LDP labels on static routes
If the ifindex of a nexthop is not zero, we can't assume that its type is
NEXTHOP_TYPE_IPV4_IFINDEX or NEXTHOP_TYPE_IPV6_IFINDEX. Nexthops of type
NEXTHOP_TYPE_IPV[46] can have their ifindex set by the nexthop_active()
function.
With that said, we need to me more flexible when comparing nexthops
on mpls_ftn_update() to make sure that we'll always find the correct
route/nexthop to update.
Regression introduced by commit 88d88a ("zebra/ldpd: allow MPLS ECMP on
unnumbered interfaces") and found by ANVL.
Renato Westphal [Fri, 3 Feb 2017 13:09:27 +0000 (11:09 -0200)]
ldpd: update local labels when necessary
ldpd allocates null labels for directly connected routes. If a connected
route is removed (interface goes down) and an IGP learned route takes its
place in the RIB, ldpd must update the local label of the associated FEC
entry with a non-null label. The same applies for the other way around
(an interface goes up and a connected route is selected in favour of an
IGP route). Labels should be dynamic and change when necessary.
Additionally, this patch fixes the processing of route delete messages
from zebra. Route delete messages don't contain any nexthop, meaning that
whenever we receive such messages we must delete all nexthop previously
received.
Based on a patch from Bingen Eguzkitza <bingen@voltanet.io>. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Donald Sharp [Fri, 3 Feb 2017 17:37:39 +0000 (12:37 -0500)]
pimd: Refactor pim_sock_open to just need the ifp pointer
In all cases pim_sock_open was called, we just passed
in the pim_ifp->primary_address, which is accessible
from the interface pointer. So just pass that in.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
During Discussions with Lou, it was decided that his code
changes would handle this part, and my code changes would
fix up vtysh and bgp to be in sync again.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 2 Feb 2017 18:56:56 +0000 (13:56 -0500)]
bgpd: Put back original behavior for some show bgp commands
The behavior of some show commands was switched from
showing the unicast data to all safi data. This
is a change in behavior and needs to be put
back for 2.0
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 2 Feb 2017 18:54:47 +0000 (13:54 -0500)]
bgpd: Allow vtysh to work for address-family
extract.pl.in requires the lines that are ignored
to be consisten with what is in the *.c file
that we are ignoring from, else we get ambiguous
commands.
This allows vtysh to enter address-family sub mode
in bgp again.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 2 Feb 2017 00:52:54 +0000 (19:52 -0500)]
lib: Treat v6 address as a v6 address
The code was making the correct assumption
that the v4 and v6 addresses start in the
same spot in memory and since we were looking
at a v6 prefix it would just work. This
causes distress in SA systems, so let's just
make it happy.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 2 Feb 2017 00:51:31 +0000 (19:51 -0500)]
lib: Fix possible array overrun
It is possible if the hostname is > 32
characters that we would just overrun the
client_name data structure. Truncate
the hostname string to 31 characters (to allow for NULL)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 2 Feb 2017 00:47:39 +0000 (19:47 -0500)]
lib: Inadvertent assignment in ? operator
In the case where we are using select as
the operator *and* we call
funcname_thread_add_read_write *and* the
fd is already set, we would overwrite
the read/write direction to always be READ.
Clearly this was a bad idea.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Thu, 2 Feb 2017 00:45:57 +0000 (19:45 -0500)]
lib: Fix SA warnings and reduce cli
The cli could be reduced for v4 and v6 code
paths into 1 function. Additionally the v6
code path had a SA issue found where it
"theoratically" could have caused a null
de-reference. This issue has been removed
as well.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Renato Westphal [Fri, 27 Jan 2017 16:22:47 +0000 (14:22 -0200)]
ldpd: introduce advanced filtering capabilities
This patch introduces several new configuration commands to ldpd. These
commands should allow the operator to define advanced filtering policies
for things like label advertisement, label allocation, etc.
Renato Westphal [Wed, 1 Feb 2017 11:51:54 +0000 (09:51 -0200)]
ldpd: add synchronous IPC channels
By default all ldpd interprocess communication is asynchronous
(non-blocking socketpairs). Under some circumstances, however, we'll
need synchronous IPC as well. Examples:
* the lde child process requesting labels to zebra (through the parent
process);
* apply an access-list on a given IP prefix (ACLs are only available in
the parent process).
This patch only adds the necessary infrastructure to allow the child
processes to make synchronous requests to the parent process. Later
patches will make use of this new infrastructure.
Renato Westphal [Wed, 1 Feb 2017 15:03:53 +0000 (13:03 -0200)]
ldpd: fix a bug in the explicit-null command
Be more clever and update the label of the connected routes just once upon
a configuration change. This is not only more efficient but also fixes
a bug where no labels were updated when we didn't have any neighbors.
David Lamparter [Wed, 1 Feb 2017 12:40:00 +0000 (13:40 +0100)]
bgpd: clear bgp_master at exit to help valgrind
bgp_master can retain pointers keeping allocated structures "reachable"
in valgrind. Clear to 0 to tell valgrind that everything should've been
freed really.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>