]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agoMerge branch '-isisd-simpl' into stable/2.0
David Lamparter [Thu, 8 Dec 2016 11:52:45 +0000 (12:52 +0100)]
Merge branch '-isisd-simpl' into stable/2.0

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd vnc: Add 'debug bgp vnc verbose' target
Lou Berger [Wed, 7 Dec 2016 20:02:55 +0000 (15:02 -0500)]
bgpd vnc: Add 'debug bgp vnc verbose' target

all vnc debug logging is now covered by a 'debug bgp vnc' target

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: always set SO_SNDBUF and SO_RCVBUF using a best effort approach
Renato Westphal [Wed, 7 Dec 2016 15:21:46 +0000 (13:21 -0200)]
*: always set SO_SNDBUF and SO_RCVBUF using a best effort approach

If we fail to set any socket's buffer size, try again with a smaller value
and keep going until it succeeds. This is better than just giving up or,
even worse, abort the creation of a socket (ospf6d and ripd).

Fix broken ospf6d on FreeBSD.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: set the OSPF socket's send buffer size only once
Renato Westphal [Wed, 7 Dec 2016 15:21:45 +0000 (13:21 -0200)]
ospfd: set the OSPF socket's send buffer size only once

This reverts commit b7fe4141, which introduced a logic where the OSPF
send buffer size was dynamically updated to reflect the maximum MTU
of the OSPF enabled interfaces (this was done to make ospfd work with
interfaces configured for jumbo frames).

Since commit a78d75b0, this is not necessary anymore because
ospf_sock_init() now sets the OSPF send buffer size to a very high value
(8MB). Also, the previous logic was broken because it didn't account
for run-time interface MTU changes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoquagga: Remove description of deprecated interfaces
Donald Sharp [Wed, 7 Dec 2016 13:34:39 +0000 (08:34 -0500)]
quagga: Remove description of deprecated interfaces

The deprecated interface section is no longer being used.
Let's remove it from the document.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoquagga: Add Debug Guard section in COMMUNITY.md
Donald Sharp [Wed, 7 Dec 2016 13:34:38 +0000 (08:34 -0500)]
quagga: Add Debug Guard section in COMMUNITY.md

Add verbiage to loosely describe how developers MUST
guard debugs put into their code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoisisd: Remove unnecessary debug
Donald Sharp [Tue, 6 Dec 2016 02:45:06 +0000 (21:45 -0500)]
isisd: Remove unnecessary debug

Remove unnecessary debug from isis write mem.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: number sections in COMMUNITY.md HTML
David Lamparter [Mon, 5 Dec 2016 18:08:00 +0000 (19:08 +0100)]
build: number sections in COMMUNITY.md HTML

adds some CSS to get section numbers.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: remove unused NS_BITMAP MTYPE
David Lamparter [Mon, 5 Dec 2016 15:34:15 +0000 (16:34 +0100)]
lib: remove unused NS_BITMAP MTYPE

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch '-rip' into stable/2.0
David Lamparter [Mon, 5 Dec 2016 15:25:58 +0000 (16:25 +0100)]
Merge branch '-rip' into stable/2.0

This fixes up a lot of RIP/RIPng compliance tests that were still
flagged up.

Tested-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoMerge branch '-renato' into stable/2.0
David Lamparter [Mon, 5 Dec 2016 15:22:16 +0000 (16:22 +0100)]
Merge branch '-renato' into stable/2.0

This contains bgp memory leak fixes as well as cleanups to VRF/namespace
handling and has been run through extended testing in Cumulus' testbed:

Tested-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, zebra: Minimize display of link-params sub data
Donald Sharp [Thu, 1 Dec 2016 15:49:22 +0000 (10:49 -0500)]
lib, zebra: Minimize display of link-params sub data

When link-params is configured it auto starts displaying
6000-02# conf t
dell-s6000-02(config)# int swp1
dell-s6000-02(config-if)# link-params
dell-s6000-02(config-link-params)# admin-grp 0x12345678
dell-s6000-02(config-link-params)# end
dell-s6000-02# show run

interface swp1
 link-params
  enable
  metric 0              <----Remove the bw lines
  max-bw 1.25e+06
  max-rsv-bw 1.25e+06
  unrsv-bw 0 1.25e+06
  unrsv-bw 1 1.25e+06
  unrsv-bw 2 1.25e+06
  unrsv-bw 3 1.25e+06
  unrsv-bw 4 1.25e+06
  unrsv-bw 5 1.25e+06
  unrsv-bw 6 1.25e+06
  unrsv-bw 7 1.25e+06
  admin-grp 305419896
  exit-link-params
