David Lamparter [Tue, 14 Feb 2017 02:31:26 +0000 (03:31 +0100)]
ospfclient: fix gcc -O0 build
the "static const" inside DECLARE_MTYPE still causes issues on gcc -O0
(re. gcc bug 69981). Work around by disabling MTYPE declarations for
ospfclient.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Fri, 16 Dec 2016 22:27:39 +0000 (23:27 +0100)]
lib: parser: rewrite token deduplication
Merge the parsed graph into the existing one as a separate step. This
makes it possible to merge identical subgraphs, which is used e.g. in
bgpd for <A.B.C.D|X:X::X:X|WORD> neighbor names.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 9 Feb 2017 11:59:44 +0000 (12:59 +0100)]
ospfclient: #include sources
Pulling in source files from another directory breaks automake's
distclean target, and there seems to be no good fix for this...
(particularly since we need -fPIC build for a DSO here, while ospfd
compiles for an executable...)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib: simplify str2mac and use struct ethaddr structure
This commit simplified the string to mac conversion, since it uses
sscanf, instead of depicting each incoming character one by one, and
doing self analysis. Also,this commit changes the internal usage of the
mac address representation in mac handling function.
Signed-off-by: Lou Berger <lberger@labn.net> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Renato Westphal [Tue, 7 Feb 2017 13:42:01 +0000 (11:42 -0200)]
zebra: fix uninstallation of LDP labeled static routes
Problem:
1 - Add a static route: "ip route 10.0.0.0/24 172.16.1.1";
2 - Receive an LDP mapping for 10.0.0.0/24 from 172.16.1.1;
3 - Remove the static route: "no ip route 10.0.0.0/24 172.16.1.1".
4 - Static route is removed but not uninstalled from the kernel.
What happens is that, on static_uninstall_route(), we can't find the
route we want to uninstall because it has an LDP label where the original
static route doesn't have any MPLS label.
To fix this, we can just stop calling static_nexthop_label_same() and
remove this function. It's impossible to have two routes for the same
prefix with the same distance and same nexthop address. This means that
we can lookup the correct route to uninstall without having to check
its labels.
Donald Sharp [Tue, 7 Feb 2017 19:55:39 +0000 (14:55 -0500)]
bgpd: Fix usage of uninitialized dn_flag[]
dn_flag was tested inside of a 'use_json' block
further down in the function. Move initialization
of the value to outside of the !use_json if statement
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
As the prefix call function for mac handling has prefix_ prepended
before, the change must be propagated to all locations where those
functions are called.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>