]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agozebra: add pseudowire manager
ßingen [Mon, 15 May 2017 15:09:28 +0000 (17:09 +0200)]
zebra: add pseudowire manager

Base framework for supporting MPLS pseudowires in FRR.

A consistent zserv interface is provided so that any client daemon
(e.g. ldpd, bgpd) can install/uninstall pseudowires in a standard
way. Static pseudowires can also be implemented by using the same
interface.

When zebra receives a request to install a pseudowire and the installation
in the kernel or hardware fails, a notification is sent back to the
client daemon and a new install attempt is made every 60 seconds (until
it succeeds).

Support for external dataplanes is provided by the use of hooks to
install/uninstall pseudowires.

Signed-off-by: ßingen <bingen@voltanet.io>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agozebra: add implicit-null labels to the rib
Renato Westphal [Tue, 6 Jun 2017 01:48:10 +0000 (22:48 -0300)]
zebra: add implicit-null labels to the rib

Implicit-null labels are never installed in the FIB but we need to keep
track of them because of L2/L3 VPN nexthop resolution.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoMerge pull request #802 from opensourcerouting/redhat-doc-fixes-3.0
Donald Sharp [Fri, 14 Jul 2017 14:59:18 +0000 (10:59 -0400)]
Merge pull request #802 from opensourcerouting/redhat-doc-fixes-3.0

Redhat doc fixes for stable/3.0

6 years agoMerge pull request #785 from Jafaral/debpkgfix3.0
Donald Sharp [Wed, 12 Jul 2017 12:26:30 +0000 (08:26 -0400)]
Merge pull request #785 from Jafaral/debpkgfix3.0

Deb pkg cleanup for 3.0/2.0

6 years agodoc: Update Building Doc for RedHat-style Distro's (CentOS / Fedora)
Martin Winter [Wed, 12 Jul 2017 01:37:02 +0000 (18:37 -0700)]
doc: Update Building Doc for RedHat-style Distro's (CentOS / Fedora)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoredhat: Add missing pimd to daemon config file
Martin Winter [Wed, 12 Jul 2017 01:36:41 +0000 (18:36 -0700)]
redhat: Add missing pimd to daemon config file

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agodocs: Changed the manpage section from 1 to 8 so it conforms with its definition
Ryan Hagelstrom [Fri, 30 Jun 2017 19:21:11 +0000 (14:21 -0500)]
docs: Changed the manpage section from 1 to 8 so it conforms with its definition

Signed-off-by: Ryan Hagelstrom <rhagelstrom@gmail.com>
6 years agoMerge pull request #773 from qlyoung/log-fix-3.0
Donald Sharp [Fri, 30 Jun 2017 19:08:53 +0000 (15:08 -0400)]
Merge pull request #773 from qlyoung/log-fix-3.0

*: simplify log message lookup [3.0]

6 years ago*: simplify log message lookup
Quentin Young [Tue, 20 Jun 2017 23:56:50 +0000 (23:56 +0000)]
*: simplify log message lookup

log.c provides functionality for associating a constant (typically a
protocol constant) with a string and finding the string given the
constant. However this is highly delicate code that is extremely prone
to stack overflows and off-by-one's due to requiring the developer to
always remember to update the array size constant and to do so correctly
which, as shown by example, is never a good idea.b

The original goal of this code was to try to implement lookups in O(1)
time without a linear search through the message array. Since this code
is used 99% of the time for debugs, it's worth the 5-6 additional cmp's
worst case if it means we avoid explitable bugs due to oversights...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #756 from opensourcerouting/isis-redist-fixes
Donald Sharp [Wed, 28 Jun 2017 13:55:35 +0000 (09:55 -0400)]
Merge pull request #756 from opensourcerouting/isis-redist-fixes

Isis redist fixes

6 years agoMerge pull request #709 from opensourcerouting/ldpd-dual-stack
ßingen [Tue, 27 Jun 2017 13:37:52 +0000 (15:37 +0200)]
Merge pull request #709 from opensourcerouting/ldpd-dual-stack