!

I'd like to reduce this to:

interface enp0s3
 ip igmp
 ip pim sm
 link-params
  enable
  admin-grp 0x12345678    <----- Fix this to be what we entered
  exit-link-params
!

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: Remove nexthop for peer only for "real" peer
vivek [Sun, 4 Dec 2016 02:51:49 +0000 (21:51 -0500)]
bgpd: Remove nexthop for peer only for "real" peer

During connection establishment, there is a separate peer structure created
for the doppelganger (for incoming connection). When this is deleted after
the connection has established, take care to ensure that the nexthop entry
for the peer is not deleted.

Fixes: f9164b1d74f6a20d69d7ef10d2e39b4ae7996cbf
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-13875
Reviewed By: None
Testing Done: Manual

(cherry picked from commit 4f2bc892cbddbf36bd5e1b2f36c33260af614b33)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agodoc: update README to mention PIM-SSM and LDP support
Renato Westphal [Sat, 3 Dec 2016 23:35:23 +0000 (21:35 -0200)]
doc: update README to mention PIM-SSM and LDP support

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: Fix 'show ip bgp' to not change it's output
Donald Sharp [Fri, 2 Dec 2016 18:57:04 +0000 (13:57 -0500)]
bgpd: Fix 'show ip bgp' to not change it's output

For unicast routes do not change the output of the 'show ip bgp' command.

This will allow people with existing scripts to continue to work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: Fix route node unlock when clearing adj-out
vivek [Fri, 2 Dec 2016 13:22:21 +0000 (08:22 -0500)]
bgpd: Fix route node unlock when clearing adj-out

When clearing the adj-out for a subgroup (e.g., upon peer going down),
ensure that the adj-out is removed before unlocking the route node that
it points to, otherwise, there is a possibility that the route node may
be prematurely freed.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-13690
Reviewed By: None
Testing Done: bgp-smoke, resilient-hash tests

(cherry picked from commit c3d7d35f3b7152c9e50e52c3cfd60b0dc52df703)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: Fix json Crash with inactive timer
Donald Sharp [Fri, 2 Dec 2016 13:19:26 +0000 (08:19 -0500)]
ospfd: Fix json Crash with inactive timer

When nbr->t_inactivity is not active, and
you do a show json over the neighbor it
will crash ospfd.  Fix the code so it
prints out -1 when the timer is inactive.

Ticket:CM-13835
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
(cherry picked from commit 78d8fcb9623ab4d9cebf6187a451448e056a84bf)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: replace MIT license with ISC
David Lamparter [Thu, 1 Dec 2016 16:18:57 +0000 (17:18 +0100)]
lib: replace MIT license with ISC

Since other parts (e.g. ldpd) use the ISC license, and the ISC license
is just a simplified form of the MIT license, just move things over and
reduce the number of different licenses we have in use here.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: COMMUNITY.md: add git branch diagram
David Lamparter [Thu, 1 Dec 2016 16:16:24 +0000 (17:16 +0100)]
build: COMMUNITY.md: add git branch diagram

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: check ZEBRA_IFC_REAL on if_up
Christian Franke [Mon, 7 Nov 2016 12:37:25 +0000 (13:37 +0100)]
zebra: check ZEBRA_IFC_REAL on if_up

Only connected routes which have ZEBRA_IFC_REAL set should
be redistributed.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: fix invalid memory access in peer_free()
Renato Westphal [Mon, 28 Nov 2016 18:47:13 +0000 (16:47 -0200)]
bgpd: fix invalid memory access in peer_free()

We shoult not call bgp_unlock() before calling
bgp_delete_connected_nexthop() in the peer_free() function. Otherwise,
if bgp->lock reaches zero, bgp_free() is called and peer->bgp becomes
an invalid pointer in the bgp_delete_connected_nexthop() function.

To fix this, move the call to bgp_unlock() to the end of peer_free().

Bug exposed by commit 37d361e ("bgpd: plug several memleaks").

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: Fix crashes when no default bgp instance is configured.
Donald Sharp [Thu, 1 Dec 2016 14:11:12 +0000 (09:11 -0500)]
bgpd: Fix crashes when no default bgp instance is configured.

The vnc code assumes that bgp must have a default instance.
This code change checks to make sure that we do before
proceeding.  It makes no assurances that vnc will behave
correctly without a default instance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agopimd: Fix large integer display of drpriority
Donald Sharp [Wed, 30 Nov 2016 13:23:12 +0000 (08:23 -0500)]
pimd: Fix large integer display of drpriority

