]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
8 years agolib: use fsync() for config writes, plug fd leak 189/head
David Lamparter [Wed, 8 Feb 2017 15:14:10 +0000 (16:14 +0100)]
lib: use fsync() for config writes, plug fd leak

sync() has a HUGE impact on systems that perform actual I/O, i.e. real
servers...

Also, we were leaking a fd on each config write ever since
c5e69a0 "lib/vty: add separate output fd support to VTYs"
(by myself :( ...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoMerge branch 'frr/pull/180' ("Warnings")
David Lamparter [Wed, 8 Feb 2017 14:31:24 +0000 (15:31 +0100)]
Merge branch 'frr/pull/180' ("Warnings")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agotests: Fix warning in compile 180/head
Donald Sharp [Tue, 7 Feb 2017 19:14:17 +0000 (14:14 -0500)]
tests: Fix warning in compile

Fix bgp_mp_attr_test.c warning in compile
on fedora 25 and clang.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Fix warning -> error build issue
Donald Sharp [Tue, 7 Feb 2017 18:55:55 +0000 (13:55 -0500)]
lib: Fix warning -> error build issue

When compiling ./buildtest.sh the gcc compiler
on fedora 25 complains about indentation

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge remote-tracking branch 'origin/stable/2.0'
Donald Sharp [Tue, 7 Feb 2017 18:20:12 +0000 (13:20 -0500)]
Merge remote-tracking branch 'origin/stable/2.0'

8 years agoMerge pull request #176 from opensourcerouting/mtype-underflow-backtrace
Donald Sharp [Tue, 7 Feb 2017 18:04:27 +0000 (13:04 -0500)]
Merge pull request #176 from opensourcerouting/mtype-underflow-backtrace

lib: print backtrace on MTYPE count underflow

8 years agoMerge pull request #178 from opensourcerouting/ospf_lib_private
Donald Sharp [Tue, 7 Feb 2017 18:04:13 +0000 (13:04 -0500)]
Merge pull request #178 from opensourcerouting/ospf_lib_private

make libfrrospf private

8 years agoMerge pull request #174 from LabNConsulting/working/master/patch-set/issue-172
David Lamparter [Tue, 7 Feb 2017 16:27:58 +0000 (17:27 +0100)]
Merge pull request #174 from LabNConsulting/working/master/patch-set/issue-172

master: Fix encap attribute on wire, protect against broken object.

8 years agoMerge pull request #173 from LabNConsulting/working/2.0/patch-set/issue-172
David Lamparter [Tue, 7 Feb 2017 16:27:44 +0000 (17:27 +0100)]
Merge pull request #173 from LabNConsulting/working/2.0/patch-set/issue-172

2.0: Fix encap attribute on wire, protect against broken object.

8 years agoospfd: make libfrrospf a private non-dynamic lib 178/head
David Lamparter [Tue, 24 Jan 2017 22:26:20 +0000 (23:26 +0100)]
ospfd: make libfrrospf a private non-dynamic lib

There's no point in installing libospf anymore, now that
libfrrospfclient doesn't link it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoospfd: isolate ospfapiclient lib from ospf lib
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>
8 years agoMerge pull request #161 from donaldsharp/stableMcLibrary
David Lamparter [Tue, 7 Feb 2017 16:17:12 +0000 (17:17 +0100)]
Merge pull request #161 from donaldsharp/stableMcLibrary

Stable mc library

8 years agobgpd: Allow views to 'pretend' resolve nexthops
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>
8 years agoMerge branch 'frr/pull/157' ("Fixinator")
David Lamparter [Tue, 7 Feb 2017 15:38:03 +0000 (16:38 +0100)]
Merge branch 'frr/pull/157' ("Fixinator")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: print backtrace on MTYPE count underflow 176/head
David Lamparter [Tue, 7 Feb 2017 15:23:38 +0000 (16:23 +0100)]
lib: print backtrace on MTYPE count underflow

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoMerge branch 'frr/pull/165' ("Pim vrf")
David Lamparter [Tue, 7 Feb 2017 14:52:52 +0000 (15:52 +0100)]
Merge branch 'frr/pull/165' ("Pim vrf")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoMerge branch 'frr/pull/166' ("bgpd: fix array oob ...")
David Lamparter [Tue, 7 Feb 2017 14:50:26 +0000 (15:50 +0100)]
Merge branch 'frr/pull/166' ("bgpd: fix array oob ...")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoMerge branch 'frr/pull/152' ("Lib fixes")
David Lamparter [Tue, 7 Feb 2017 14:48:46 +0000 (15:48 +0100)]
Merge branch 'frr/pull/152' ("Lib fixes")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd rfapi: advertise encap attribute when TT is valid and not MPLS. 174/head
Lou Berger [Tue, 7 Feb 2017 02:29:43 +0000 (21:29 -0500)]
bgpd rfapi: advertise encap attribute when TT is valid and not MPLS.
     Ensure tunnel type set based on rx'ed
     Ignore bad/mpls encap types.

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agoMerge pull request #171 from donaldsharp/double_free
Renato Westphal [Tue, 7 Feb 2017 13:48:15 +0000 (11:48 -0200)]
Merge pull request #171 from donaldsharp/double_free

lib: Don't use malloc!

8 years agoMerge pull request #169 from opensourcerouting/ldpd-label-alloc-rework
Donald Sharp [Tue, 7 Feb 2017 13:41:45 +0000 (08:41 -0500)]
Merge pull request #169 from opensourcerouting/ldpd-label-alloc-rework

ldpd: update local labels when necessary

8 years agobgpd rfapi: advertise encap attribute when TT is valid and not MPLS. 173/head
Lou Berger [Tue, 7 Feb 2017 02:29:43 +0000 (21:29 -0500)]
bgpd rfapi: advertise encap attribute when TT is valid and not MPLS.
     Ensure tunnel type set based on rx'ed
     Ignore bad/mpls encap types.

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agozebra: fix installation of LDP labels on static routes 169/head
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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agolib: Fixup CR comment 171/head
Donald Sharp [Tue, 7 Feb 2017 09:54:40 +0000 (04:54 -0500)]
lib: Fixup CR comment

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Don't use malloc!
Donald Sharp [Mon, 6 Feb 2017 17:52:28 +0000 (12:52 -0500)]
lib: Don't use malloc!

thread.c was using malloc.  This was found by the
assert added to memory.c.

Fixes issues #170

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoldpd: update local labels when necessary
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>
8 years agoldpd: fix silly bug introduced by a recent commit
Renato Westphal [Fri, 3 Feb 2017 13:08:45 +0000 (11:08 -0200)]
ldpd: fix silly bug introduced by a recent commit

This call to fatalx() was making ldpd crash when a pseudowire was
configured.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agozebra: fix indentation problems introduced by wrong conflict resolution
Renato Westphal [Mon, 6 Feb 2017 13:57:34 +0000 (11:57 -0200)]
zebra: fix indentation problems introduced by wrong conflict resolution

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agoMerge pull request #167 from qlyoung/vtysh-subs-stable
Martin Winter [Fri, 3 Feb 2017 20:11:18 +0000 (12:11 -0800)]
Merge pull request #167 from qlyoung/vtysh-subs-stable

vtysh: Quagga.conf -> Frr.conf

8 years agovtysh: Quagga.conf -> Frr.conf 167/head
Quentin Young [Wed, 1 Feb 2017 22:01:17 +0000 (22:01 +0000)]
vtysh: Quagga.conf -> Frr.conf

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agobgpd: fix array oob for `show ip bgp` 166/head
Quentin Young [Fri, 3 Feb 2017 18:23:50 +0000 (18:23 +0000)]
bgpd: fix array oob for `show ip bgp`

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agopimd: Refactor pim_sock_open to just need the ifp pointer 165/head
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>
8 years agopimd: Allow a interface in a vrf to be configured.
Donald Sharp [Fri, 3 Feb 2017 17:33:37 +0000 (12:33 -0500)]
pimd: Allow a interface in a vrf to be configured.

This fixes the issue a crash when we have configured an interface
inside of a vrf, and apply pim commands to it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoMerge pull request #158 from LabNConsulting/working/2.0/patch-set/rfapi+vty
Donald Sharp [Fri, 3 Feb 2017 16:54:52 +0000 (11:54 -0500)]
Merge pull request #158 from LabNConsulting/working/2.0/patch-set/rfapi+vty

2.0: Fix a couple of merge related and rfapi/show vpn issues

8 years agoRevert "bgpd: Put back original behavior for some show bgp commands" 157/head
Donald Sharp [Fri, 3 Feb 2017 15:33:14 +0000 (10:33 -0500)]
Revert "bgpd: Put back original behavior for some show bgp commands"

This reverts commit 713de0685fc0ef882c97a6cb4bd149620f4dbdf4.

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>
8 years agobgpd, vtysh: Fix vtysh able to handle some safi modes for bgp
Donald Sharp [Fri, 3 Feb 2017 15:29:53 +0000 (10:29 -0500)]
bgpd, vtysh: Fix vtysh able to handle some safi modes for bgp

This adds the ability for vtysh to handle v4 and v6
safi modes besides unicast and multicast.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
8 years agobgp: remove HAVE_IPV6 from file (again!) 158/head
Lou Berger [Fri, 3 Feb 2017 15:16:01 +0000 (10:16 -0500)]
bgp: remove HAVE_IPV6 from file (again!)

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgpd: add missing json strings
Lou Berger [Fri, 3 Feb 2017 15:04:19 +0000 (10:04 -0500)]
bgpd: add missing json strings

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agoMerge pull request #159 from LabNConsulting/working/master/patch-set/rfapi+vty
Donald Sharp [Fri, 3 Feb 2017 14:38:56 +0000 (09:38 -0500)]
Merge pull request #159 from LabNConsulting/working/master/patch-set/rfapi+vty

Master: Fix a couple of issues -  rfapi/show vpn issues

8 years ago*: Convert libospf -> libfrrospf 161/head
Donald Sharp [Fri, 3 Feb 2017 13:43:55 +0000 (08:43 -0500)]
*: Convert libospf -> libfrrospf

Convert the libospfapiclient -> libfrrospfapiclient
and libospf -> libfrrospf to prevent namespace
collision with Quagga.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years ago*: Convert libfpm -> libfrrfpm
Donald Sharp [Fri, 3 Feb 2017 13:43:09 +0000 (08:43 -0500)]
*: Convert libfpm -> libfrrfpm

Convert the libfpm to libfrrfpm to prevent namespace
collision with Quagga.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoospf6d: Fix compile warnings
Donald Sharp [Fri, 3 Feb 2017 13:26:33 +0000 (08:26 -0500)]
ospf6d: Fix compile warnings

These compile issues were found by running ./buildtest.sh
on a fedora 25 box.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoospfd: Fix compile warnings
Donald Sharp [Fri, 3 Feb 2017 13:22:15 +0000 (08:22 -0500)]
ospfd: Fix compile warnings

These compile issues were found w/ gcc and running
./buildtest.sh on a fedora 25 box.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoripd: Fix compile warning
Donald Sharp [Fri, 3 Feb 2017 13:20:14 +0000 (08:20 -0500)]
ripd: Fix compile warning

This issue was found compiling with ./buildtest.sh
on fedora 25

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years ago*: Convert libzebra -> libfrr
Donald Sharp [Fri, 3 Feb 2017 12:59:04 +0000 (07:59 -0500)]
*: Convert libzebra -> libfrr

The library libzebra that is installed with FRR will
conflict with Quagga.  So let's rename it to libfrr.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: get rid of 'unknown' in show safi 159/head
Lou Berger [Fri, 3 Feb 2017 02:35:24 +0000 (21:35 -0500)]
bgpd: get rid of 'unknown' in show safi
      Merge 2.0 change, adapted to master

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgpd rfapi: fix TT handling broken on Sat Jan 28 18:57:28 2017 -0500
Lou Berger [Fri, 3 Feb 2017 00:50:36 +0000 (19:50 -0500)]
bgpd rfapi: fix TT handling broken on Sat Jan 28 18:57:28 2017 -0500

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgpd: get rid of 'unknown' in show safi (broken in earlier merge)
Lou Berger [Fri, 3 Feb 2017 02:35:24 +0000 (21:35 -0500)]
bgpd: get rid of 'unknown' in show safi (broken in earlier merge)

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgpd: cleanup/restore show ip|ipv6 bgp and show bgp ipv4 summary related commands
Lou Berger [Fri, 3 Feb 2017 02:33:55 +0000 (21:33 -0500)]
bgpd: cleanup/restore show ip|ipv6 bgp and show bgp ipv4 summary related commands

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgpd rfapi: fix TT handling broken on Sat Jan 28 18:57:28 2017 -0500
Lou Berger [Fri, 3 Feb 2017 00:50:36 +0000 (19:50 -0500)]
bgpd rfapi: fix TT handling broken on Sat Jan 28 18:57:28 2017 -0500

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgpd: Put back original behavior for some show bgp commands
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>
8 years agobgpd: Allow vtysh to work for address-family
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>
8 years agoMerge remote-tracking branch 'origin/stable/2.0'
Donald Sharp [Thu, 2 Feb 2017 15:42:51 +0000 (10:42 -0500)]
Merge remote-tracking branch 'origin/stable/2.0'

8 years agoMerge pull request #135 from LabNConsulting/working/master/patch-set/misc+vrf
Donald Sharp [Thu, 2 Feb 2017 14:25:24 +0000 (09:25 -0500)]
Merge pull request #135 from LabNConsulting/working/master/patch-set/misc+vrf

Master: misc vnc/rfapi and VRF

8 years agoMerge pull request #154 from LabNConsulting/working/master/patch-set/rr-part2
Donald Sharp [Thu, 2 Feb 2017 12:49:43 +0000 (07:49 -0500)]
Merge pull request #154 from LabNConsulting/working/master/patch-set/rr-part2

Mater: complete Issue#91 fix (regression now clean)

8 years agoMerge pull request #153 from LabNConsulting/working/2.0/patch-set/rr-part2
Donald Sharp [Thu, 2 Feb 2017 12:48:45 +0000 (07:48 -0500)]
Merge pull request #153 from LabNConsulting/working/2.0/patch-set/rr-part2

2.0: complete Issue#91 fix (regression now clean)

8 years agoMerge pull request #143 from LabNConsulting/working/2.0/patch/mpls-tt
Donald Sharp [Thu, 2 Feb 2017 12:47:43 +0000 (07:47 -0500)]
Merge pull request #143 from LabNConsulting/working/2.0/patch/mpls-tt

2.0: bgp rfapi: fix resolution / lookup failure when using MPLS TT

8 years agoMerge pull request #151 from opensourcerouting/ldpd-filtering
Donald Sharp [Thu, 2 Feb 2017 12:45:08 +0000 (07:45 -0500)]
Merge pull request #151 from opensourcerouting/ldpd-filtering

ldpd: introduce advanced filtering capabilities

8 years agobgpd rfapi: small debug log enhancements 154/head
G. Paul Ziemba [Thu, 2 Feb 2017 00:24:32 +0000 (16:24 -0800)]
bgpd rfapi: small debug log enhancements

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
8 years agobgpd rfapi: RR replated (Issue #91) treat filtered update
G. Paul Ziemba [Thu, 2 Feb 2017 00:13:33 +0000 (16:13 -0800)]
bgpd rfapi: RR replated (Issue #91) treat filtered update
     as implicit withdraw for rfapi

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
8 years agobgpd rfapi: RR replated (Issue #91) treat filtered update 153/head
G. Paul Ziemba [Thu, 2 Feb 2017 00:13:33 +0000 (16:13 -0800)]
bgpd rfapi: RR replated (Issue #91) treat filtered update
     as implicit withdraw for rfapi

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
8 years agopimd: Fix fd leak 152/head
Donald Sharp [Thu, 2 Feb 2017 01:44:21 +0000 (20:44 -0500)]
pimd: Fix fd leak

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix cmd issues
Donald Sharp [Thu, 2 Feb 2017 01:40:10 +0000 (20:40 -0500)]
pimd: Fix cmd issues

Fix possible buffer overwrite and uninitialized idx access.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Fix broken switch statement
Donald Sharp [Thu, 2 Feb 2017 01:38:02 +0000 (20:38 -0500)]
pimd: Fix broken switch statement

Fix broken switch statement that would
allow the case statement to fall through.

Fix possible buffer overwrite.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoripd: Prevent rip null dereference
Donald Sharp [Thu, 2 Feb 2017 01:36:44 +0000 (20:36 -0500)]
ripd: Prevent rip null dereference

When rip is NULL, we dereference it
anyways.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agozebra: Fix free'd memory write
Donald Sharp [Thu, 2 Feb 2017 01:35:39 +0000 (20:35 -0500)]
zebra: Fix free'd memory write

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Treat v6 address as a v6 address
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>
8 years agolib: Fix possible array overrun
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>
8 years agolib: Properly Initialize code
Donald Sharp [Thu, 2 Feb 2017 00:49:48 +0000 (19:49 -0500)]
lib: Properly Initialize code

was_stdio was never set up with a 'correct'
initial value, leading to cases where
we would choose what to do based upon
what was in the stack.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agolib: Inadvertent assignment in ? operator
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>
8 years agolib: Fix SA warnings and reduce cli
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>
8 years agolib: Fix SA issue with stream s read
Donald Sharp [Thu, 2 Feb 2017 00:43:43 +0000 (19:43 -0500)]
lib: Fix SA issue with stream s read

We were checking for non-null of 'struct stream *s'
after we did a stream_getl, which would have crashed
the program.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoldpd: introduce advanced filtering capabilities 151/head
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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agoldpd: add synchronous IPC channels
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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agoldpd: fix a bug in the explicit-null command
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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agoMerge pull request #146 from opensourcerouting/assorted-stable
Donald Sharp [Wed, 1 Feb 2017 15:52:21 +0000 (10:52 -0500)]
Merge pull request #146 from opensourcerouting/assorted-stable

assorted fixes for stable/2.0

8 years agoldpd: release all memory explicitly on exit
Renato Westphal [Fri, 27 Jan 2017 22:01:35 +0000 (20:01 -0200)]
ldpd: release all memory explicitly on exit

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agozebra: fix wrong asserts in netlink code
Renato Westphal [Fri, 27 Jan 2017 20:18:13 +0000 (18:18 -0200)]
zebra: fix wrong asserts in netlink code

These new asserts were causing zebra to abort when trying to install
MPLS labeled routes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agolib: remove unnecessary variable
Renato Westphal [Fri, 27 Jan 2017 20:16:31 +0000 (18:16 -0200)]
lib: remove unnecessary variable

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
8 years agozebra: fix SEGV on exit or vrf delete 146/head
David Lamparter [Wed, 1 Feb 2017 14:33:55 +0000 (15:33 +0100)]
zebra: fix SEGV on exit or vrf delete

table->info must be free'd last, it's used in rib_unlink().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: clear bgp_master at exit to help valgrind
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>
8 years agobgpd: clean up dump config at exit
David Lamparter [Wed, 1 Feb 2017 12:39:26 +0000 (13:39 +0100)]
bgpd: clean up dump config at exit

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: plug leak in prefix_list_delete()
David Lamparter [Wed, 1 Feb 2017 12:21:40 +0000 (13:21 +0100)]
lib: plug leak in prefix_list_delete()

prefix_list_delete wasn't releasing chained trie entries, only the main
one.  Just call the proper trie_del.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: fpm: fix --enable-dev-build
David Lamparter [Mon, 23 Jan 2017 22:32:01 +0000 (23:32 +0100)]
zebra: fpm: fix --enable-dev-build

I guess no one uses --enable-dev-build...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years ago*: fix warning fallout from set_socket_path
David Lamparter [Wed, 1 Feb 2017 12:12:16 +0000 (13:12 +0100)]
*: fix warning fallout from set_socket_path

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgp rfapi: fix resolution / lookup failure when using MPLS TT 135/head
Lou Berger [Tue, 31 Jan 2017 21:42:47 +0000 (16:42 -0500)]
bgp rfapi: fix resolution / lookup failure when using MPLS TT

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agobgp rfapi: fix resolution / lookup failure when using MPLS TT 143/head
Lou Berger [Tue, 31 Jan 2017 21:42:47 +0000 (16:42 -0500)]
bgp rfapi: fix resolution / lookup failure when using MPLS TT

Signed-off-by: Lou Berger <lberger@labn.net>
8 years agoMerge pull request #139 from opensourcerouting/cli_merge_prep_final
Donald Sharp [Tue, 31 Jan 2017 18:27:42 +0000 (13:27 -0500)]
Merge pull request #139 from opensourcerouting/cli_merge_prep_final

CLI split merge-step preparations

8 years agoMerge pull request #98 from opensourcerouting/feature/zebra-srcdest
Donald Sharp [Tue, 31 Jan 2017 17:29:00 +0000 (12:29 -0500)]
Merge pull request #98 from opensourcerouting/feature/zebra-srcdest

feature/zebra-srcdest

8 years agoMerge pull request #140 from opensourcerouting/fixes/isis-subtlv
Donald Sharp [Tue, 31 Jan 2017 17:28:40 +0000 (12:28 -0500)]
Merge pull request #140 from opensourcerouting/fixes/isis-subtlv

isisd: parse TE-IP reachability and IPv6 reachability subtlvs

8 years agoMerge branch 'master' into feature/zebra-srcdest 98/head
Christian Franke [Tue, 31 Jan 2017 15:22:54 +0000 (16:22 +0100)]
Merge branch 'master' into feature/zebra-srcdest

8 years agoisisd: parse TE-IP reachability and IPv6 reachability subtlvs 140/head
Christian Franke [Tue, 31 Jan 2017 15:10:25 +0000 (16:10 +0100)]
isisd: parse TE-IP reachability and IPv6 reachability subtlvs

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
8 years agotests/testcli: cleanup at exit 139/head
David Lamparter [Thu, 26 Jan 2017 20:57:58 +0000 (21:57 +0100)]
tests/testcli: cleanup at exit

Call the proper termination functions so we can see memory leaks.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: move at_close call in vty_stdio to end
David Lamparter [Thu, 26 Jan 2017 21:09:37 +0000 (22:09 +0100)]
lib: move at_close call in vty_stdio to end

Since the at_close call for the stdio vty might exit() the process, move
it to the end of the function, after freeing all memory.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib/tests: add cmd_hostname_set()
David Lamparter [Thu, 26 Jan 2017 20:57:46 +0000 (21:57 +0100)]
lib/tests: add cmd_hostname_set()

To make it possible for testcli to get a clean memory management bill.
(Note: XFREE() is NULL-safe, just like free().)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: add vector_unset_value()
David Lamparter [Wed, 25 Jan 2017 03:13:02 +0000 (04:13 +0100)]
lib: add vector_unset_value()

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: clean up tab-completion memory counting
David Lamparter [Thu, 26 Jan 2017 20:57:24 +0000 (21:57 +0100)]
lib: clean up tab-completion memory counting

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: parser: fix allocation counting
David Lamparter [Thu, 26 Jan 2017 21:19:32 +0000 (22:19 +0100)]
lib: parser: fix allocation counting

command_lex.l was allocating as MTYPE_TMP, while command_parse.y would
just call free().  Make both use MTYPE_LEX.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoMerge branch 'frr/pull/133' ("Pim cleanup")
David Lamparter [Tue, 31 Jan 2017 14:26:07 +0000 (15:26 +0100)]
Merge branch 'frr/pull/133' ("Pim cleanup")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: Do not force NEXTHOP_TYPE to XXX_IFINDEX 133/head
Donald Sharp [Tue, 31 Jan 2017 12:36:57 +0000 (07:36 -0500)]
zebra: Do not force NEXTHOP_TYPE to XXX_IFINDEX

The original goal of the zebra change was to force all:
NEXTHOP_TYPE_IPV4 -> NEXTHOP_TYPE_IPV4_IFINDEX
NEXTHOP_TYPE_IPV6 -> NEXTHOP_TYPE_IPV6_IFINDEX

This causes issues in routes being installed into the kernel
backing this out until I can get time to fully understand
what is going wrong.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>