ldpd: fix issues with dual-stack adjacencies

6 years agoMerge pull request #704 from chiragshah6/pim_dev_3_0
Jafar Al-Gharaibeh [Fri, 23 Jun 2017 15:29:27 +0000 (10:29 -0500)]
Merge pull request #704 from chiragshah6/pim_dev_3_0

ospfd: ospf bandwidth handling

7 years agoisisd: fix to adhere to new cli api
Christian Franke [Tue, 20 Jun 2017 20:49:37 +0000 (22:49 +0200)]
isisd: fix to adhere to new cli api

7 years agoisisd: fix memtype counting issue
Christian Franke [Tue, 20 Jun 2017 20:48:36 +0000 (22:48 +0200)]
isisd: fix memtype counting issue

7 years agoisisd: adjust redist functionality to current zapi
Christian Franke [Tue, 20 Jun 2017 20:47:54 +0000 (22:47 +0200)]
isisd: adjust redist functionality to current zapi

7 years agoisisd: fix formatting in metrics when showing database
Christian Franke [Tue, 20 Jun 2017 20:46:41 +0000 (22:46 +0200)]
isisd: fix formatting in metrics when showing database

7 years agoMerge pull request #713 from qlyoung/fix-zebra-dbz-3.0
David Lamparter [Fri, 16 Jun 2017 17:40:52 +0000 (19:40 +0200)]
Merge pull request #713 from qlyoung/fix-zebra-dbz-3.0

Fix zebra div by zero

7 years agozebra: more dbzing
Quentin Young [Fri, 16 Jun 2017 16:18:54 +0000 (16:18 +0000)]
zebra: more dbzing

Revert to the previous <= restrictions, improve error messages, fix the
divide by zero.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospfd: correct typo in zebra trace
Chirag Shah [Wed, 14 Jun 2017 20:30:08 +0000 (13:30 -0700)]
ospfd: correct typo in zebra trace

added comment around which bw value used.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agozebra: fix divide-by-zero
Quentin Young [Wed, 14 Jun 2017 14:06:01 +0000 (14:06 +0000)]
zebra: fix divide-by-zero

x % 0 = FPE

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #712 from opensourcerouting/fix-issue-683
Donald Sharp [Wed, 14 Jun 2017 10:51:06 +0000 (06:51 -0400)]
Merge pull request #712 from opensourcerouting/fix-issue-683

Fix srcdest blackhole routes

7 years agozebra: fix ipv6 route command description strings
Christian Franke [Wed, 14 Jun 2017 07:23:40 +0000 (09:23 +0200)]
zebra: fix ipv6 route command description strings

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agozebra: pass srcdest information also when creating blackhole routes
Christian Franke [Wed, 14 Jun 2017 07:23:36 +0000 (09:23 +0200)]
zebra: pass srcdest information also when creating blackhole routes

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agoldpd: fix issues with dual-stack adjacencies
Renato Westphal [Tue, 13 Jun 2017 13:32:24 +0000 (10:32 -0300)]
ldpd: fix issues with dual-stack adjacencies

Handling configuration changes from single-stack mode to dual-stack mode
(and vice-versa) is tricky. This patch attempts to solve all issues that
might happen on such circumstances.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #681 (ASAN warnings)
David Lamparter [Tue, 13 Jun 2017 15:16:24 +0000 (17:16 +0200)]
Merge pull request #681 (ASAN warnings)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: ospf bandwidth handling
Chirag Shah [Mon, 12 Jun 2017 20:17:28 +0000 (13:17 -0700)]
ospfd: ospf bandwidth handling

Handle proper indent and insert missing not statement.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agoospfd: ospf bandwidth handling
Chirag Shah [Mon, 12 Jun 2017 16:53:21 +0000 (09:53 -0700)]
ospfd: ospf bandwidth handling

if bandwidth is not set from Zebra use speed as bandwidth
for ospf route.