When displaying drpriority you can enter unsigned
integer values from 1-2^32.  The display was
turning the unsigned value into a signed value
and thus we were displaying the wrong value.

Ticket: CM-13787
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: David Ahern <dsa@cumulusnetworks.com>
(cherry picked from commit db17265f1025e3ec578998ad537c33b49ed33cde)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: Fix memory leak when not using json
Donald Sharp [Wed, 30 Nov 2016 13:23:11 +0000 (08:23 -0500)]
ospfd: Fix memory leak when not using json

When doing a show command under ospf, if
not using json we would have a small memory
leak in show_ip_ospf_common.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 50750712b1ac8364e290c67782eaf371025dc59e)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: drop TODO from redhat/quagga.spec.in
David Lamparter [Tue, 29 Nov 2016 19:31:43 +0000 (20:31 +0100)]
build: drop TODO from redhat/quagga.spec.in

Fixes: 955026c8... "build: ditch outdated documents, including HACKING"
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: fix "show ip bgp" column alignment
Daniel Walton [Tue, 29 Nov 2016 17:47:12 +0000 (12:47 -0500)]
bgpd: fix "show ip bgp" column alignment

The "Weight" column is off:

BGP table version is 0, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, =
multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 4.1.1.2/32       9.9.9.2                  0          32768 ?
*> 4.1.1.4/32       9.9.9.2                  0          32768 ?
Displayed  2 out of 2 total prefixes

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 65c7395b07e8c592c847d4a1e22fc89ddf448341)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: "ip ospf bfd" removes the "ip ospf bfd 3 250 250" command
Daniel Walton [Tue, 29 Nov 2016 17:47:11 +0000 (12:47 -0500)]
ospfd: "ip ospf bfd" removes the "ip ospf bfd 3 250 250" command

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-13712
(cherry picked from commit 367b138748e894bbfaae36d1cf7c90eafebfebc9)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: improve COMMUNITY.md formatting
David Lamparter [Tue, 29 Nov 2016 09:44:17 +0000 (10:44 +0100)]
build: improve COMMUNITY.md formatting

Add a render_md.py helper to convert it to HTML (needs python "markdown"
module installed).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoisisd: create the isis_circuit_prepare() helper function
Renato Westphal [Mon, 28 Nov 2016 20:55:01 +0000 (18:55 -0200)]
isisd: create the isis_circuit_prepare() helper function

This reduces code duplication and the likelihood of a bug like 186534
("isisd: fix loss of packets after circuit is brought up") to happen
again.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoisisd: use a smaller #ifdef for isis_receive()
Renato Westphal [Mon, 28 Nov 2016 20:35:36 +0000 (18:35 -0200)]
isisd: use a smaller #ifdef for isis_receive()

There's no need to provide two definitions of the isis_receive()
function (one for GNU_LINUX and the other for !GNU_LINUX). Both differ
only slightly so it makes more sense to define isis_receive() just once
and use a smaller #ifdef to account for these differences. This improves
code readability.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: fix invalid memory access in peer_free()
Renato Westphal [Mon, 28 Nov 2016 17:00:05 +0000 (15:00 -0200)]
bgpd: fix invalid memory access in peer_free()

We shoult not call bgp_unlock() before calling
bgp_delete_connected_nexthop() in the peer_free() function. Otherwise,
if bgp->lock reaches zero, bgp_free() is called and peer->bgp becomes
an invalid pointer in the bgp_delete_connected_nexthop() function.

To fix this, move the call to bgp_unlock() to the end of peer_free().

Bug exposed by commit 37d361e ("bgpd: plug several memleaks").

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobuild: add markdown-ised version of new guidelines
David Lamparter [Mon, 28 Nov 2016 18:25:21 +0000 (19:25 +0100)]
build: add markdown-ised version of new guidelines

This isn't quite done and renders rather badly on markdown_py.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: plug more memory leaks
Renato Westphal [Mon, 31 Oct 2016 17:15:16 +0000 (15:15 -0200)]
zebra: plug more memory leaks

Try to free all memory explicitly on exit. This should help to detect
new memory leaks in the future with tools like valgrind.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: loop through all static routes on vrf enable/disable
Renato Westphal [Tue, 1 Nov 2016 09:57:39 +0000 (07:57 -0200)]
zebra: loop through all static routes on vrf enable/disable

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra/lib: remove redundant fields from zebra_vrf
Renato Westphal [Sun, 30 Oct 2016 21:50:26 +0000 (19:50 -0200)]
zebra/lib: remove redundant fields from zebra_vrf

There's no need to duplicate the 'vrf_id' and 'name' fields from the 'vrf'
structure into the 'zebra_vrf' structure. Instead of that, add a back
pointer in 'zebra_vrf' that should point to the associated 'vrf' structure.

Additionally, modify the vrf callbacks to pass the whole vrf structure
as a parameter. This allow us to make further simplifications in the code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib/zebra: put vrf_get() on a diet
Renato Westphal [Sun, 30 Oct 2016 00:44:06 +0000 (22:44 -0200)]
lib/zebra: put vrf_get() on a diet

Also, for some reason we had two functions to search a VRF by its name:
zebra_vrf_lookup_by_name() and zebra_vrf_list_lookup_by_name().  The first
one would loop through vrf_table and the other one through vrf_list. This
is not necessary anymore, so remove zebra_vrf_lookup_by_name() and rename
zebra_vrf_list_lookup_by_name() to zebra_vrf_lookup_by_name().

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: order VRFs by name on user output
Renato Westphal [Sat, 29 Oct 2016 22:44:04 +0000 (20:44 -0200)]
zebra: order VRFs by name on user output

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib/zebra: convert vrf_list to a red-black tree
Renato Westphal [Sat, 29 Oct 2016 22:30:57 +0000 (20:30 -0200)]
lib/zebra: convert vrf_list to a red-black tree

Since we're already using a red-black tree to store VRFs sorted by their
vrf_id's, create a new tree to store VRFs sorted by their names.

The biggest advantage of doing this is that we reduce the time complexity
of vrf_list_lookup_by_name() from O(n) to O(log n).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: rename two vrf functions
Renato Westphal [Wed, 2 Nov 2016 14:16:58 +0000 (12:16 -0200)]
*: rename two vrf functions

Since VRFs can be searched by vrf_id or name, make this explicit in the
helper functions.

s/vrf_lookup/vrf_lookup_by_id/
s/zebra_vrf_lookup/zebra_vrf_lookup_by_id/

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: convert vrf code to use red-black trees as well
Renato Westphal [Sat, 29 Oct 2016 16:37:11 +0000 (14:37 -0200)]
lib: convert vrf code to use red-black trees as well

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: convert namespace code to use red-black trees
Renato Westphal [Sat, 29 Oct 2016 01:03:35 +0000 (23:03 -0200)]
lib: convert namespace code to use red-black trees

We definitely need to stop abusing the route table data structure when
it's not necessary.  Convert the namespace code to use red-black trees
instead. This greatly improves code readability.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: nuke zvrf_list and always use vrf_list instead
Renato Westphal [Sat, 29 Oct 2016 00:26:04 +0000 (22:26 -0200)]
zebra: nuke zvrf_list and always use vrf_list instead

zvrf_list doesn't need to exist, it's basically a duplicate version
of vrf_list.

Also, zebra_vrf_delete() wasn't removing zvrf from zvrf_list, which was
a bug.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: fix creation of pre-provisioned VRFs
Renato Westphal [Fri, 28 Oct 2016 18:53:38 +0000 (16:53 -0200)]
lib: fix creation of pre-provisioned VRFs

If we configure a VRF that doesn't match any device in the kernel, we'll
fall in the first case of the vrf_get() function. In this function,
a vrf structure is callocated and it's vrf_id is never set explicitly,
which means it's set to zero (the vrf-id of the default VRF). When this
happens, commands like "router-id A.B.C.D vrf ..." will act on the
default VRF and not on the pre-provisioned VRF.  To fix this, always
set the vrf_id of pre-provisioned VRFs to VRF_UNKNOWN.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra/lib: move some code around
Renato Westphal [Sat, 29 Oct 2016 00:32:07 +0000 (22:32 -0200)]
zebra/lib: move some code around

* move netlink code from zebra_nc.c to kernel_netlink.c;
* move vrf CLI commands from if.c/interface.c to vrf.c/zebra_vrf.c;
* move declaration of the 'ns' structure to a header file.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: remove unused ns code
Renato Westphal [Wed, 26 Oct 2016 14:58:32 +0000 (12:58 -0200)]
lib: remove unused ns code

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra/lib: plug several memleaks
Renato Westphal [Tue, 1 Nov 2016 20:57:53 +0000 (18:57 -0200)]
zebra/lib: plug several memleaks

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: release all memory explicitly on exit
Renato Westphal [Tue, 25 Oct 2016 02:04:24 +0000 (00:04 -0200)]
bgpd: release all memory explicitly on exit