Testing Done:
Verfied over bond which has aggregated speed of all member interfaces,
cost is reflected in ospf route and ip route.
Manually changed interface bandwidth which replaces speed as bw, instead
uses cli entered value as bw, verifid output of ospf route and ip route.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agoisisd: fix heap uaf, round 2
Quentin Young [Fri, 9 Jun 2017 14:53:11 +0000 (14:53 +0000)]
isisd: fix heap uaf, round 2

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #688 from opensourcerouting/openbsd-mpls-fixes
Donald Sharp [Wed, 7 Jun 2017 14:19:53 +0000 (10:19 -0400)]
Merge pull request #688 from opensourcerouting/openbsd-mpls-fixes

Small fixes for OpenBSD

7 years agodoc: update build instructions for openbsd
Renato Westphal [Wed, 7 Jun 2017 13:00:34 +0000 (10:00 -0300)]
doc: update build instructions for openbsd

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: fix uninstallation of mpls lsps in openbsd
Renato Westphal [Wed, 7 Jun 2017 12:53:15 +0000 (09:53 -0300)]
zebra: fix uninstallation of mpls lsps in openbsd

While here, fix a warning in kernel_lsp_cmd().

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: remove pledge calls
Renato Westphal [Wed, 7 Jun 2017 00:24:02 +0000 (21:24 -0300)]
ldpd: remove pledge calls

In OpenBSD pledge is a mitigation mechanism used to restrict the syscalls
a program can use, enforcing its correct behavior.

In this port of OpenBSD's ldpd(8), it's hard to run under the same
tight pledge promises because of libfrr and additional components we
introduced, like a zclient in lde. Since ldpd is already privsep'ed,
removing the pledge calls shouldn't be a big compromise security-wise.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #686 from opensourcerouting/redhat-3.0-nhrp
Donald Sharp [Wed, 7 Jun 2017 12:57:18 +0000 (08:57 -0400)]
Merge pull request #686 from opensourcerouting/redhat-3.0-nhrp

Redhat: Add remaining NHRP modifications to match 2.0 and master branch

7 years agoRedhat: Add remaining NHRP modifications to match 2.0 and master branch
Martin Winter [Tue, 6 Jun 2017 22:23:05 +0000 (15:23 -0700)]
Redhat: Add remaining NHRP modifications to match 2.0 and master branch

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoisisd: fix heap uaf
Quentin Young [Tue, 6 Jun 2017 17:53:48 +0000 (17:53 +0000)]
isisd: fix heap uaf

Fix #671

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agozebra: fix misc zebra leaks
Quentin Young [Tue, 6 Jun 2017 16:19:17 +0000 (16:19 +0000)]
zebra: fix misc zebra leaks

Fix #669

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #684 from donaldsharp/redhat_3.0
Martin Winter [Wed, 7 Jun 2017 00:35:27 +0000 (17:35 -0700)]
Merge pull request #684 from donaldsharp/redhat_3.0

Redhat 3.0

7 years agoredhat: Fix changelog to be in correct format and order
Martin Winter [Tue, 6 Jun 2017 22:03:54 +0000 (15:03 -0700)]
redhat: Fix changelog to be in correct format and order

7 years agoredhat: Fix missing packages in requirements section of README
Martin Winter [Mon, 22 May 2017 11:08:44 +0000 (04:08 -0700)]
redhat: Fix missing packages in requirements section of README

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Disallow reload function for unsupported systems
Martin Winter [Mon, 22 May 2017 11:07:22 +0000 (04:07 -0700)]
redhat: Disallow reload function for unsupported systems

Before the change, a reload triggered a restart if the python reload script wasn't installed or for non-integrated configs
With this change, the reload is rejected with an error in this case (and suggests the installation of the python script package)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: fix previous merge. initsystem detection should now work for mock builds...
Martin Winter [Mon, 22 May 2017 11:04:35 +0000 (04:04 -0700)]
redhat: fix previous merge. initsystem detection should now work for mock builds and native builds on systemd based systems

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: use %initsystem check that works when chrooted
smccroskey [Fri, 28 Apr 2017 02:39:24 +0000 (19:39 -0700)]
redhat: use %initsystem check that works when chrooted