7 years agobgpd: plug several memleaks
Renato Westphal [Fri, 21 Oct 2016 22:13:51 +0000 (20:13 -0200)]
bgpd: plug several memleaks

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: reuse sockunion2hostprefix() on bgp_nht.c
Renato Westphal [Wed, 2 Nov 2016 02:29:46 +0000 (00:29 -0200)]
bgpd: reuse sockunion2hostprefix() on bgp_nht.c

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: optimize copy of strings on peer_xfer_conn()
Renato Westphal [Tue, 1 Nov 2016 09:37:50 +0000 (07:37 -0200)]
bgpd: optimize copy of strings on peer_xfer_conn()

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: use loops to reduce code duplication
Renato Westphal [Mon, 24 Oct 2016 23:53:37 +0000 (21:53 -0200)]
bgpd: use loops to reduce code duplication

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobuild: ditch outdated documents, including HACKING
David Lamparter [Mon, 28 Nov 2016 18:03:10 +0000 (19:03 +0100)]
build: ditch outdated documents, including HACKING

To be re-added with a clean slate.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: bump version to 2.0-rc0
David Lamparter [Mon, 28 Nov 2016 17:58:52 +0000 (18:58 +0100)]
build: bump version to 2.0-rc0

This isn't quite a release candidate yet, but to get things going let's
set this to "2.0-rc0".

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'cmaster-next-isisd-bpf' into cmaster-next-releng
David Lamparter [Mon, 28 Nov 2016 16:36:04 +0000 (17:36 +0100)]
Merge branch 'cmaster-next-isisd-bpf' into cmaster-next-releng

7 years agoMerge remote-tracking branch 'cmaster-next' into cmaster-next-releng
David Lamparter [Mon, 28 Nov 2016 16:35:08 +0000 (17:35 +0100)]
Merge remote-tracking branch 'cmaster-next' into cmaster-next-releng

7 years agozebra: add missing license headers to two files
Renato Westphal [Mon, 21 Nov 2016 21:24:09 +0000 (19:24 -0200)]
zebra: add missing license headers to two files

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripngd: fix drop of multicast membership when the interface is down
Renato Westphal [Fri, 18 Nov 2016 17:39:25 +0000 (15:39 -0200)]
ripngd: fix drop of multicast membership when the interface is down

When an interface is shut down, ripng_multicast_leave() is called after
ifp->flags is updated in ripng_interface_down(). So we shouldn't check
if the interface is up in order to proceed with the membership drop.

For consistency's sake, don't check for if_is_up() in
ripng_multicast_join() as well. In this case, this function is only
called when the interface is up, so the check was unnecessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripngd: implement the "clear ipv6 ripng" vty command
Renato Westphal [Thu, 17 Nov 2016 18:33:09 +0000 (16:33 -0200)]
ripngd: implement the "clear ipv6 ripng" vty command

This command deletes all received routes from the RIPng routing table. It
should be used with caution as it can create black holes in the network
(until it reconverges). Very useful to make automated testing (e.g. ANVL)
more predictable.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripngd: implement optional heuristic suggested by RFC 2080
Renato Westphal [Wed, 16 Nov 2016 18:14:45 +0000 (16:14 -0200)]
ripngd: implement optional heuristic suggested by RFC 2080

RFC 2080 - Section 2.4.2:
"If the new metric is the same as the old one, examine the timeout for the
existing route.  If it is at least halfway to the expiration point, switch
to the new route.  This heuristic is optional, but highly recommended".