`systemctl' returns different, non-useful output while in a chroot.
Switch to checking if /sbin/init is a symlink to the systemd binary.
With this change the build works in a mock chroot.

Signed-off-by: Silas McCroskey <smccroskey@cumulusnetworks.com>
7 years agoredhat: fix README for rpm package build
Martin Winter [Thu, 20 Apr 2017 01:45:03 +0000 (18:45 -0700)]
redhat: fix README for rpm package build

- correct requirements
- add comment on bison 2.7 installation on CentOS 6

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: redirect reload function in frr init script to restart if reload script is...
Martin Winter [Thu, 20 Apr 2017 01:41:45 +0000 (18:41 -0700)]
redhat: redirect reload function in frr init script to restart if reload script is not installed (fixes systemctl restart)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: fix duplicate Requires: line in spec file
Martin Winter [Thu, 20 Apr 2017 01:39:49 +0000 (18:39 -0700)]
redhat: fix duplicate Requires: line in spec file

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Fix BuildRequires for FRR/2.0 and duplicate /etc/frr/daemons
Martin Winter [Thu, 20 Apr 2017 01:12:10 +0000 (18:12 -0700)]
redhat: Fix BuildRequires for FRR/2.0 and duplicate /etc/frr/daemons

- add make & gcc
- remove autoconf and automake (not needed to build from src.rpm)
- fix texi2html version detection for case when no texi2html is installed (broke yum-builddep)
- fix duplicate listing of /etc/frr/daemons

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Update documentation for RPM build and usage
Martin Winter [Tue, 18 Apr 2017 01:45:50 +0000 (18:45 -0700)]
redhat: Update documentation for RPM build and usage

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: fix upgrade script (%postun), remove invalid mpls package selection (it's...
Martin Winter [Tue, 18 Apr 2017 01:34:32 +0000 (18:34 -0700)]
redhat: fix upgrade script (%postun), remove invalid mpls package selection (it's always built and auto detected), add ldpd

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Add frr.service file for redhat based systemd systems (using init script)
Martin Winter [Tue, 18 Apr 2017 01:17:16 +0000 (18:17 -0700)]
redhat: Add frr.service file for redhat based systemd systems (using init script)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: /etc/frr/daemons needs to be marked as no replace config to be save from...
Martin Winter [Sat, 15 Apr 2017 10:29:34 +0000 (03:29 -0700)]
redhat: /etc/frr/daemons needs to be marked as no replace config to be save from overwriting

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Add (combined) init.d script for FRR with daemon selection based on /etc...
Martin Winter [Sat, 15 Apr 2017 10:13:07 +0000 (03:13 -0700)]
redhat: Add (combined) init.d script for FRR with daemon selection based on /etc/frr/daemons

- Provide new frr init script
- Remove separate per-deamon init.d scripts

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agowatchfrr: Remove the HAVE_CUMULUS around the watchfrr.started file. It's always useful
Martin Winter [Sat, 15 Apr 2017 09:00:15 +0000 (02:00 -0700)]
watchfrr: Remove the HAVE_CUMULUS around the watchfrr.started file. It's always useful

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Add python2 build requirement to pythontools sub package
Martin Winter [Fri, 14 Apr 2017 09:21:44 +0000 (02:21 -0700)]
redhat: Add python2 build requirement to pythontools sub package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Fix previously added centos6/redhat6 check
Martin Winter [Fri, 14 Apr 2017 09:20:31 +0000 (02:20 -0700)]
redhat: Fix previously added centos6/redhat6 check

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Fix install (daemon selection) and make postun scripts compatible with fedora
Martin Winter [Fri, 14 Apr 2017 08:28:13 +0000 (01:28 -0700)]
redhat: Fix install (daemon selection) and make postun scripts compatible with fedora

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Always disable PIMd on CentOS 6 and RedHat 6 systems as they are too old...
Martin Winter [Fri, 14 Apr 2017 01:54:58 +0000 (18:54 -0700)]
redhat: Always disable PIMd on CentOS 6 and RedHat 6 systems as they are too old to correctly support the protocol

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Move frr-reload python script to it's own sub package to avoid the python2...
Martin Winter [Fri, 14 Apr 2017 00:34:26 +0000 (17:34 -0700)]
redhat: Move frr-reload python script to it's own sub package to avoid the python2 requirement for main frr package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Don't set file attributes for symlinks
Martin Winter [Fri, 14 Apr 2017 00:33:24 +0000 (17:33 -0700)]
redhat: Don't set file attributes for symlinks

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Fix ospf6d typo in frr.spec.in
Martin Winter [Thu, 13 Apr 2017 22:00:16 +0000 (15:00 -0700)]
redhat: Fix ospf6d typo in frr.spec.in

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Fix dependencies for rpm package
Martin Winter [Thu, 13 Apr 2017 03:23:18 +0000 (20:23 -0700)]
redhat: Fix dependencies for rpm package

- Add bison, flex & autoconf
- Remove systemd for systems without it (i.e. CentOS 6)
- Update doc to reflect dependencies

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Remove tab's with spaces in frr.spec.in to make it better readable
Martin Winter [Thu, 13 Apr 2017 02:10:35 +0000 (19:10 -0700)]
redhat: Remove tab's with spaces in frr.spec.in to make it better readable

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: Replace tab's with spaces in README
Martin Winter [Thu, 13 Apr 2017 01:54:40 +0000 (18:54 -0700)]
redhat: Replace tab's with spaces in README

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoripngd: fix packet buffer memleak
Quentin Young [Tue, 6 Jun 2017 15:47:49 +0000 (15:47 +0000)]
ripngd: fix packet buffer memleak

Fix #668

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospf6d: fix heap uaf
Quentin Young [Tue, 6 Jun 2017 15:47:09 +0000 (15:47 +0000)]
ospf6d: fix heap uaf

Fix #667

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospfd: fix stack underflow
Quentin Young [Tue, 6 Jun 2017 15:36:00 +0000 (15:36 +0000)]
ospfd: fix stack underflow

Fix #666

}:-)

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge branch 'frr/pull/672' into stable/3.0
David Lamparter [Tue, 6 Jun 2017 14:47:48 +0000 (16:47 +0200)]
Merge branch 'frr/pull/672' into stable/3.0

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #675 from opensourcerouting/ldpd-cherry-picks
Donald Sharp [Tue, 6 Jun 2017 12:24:47 +0000 (08:24 -0400)]
Merge pull request #675 from opensourcerouting/ldpd-cherry-picks

ldpd: cherry-pick fixes from master to stable/3.0

7 years agoldpd: fix bug in pseudowire control-word negotiation
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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix issues detected by Coverity Scan
Renato Westphal [Thu, 27 Apr 2017 11:56:15 +0000 (08:56 -0300)]
ldpd: fix issues detected by Coverity Scan

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix bug when changing the transport address
Renato Westphal [Sat, 22 Apr 2017 15:03:14 +0000 (12:03 -0300)]
ldpd: fix bug when changing the transport address

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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: allow targeted neighbors over any interface
Renato Westphal [Sat, 22 Apr 2017 13:55:27 +0000 (10:55 -0300)]
ldpd: allow targeted neighbors over any interface

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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: schedule the sending of label messages when necessary
Renato Westphal [Sat, 22 Apr 2017 01:10:42 +0000 (22:10 -0300)]
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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: improve ldp_zebra_read_route()
Renato Westphal [Fri, 21 Apr 2017 22:39:11 +0000 (19:39 -0300)]
ldpd: improve ldp_zebra_read_route()

Log deleted routes and simplify the code a bit.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: be more conservative with labels
Renato Westphal [Fri, 21 Apr 2017 18:41:14 +0000 (15:41 -0300)]
ldpd: be more conservative with labels

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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: accept notifications during the session establishment process
Renato Westphal [Wed, 19 Apr 2017 22:31:19 +0000 (19:31 -0300)]
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).

Regression introduced by commit 8819fc3.

Fixes the following ANVL LDP regressions: 6.19 and 6.21.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: minor changes in the output of some show commands
Renato Westphal [Wed, 19 Apr 2017 20:12:35 +0000 (17:12 -0300)]
ldpd: minor changes in the output of some show commands

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: use synchronous channels for sending log messages
Renato Westphal [Wed, 19 Apr 2017 19:59:50 +0000 (16:59 -0300)]
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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: remove unnecessary checks if a signal was caught
Renato Westphal [Wed, 19 Apr 2017 18:28:43 +0000 (15:28 -0300)]
ldpd: remove unnecessary checks if a signal was caught

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix segfault after failed initialization
Renato Westphal [Wed, 19 Apr 2017 18:15:56 +0000 (15:15 -0300)]
ldpd: fix segfault after failed initialization

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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: simplify initialization of the child processes
Renato Westphal [Wed, 19 Apr 2017 01:03:35 +0000 (22:03 -0300)]
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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Conflicts:
ldpd/ldpd.c
ldpd/ldpd.h

7 years agoldpd: call openzlog() in the child processes as well
Renato Westphal [Tue, 18 Apr 2017 15:17:30 +0000 (12:17 -0300)]
ldpd: call openzlog() in the child processes as well

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix log level of log_warn() and log_warnx()
Renato Westphal [Tue, 18 Apr 2017 15:14:15 +0000 (12:14 -0300)]
ldpd: fix log level of log_warn() and log_warnx()

The log_warn() and log_warnx() functions indicate non-critical warnings
and errors, so use LOG_ERR instead of LOG_CRIT.

Keep using LOG_CRIT only in fatal() and fatalx() since these functions
indicate critical errors (when the program needs to exit).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: split log.c into two files
Renato Westphal [Tue, 18 Apr 2017 15:04:44 +0000 (12:04 -0300)]
ldpd: split log.c into two files

This is basically to keep in sync with OpenBSD's ldpd(8) where the same
change was done.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: fix segfault with some show commands
Renato Westphal [Tue, 30 May 2017 11:30:57 +0000 (08:30 -0300)]
bgpd: fix segfault with some show commands

The following commands were causing bgpd to crash when vpnv4/vpnv6 static
routes are configured:

bgpd aborted: vtysh  -c "show ip bgp view all ipv4 vpn json"
bgpd aborted: vtysh  -c "show ip bgp view all ipv4 vpn"
bgpd aborted: vtysh  -c "show ip bgp view all ipv6 vpn json"
bgpd aborted: vtysh  -c "show ip bgp view all ipv6 vpn"
bgpd aborted: vtysh  -c "show ip bgp vrf all ipv4 vpn json"
bgpd aborted: vtysh  -c "show ip bgp vrf all ipv4 vpn"
bgpd aborted: vtysh  -c "show ip bgp vrf all ipv6 vpn json"
bgpd aborted: vtysh  -c "show ip bgp vrf all ipv6 vpn"
bgpd aborted: vtysh  -c "show bgp view all ipv4 vpn json"
bgpd aborted: vtysh  -c "show bgp view all ipv4 vpn"
bgpd aborted: vtysh  -c "show bgp view all ipv6 vpn json"
bgpd aborted: vtysh  -c "show bgp view all ipv6 vpn"
bgpd aborted: vtysh  -c "show bgp vrf all ipv4 vpn json"
bgpd aborted: vtysh  -c "show bgp vrf all ipv4 vpn"
bgpd aborted: vtysh  -c "show bgp vrf all ipv6 vpn json"
bgpd aborted: vtysh  -c "show bgp vrf all ipv6 vpn"

Problem found with the CLI fuzzer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: fix addpath buffer overrun
Quentin Young [Fri, 2 Jun 2017 20:53:37 +0000 (20:53 +0000)]
bgpd: fix addpath buffer overrun

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospf6d: fix filter-list commands
Quentin Young [Fri, 2 Jun 2017 21:20:33 +0000 (21:20 +0000)]
ospf6d: fix filter-list commands

incorrect indexes resulted in use of area id as the name of the prefix
list

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd: fix large-community-list commands
Quentin Young [Fri, 2 Jun 2017 21:48:01 +0000 (21:48 +0000)]
bgpd: fix large-community-list commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospfd: fix 'show ip ospf interface json'
Quentin Young [Fri, 2 Jun 2017 19:10:03 +0000 (19:10 +0000)]
ospfd: fix 'show ip ospf interface json'

json obj not recreated for each interface

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospfd: shufflin
Quentin Young [Wed, 31 May 2017 19:04:53 +0000 (19:04 +0000)]
ospfd: shufflin

move virtual-link command down to be next to its no form

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospfd: fix virtual-link timers commands
Quentin Young [Wed, 31 May 2017 19:00:39 +0000 (19:00 +0000)]
ospfd: fix virtual-link timers commands

Use {} semantics, correct docstrings, switchup parsing.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agorelease: frr-3.0-rc0 frr-3.0-rc0
David Lamparter [Thu, 1 Jun 2017 17:23:00 +0000 (19:23 +0200)]
release: frr-3.0-rc0

7 years agovtysh: Add back some missing bgp commands
Donald Sharp [Thu, 25 May 2017 17:53:50 +0000 (13:53 -0400)]
vtysh: Add back some missing bgp commands

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #583 from chiragshah6/pim_dev_3_0
Jafar Al-Gharaibeh [Mon, 29 May 2017 18:37:26 +0000 (12:37 -0600)]
Merge pull request #583 from chiragshah6/pim_dev_3_0

pimd: Fix to Transmit S,G Join when transitioning from SGRpt to Join state

7 years agoMerge pull request #622 from Jafaral/vtysh-no-user
Donald Sharp [Fri, 26 May 2017 19:03:59 +0000 (15:03 -0400)]
Merge pull request #622 from Jafaral/vtysh-no-user

vtysh: fix a compile error when user/group are disabled

7 years agovtysh: fix a compile error when user/group are disabled
Jafar Al-Gharaibeh [Tue, 23 May 2017 18:23:04 +0000 (13:23 -0500)]
vtysh: fix a compile error when user/group are disabled

If FRR is configured explicilty with --disable-user and
--disable-group, FRR_USER and FRR_GROUP will not be defined
and can be safely skipped in vtysh.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
7 years agoMerge pull request #611 from LabNConsulting/working/3.0/patch-set/deprecateEncap
Donald Sharp [Wed, 24 May 2017 15:04:36 +0000 (11:04 -0400)]
Merge pull request #611 from LabNConsulting/working/3.0/patch-set/deprecateEncap

3.0: remove support for config & show of encap safi

7 years agobgpd: remove encap safi vty related files bgp_encap.h|c
Lou Berger [Tue, 23 May 2017 19:34:43 +0000 (15:34 -0400)]
bgpd: remove encap safi vty related files bgp_encap.h|c

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: remove encap_safi rx processing
Lou Berger [Tue, 23 May 2017 19:15:45 +0000 (15:15 -0400)]
bgpd: remove encap_safi rx processing

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: remove encap safi show commands
Lou Berger [Tue, 23 May 2017 19:11:30 +0000 (15:11 -0400)]
bgpd: remove encap safi show commands

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: remove ability to configure use of encap-safi (continue to use encap...
Lou Berger [Tue, 23 May 2017 19:02:31 +0000 (15:02 -0400)]
bgpd rfapi: remove ability to configure use of encap-safi (continue to use encap attribute)

Signed-off-by: Lou Berger <lberger@labn.net>