Implement this optional heuristic only when ECMP is disabled globally ("no
allow-ecmp"), otherwise all routes with the same metric should be used.

Fixes IxANVL RIPng test 7.21.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd: minor code simplification
Renato Westphal [Sat, 12 Nov 2016 21:34:37 +0000 (19:34 -0200)]
ripd: minor code simplification

* Simplify the RIP_TIMER_OFF macro and use it on more places;
* Be more explicit when creating the RIP UDP socket - cosmetic change
  since socket(AF_INET,SOCK_DGRAM,0) defaults to UDP on every known
  UNIX/Linux platform.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd: make use of the IP_MULTICAST_LOOP sockoption
Renato Westphal [Sat, 12 Nov 2016 21:11:13 +0000 (19:11 -0200)]
ripd: make use of the IP_MULTICAST_LOOP sockoption

We still need to check for self-generated packets on rip_read() because
ripd may also send broadcast packets. But using IP_MULTICAST_LOOP on the
ripd socket will at least prevent us from receiving a lot unnecessary
multicast packets when RIPv2 is being used, thus improving performance.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: create a helper function to set the IP_MULTICAST_LOOP sockoption
Renato Westphal [Sat, 12 Nov 2016 21:05:08 +0000 (19:05 -0200)]
*: create a helper function to set the IP_MULTICAST_LOOP sockoption

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agopimd/zebra: fix setting of IP_MULTICAST_LOOP on OpenBSD
Renato Westphal [Sat, 12 Nov 2016 20:39:51 +0000 (18:39 -0200)]
pimd/zebra: fix setting of IP_MULTICAST_LOOP on OpenBSD

Linux, FreeBSD and NetBSD (and possibly others too) accept both uint8_t
and int for the IP_MULTICAST_LOOP sockoption. OpenBSD, in the other hand,
accepts only uint8_t. To make setting IP_MULTICAST_LOOP work on every
supported platform, always pass a uint8_t variable as a parameter.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd: fix race condition on input processing
Renato Westphal [Fri, 11 Nov 2016 22:19:13 +0000 (20:19 -0200)]
ripd: fix race condition on input processing

In the early days of ripd, we supported running RIP on secondary IP
addresses. To do that, everytime we needed to send a multicast packet,
we would create a new temporary socket for each of the interface's
addresses and call bind() to change the source IP of the outgoing packets.

The problem with these temporary sockets is that they are more specific
than the global RIP socket (bound to INADDR_ANY). Then, even though these
sockets only exist for a short amount of time, they can receive some RIP
packets that were supposed to be received on the global RIP socket. And
since we never read from the temporary sockets, these packets are dropped.

Since we don't support secondary addresses anymore, the simplest way to
fix this problem is to stop using temporary sockets for sending multicast
packets. We are already setting IP_MULTICAST_IF before sending each
multicast packet, and in this case the primary address of the selected
interface is used as the source IP of the outgoing packets, which is
exactly what we want.

If we decide to reintroduce support for secondary addresses in the future,
we should try one of the following:
* Use IP_SENDSRCADDR/IP_PKTINFO to set the source address of the outgoing
  multicast packets;
* Create one permanent UDP socket for each possible interface address,
  and enable reading on all sockets.

Fixes the following IxANVL RIP tests: 7.10 and 14.1.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd: fix the "neighbor" command.
Renato Westphal [Thu, 10 Nov 2016 17:35:47 +0000 (15:35 -0200)]
ripd: fix the "neighbor" command.

We can't use if_lookup_prefix() in rip_update_process() because this
function uses prefix_cmp() internally to try matching an interface
address to a static neighbor's address.

Since prefix_cmp() tries to match exact prefixes, if_lookup_prefix()
was always returning NULL.

What we really need here is to use prefix_match(), which checks if
one prefix includes the other (e.g. one /24 interface including a /32
static neighbor's address). The fix then is to replace the call to
if_lookup_prefix() and use if_lookup_address() instead, which uses
prefix_match() internally.

Fixes IxANVL RIP test 17.1

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd: add "none" option to the "ip rip receive version" command
Renato Westphal [Thu, 10 Nov 2016 15:15:43 +0000 (13:15 -0200)]
ripd: add "none" option to the "ip rip receive version" command

RFC 2453 says (section 5.1):
"(...) For completeness, routers should also implement a receive control
switch which would determine whether to accept, RIP-1 only, RIP-2 only,
both, or none.  It should also be configurable on a per-interface basis".

For the "ip rip send version" command, we don't need to implement the
"none" option because there's already the "passive-interface" command
for that.

Fixes IxANVL RIP test 16.8.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd: implement the "ip rip v2-broadcast" CLI command
Renato Westphal [Thu, 10 Nov 2016 14:55:09 +0000 (12:55 -0200)]
ripd: implement the "ip rip v2-broadcast" CLI command

This command allows ripd to send v2 updates as broadcast packets instead
of multicast packets. Useful as a technique to help with RIPv1/v2
interop issues.

Fixes IxANVL RIP test 16.2

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd: ignore request for RTEs from unknown address-families
Renato Westphal [Thu, 10 Nov 2016 14:54:07 +0000 (12:54 -0200)]
ripd: ignore request for RTEs from unknown address-families

Fixes IxANVL RIP test 6.5.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd: reject authentication strings with zeros in the middle
Renato Westphal [Thu, 10 Nov 2016 14:53:21 +0000 (12:53 -0200)]
ripd: reject authentication strings with zeros in the middle

RFC 2453 says:
"If the password is under 16 octets, it must be left-justified and padded
to the right with nulls (0x00)".

Fixes IxANVL RIP test 10.3.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoisisd: fix loss of packets after circuit is brought up
Renato Westphal [Thu, 24 Nov 2016 23:28:03 +0000 (21:28 -0200)]
isisd: fix loss of packets after circuit is brought up

The last parameter of THREAD_TIMER_ON() is the timeout, and we were
using circuit->fd for that. So, when a circuit was brought up, isisd
would miss all received packets on this circuit for quite a few seconds,
slowing down the convergence process.

To fix this, use the same logic we use in isis_receive() to calculate
this timeout.

This bug doesn't happen on Linux, which uses a different method to read
packets from the network.

Fixes the following ANVL tests on FreeBSD: ISIS-17.1, ISIS-18.6 (and
probably others too).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: Fix nexthop strings to coincide with enum
vivek [Wed, 23 Nov 2016 20:14:07 +0000 (12:14 -0800)]
lib: Fix nexthop strings to coincide with enum

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'origin/cmaster' into cmaster-next
Donald Sharp [Sat, 19 Nov 2016 17:31:41 +0000 (12:31 -0500)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next

Conflicts:
debian/changelog
zebra/zebra_rnh.c

7 years agoMerge remote-tracking branch 'cmaster-next' into cmaster-next-releng
David Lamparter [Sat, 19 Nov 2016 10:58:52 +0000 (11:58 +0100)]
Merge remote-tracking branch 'cmaster-next' into cmaster-next-releng

7 years agovtysh, zebra: Fix link-params to use exit-link-params
Donald Sharp [Fri, 18 Nov 2016 20:42:41 +0000 (15:42 -0500)]
vtysh, zebra: Fix link-params to use exit-link-params

Fix the link-params submode to use the 'exit-link-params'
to indicate we are exiting a submode.

Fixup all the relevant bits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'opensourcerouting/cmaster-next-linkpar' into cmaster...
Donald Sharp [Fri, 18 Nov 2016 18:51:33 +0000 (13:51 -0500)]
Merge remote-tracking branch 'opensourcerouting/cmaster-next-linkpar' into cmaster-next

7 years ago*: Fix up licensing to be right
Donald Sharp [Fri, 18 Nov 2016 15:11:46 +0000 (10:11 -0500)]
*: Fix up licensing to be right

These files were submitted by Cumulus but did
not properly setup the licensing of them.
This fixes that issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: 'show ip bgp neighbor json' some keys are in the wrong place
Daniel Walton [Wed, 16 Nov 2016 15:33:35 +0000 (15:33 +0000)]
bgpd: 'show ip bgp neighbor json' some keys are in the wrong place

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Sam Tannous <stannous@cumulusnetworks.com>
Ticket: CM-13511

7 years agobgpd: 'show ip bgp neighbor json' some keys are in the wrong place
Daniel Walton [Wed, 16 Nov 2016 14:25:04 +0000 (14:25 +0000)]
bgpd: 'show ip bgp neighbor json' some keys are in the wrong place

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-13511

connectionsEstablished, etc are no longer under the addressFamilyInfo
keyword, they are now at the top level

7 years agoisisd: use BPF on Linux/PF_PACKET
David Lamparter [Mon, 14 Nov 2016 23:26:56 +0000 (08:26 +0900)]
isisd: use BPF on Linux/PF_PACKET

we *really* don't want to receive every single packet (of any protocol
type) coming in on an IS-IS enabled interface.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: replace strlcpy & strlcat with glibc versions
David Lamparter [Tue, 15 Nov 2016 08:15:49 +0000 (17:15 +0900)]
lib: replace strlcpy & strlcat with glibc versions

It seems these two were at some point copied in from rsync; replace with
more recent versions that will hopefully become available in glibc as
well.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: remove LGPL v2.0, add LGPL v2.1
David Lamparter [Tue, 15 Nov 2016 08:19:10 +0000 (17:19 +0900)]
build: remove LGPL v2.0, add LGPL v2.1

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: use ac_configure_args for CONFIG_ARGS
David Lamparter [Tue, 15 Nov 2016 05:05:28 +0000 (14:05 +0900)]
build: use ac_configure_args for CONFIG_ARGS

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: massively remove needless checks
David Lamparter [Tue, 15 Nov 2016 04:37:14 +0000 (13:37 +0900)]
build: massively remove needless checks

Since we have autoconf results from a wide swath of target platforms, we
can go remove checks that have the same result on all systems.

This also removes several "fallback" implementations of functions that,
at some point in the history, weren't available on all target platforms.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: chop down complicated CFLAGS logic
David Lamparter [Tue, 15 Nov 2016 02:18:43 +0000 (11:18 +0900)]
build: chop down complicated CFLAGS logic

Other packages don't have --with-cflags; we don't need it either.  The
user can specify CFLAGS= in the environment or on ./configure and that
would work perfectly fine.  If only it weren't for autoconf being an
idiot and adding its own "-g -O2" ... so we work around that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd/rfapi: Fix missing files in distribution ("make dist") package
Martin Winter [Mon, 14 Nov 2016 08:21:47 +0000 (00:21 -0800)]
bgpd/rfapi: Fix missing files in distribution ("make dist") package

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: don't use deprecation warning on ICC
David Lamparter [Tue, 15 Nov 2016 05:03:11 +0000 (14:03 +0900)]
build: don't use deprecation warning on ICC

icc doesn't do the pragma warning push/pop thing to selectively disable
the warning.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: fix sign warning in SNMP code
David Lamparter [Tue, 15 Nov 2016 04:49:34 +0000 (13:49 +0900)]
zebra: fix sign warning in SNMP code

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: fix -Wmaybe-uninitialized warnings
David Lamparter [Tue, 15 Nov 2016 02:17:50 +0000 (11:17 +0900)]
build: fix -Wmaybe-uninitialized warnings

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: unconditionally try -rdynamic
David Lamparter [Tue, 15 Nov 2016 01:52:09 +0000 (10:52 +0900)]
build: unconditionally try -rdynamic

-rdynamic is needed for useful backtraces and future plugin loading
support.  Try and enable it unconditionally.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: fix some minor autoconf & automake breakage
David Lamparter [Thu, 10 Nov 2016 12:14:48 +0000 (13:14 +0100)]
build: fix some minor autoconf & automake breakage

- use AS_HELP_STRING in configure.ac
- don't define HAVE_SETNS twice
- remove unused AM_LDFLAGS
- AC_PROG_RANLIB is automatically called by LT_INIT

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster
Don Slice [Mon, 14 Nov 2016 16:37:47 +0000 (08:37 -0800)]
Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

7 years agozebra: remove recursively derived static routes correctly
Don Slice [Thu, 10 Nov 2016 23:49:45 +0000 (15:49 -0800)]
zebra: remove recursively derived static routes correctly

Problem reported that in certain configs, when a router is initially
booted and the link is bounced, we can end up with a bogus static route
in the table.  This was due to the assumption in zebra_rnh that a static
route would not be recursively resolved through another static route with
a different next-hop. This fix changes this assumption.  Tested manually
and bgp-min, ospf-min, and vrf-min run with no new failures.

Ticket: CM-13328
Signed-off-by: Don Slice
Reviewed-by: CCR-5338
7 years agoisisd: remove topology generator
David Lamparter [Mon, 14 Nov 2016 02:14:00 +0000 (11:14 +0900)]
isisd: remove topology generator

Licensing is unclear and the tool is a testbed-only half-broken pile of
goo.  Remove.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: fix some licensing SNAFUs
David Lamparter [Mon, 14 Nov 2016 02:07:41 +0000 (11:07 +0900)]
*: fix some licensing SNAFUs

bgpd/bgpd.c had a typo
zebra/zebra_mpls_netlink.c was derived from rt_netlink.c
isisd/include-netbsd/* are not needed (2 constants moved over)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: fix link-params CLI handling
David Lamparter [Sat, 12 Nov 2016 08:43:15 +0000 (17:43 +0900)]
zebra: fix link-params CLI handling

vtysh was breaking in a rather ugly way, and some "no" forms were
missing too.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoCumulus: Fixup changelog and version string.
Donald Sharp [Sat, 12 Nov 2016 00:31:05 +0000 (19:31 -0500)]
Cumulus: Fixup changelog and version string.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'opensourcerouting/cmaster-next-vty2' into cmaster-next
Donald Sharp [Thu, 10 Nov 2016 13:08:23 +0000 (08:08 -0500)]
Merge remote-tracking branch 'opensourcerouting/cmaster-next-vty2' into cmaster-next

Conflicts:
watchquagga/watchquagga.c

7 years agovtysh: fix config write
David Lamparter [Thu, 10 Nov 2016 12:59:54 +0000 (13:59 +0100)]
vtysh: fix config write

7 years agoMerge remote-tracking branch 'origin/cmaster' into cmaster-next
Donald Sharp [Thu, 10 Nov 2016 12:57:51 +0000 (07:57 -0500)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next

7 years agodoc: vtysh doc updates
David Lamparter [Wed, 9 Nov 2016 12:29:00 +0000 (13:29 +0100)]
doc: vtysh doc updates