]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoOSPFd: Correct Extended Prefix LSA refresh
Olivier Dugeon [Thu, 1 Feb 2018 13:30:34 +0000 (14:30 +0100)]
OSPFd: Correct Extended Prefix LSA refresh

 - When Extended Prefix LSA need to be refresh, paramaters may be
taken from the wrong interface i.e. Extended Link instead of Prefix
resulting in producing an empty LSA body. Then, ospfd crash due to the
assert on LSA length in ospf_lsa_different() function: code check that
the LSA size is larger than LSA header i.e. LSA is not empty.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoOSPFd: Clean up Segment Routing patch
Olivier Dugeon [Tue, 30 Jan 2018 15:17:54 +0000 (16:17 +0100)]
OSPFd: Clean up Segment Routing patch

 - ospfd/ospf_te.c: Remove unregister function and call to
ospf_delete_opaque_functab() following the introduction of
ospf_opaque_term() function in ospfd.c for ospfd termination.
 - ospfd/ospf_sr.c: Set initial index value for node-msd CLI to
avaoid crash when using this command
 - ospfd/ospf_ext.c: Disable call to ospf_sr_update_prefix() if
Segment Routing, thus Extended Link/Prefix, is not enable
 - ospfd/ospf_opaque.c: Correct scheduling of Opaque LSA flooding

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoOSPFd: Remove unecessary debug message
Olivier Dugeon [Tue, 30 Jan 2018 13:25:40 +0000 (14:25 +0100)]
OSPFd: Remove unecessary debug message

 - Line 865 in ospfd/ospf_ext.c cause compilation failure when
-werror is set. This line was not necessary and add only for debugging
purpose.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoMerge remote-tracking 'frr/master' into SR-Routing
Olivier Dugeon [Tue, 30 Jan 2018 10:43:25 +0000 (11:43 +0100)]
Merge remote-tracking 'frr/master' into SR-Routing

6 years agoOSPFd: Correct compilation error
Olivier Dugeon [Tue, 30 Jan 2018 10:42:02 +0000 (11:42 +0100)]
OSPFd: Correct compilation error

 - Forget to remove ospf_router_info_unregister in ospfd_ri.c

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoMerge pull request #1688 from chiragshah6/mdev
Olivier Dugeon [Tue, 30 Jan 2018 10:37:59 +0000 (11:37 +0100)]
Merge pull request #1688 from chiragshah6/mdev

ospfd: Fix default-info and redis cmd options

6 years agoospfd: Fix default-info and redis cmd options
Chirag Shah [Tue, 30 Jan 2018 02:03:08 +0000 (18:03 -0800)]
ospfd: Fix default-info and redis cmd options

Fix default-information parsing of metric-type,
route-map.
show running to display metic-type 2.

metric, metric-type and route-map can be configured in
any order, running-config displays in specific order..

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #1686 from donaldsharp/mem_leaks_zebra
Renato Westphal [Mon, 29 Jan 2018 22:41:07 +0000 (20:41 -0200)]
Merge pull request #1686 from donaldsharp/mem_leaks_zebra

Mem leaks zebra

6 years agoMerge pull request #1684 from donaldsharp/vrf_leak
Renato Westphal [Mon, 29 Jan 2018 22:34:02 +0000 (20:34 -0200)]
Merge pull request #1684 from donaldsharp/vrf_leak

zebra: Fix to get correct nexthop-vrf

6 years agozebra: On shutdown actually delete rn's assoc w/ other_tables
Donald Sharp [Mon, 29 Jan 2018 21:20:41 +0000 (16:20 -0500)]
zebra: On shutdown actually delete rn's assoc w/ other_tables

Zebra stores routes coming from the kernel for non-default
tables.  This information on shutdown was being leaked
because we never cleaned it up.  Allow for this to happen
now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1685 from LabNConsulting/working/vpn-doc
Donald Sharp [Mon, 29 Jan 2018 20:51:30 +0000 (15:51 -0500)]
Merge pull request #1685 from LabNConsulting/working/vpn-doc

doc: minor cleanup of bgp vpnvX and remove encap safi references

6 years agolib: When we shutdown we would leak interface description
Donald Sharp [Mon, 29 Jan 2018 20:38:03 +0000 (15:38 -0500)]
lib: When we shutdown we would leak interface description

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
6 years agozebra: Cleanup error handling of nexthop vrf and vrf
Donald Sharp [Mon, 29 Jan 2018 20:18:28 +0000 (15:18 -0500)]
zebra: Cleanup error handling of nexthop vrf and vrf

The error handling of the nexthop vrf and the vrf
for what was specified on the cli was not as clean
as it should have been.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: remove references to encap safi
Lou Berger [Mon, 29 Jan 2018 20:03:03 +0000 (15:03 -0500)]
doc: remove references to encap safi

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agodoc: change vpnvX -> ipvX vpn
Lou Berger [Mon, 29 Jan 2018 19:55:16 +0000 (14:55 -0500)]
doc: change vpnvX -> ipvX vpn

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoMerge pull request #1680 from donaldsharp/inet_pton
Renato Westphal [Mon, 29 Jan 2018 19:24:33 +0000 (17:24 -0200)]
Merge pull request #1680 from donaldsharp/inet_pton

zebra: Fix failure to parse src

6 years agoOSPFd: Update Segment Routing PR following review
Olivier Dugeon [Mon, 29 Jan 2018 16:58:53 +0000 (17:58 +0100)]
OSPFd: Update Segment Routing PR following review

Following various review, following files have been modfied:

 - All: Change u_intXX_t typedef to standard uintXX_t types
 - doc/OSPF-SR.rst: Update doc in particular the Linux Kernel configuration
section
 - doc/ospfd.texi: Update CLI
 - ospfd/ospf_dump.[c,h]: Add new 'debug ospf sr' when performing 'sh run'
 - ospfd/ospf_ext.[c, h]: Various bug corrections notably to handle flooding of
Extended Prefix at startup. iFix TLVs size for LAN Adjacency.
Update Licence as per Community.md
 - ospfd/ospf_opaque.c: Add proper termination function call to remove MPLS entries
 - ospfd/ospf_ri.[c,h]: Bug corrections
 - ospfd/ospf_sr.[c,h]: Various bug corrections, notably to determine the nexthop
SR Node. Add support to 'no-php-flag'.
Update Licence as per Community.md
 - ospfd/ospfd.c: Add call to 'ospf_opaque_term()'

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoMerge pull request #1679 from qlyoung/revert-remove-options-directly-connected
Russ White [Mon, 29 Jan 2018 13:25:49 +0000 (08:25 -0500)]
Merge pull request #1679 from qlyoung/revert-remove-options-directly-connected

Revert "bgpd: disallow invalid config at cli layer"

6 years agozebra: Fix failure to parse src
Donald Sharp [Sat, 27 Jan 2018 23:56:30 +0000 (18:56 -0500)]
zebra: Fix failure to parse src

If src happens to point at all 0's due to not initializing
it and if the address passed in is not a v6 address then
we would not set src in the AF_INET6 call and would
fail the (src.ipv4.s_addr && inet_pton(AF_INET...)
call.  Thus causing us to return a NULL and make
the routemap code think there was an issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1659 from chiragshah6/ospf_vrf_dev
Martin Winter [Sat, 27 Jan 2018 17:17:45 +0000 (09:17 -0800)]
Merge pull request #1659 from chiragshah6/ospf_vrf_dev

ospfd: show ip ospf neighbor json output format

6 years agozebra: Fix to get correct nexthop-vrf
Donald Sharp [Sat, 27 Jan 2018 10:28:51 +0000 (05:28 -0500)]
zebra: Fix to get correct nexthop-vrf

The nexthop_vrf should be looked up as appropriate,
If the nexthop_vrf was specified use that, else
use the vrf context of what was passed in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoRevert "bgpd: disallow invalid config at cli layer"
Quentin Young [Fri, 26 Jan 2018 22:15:44 +0000 (17:15 -0500)]
Revert "bgpd: disallow invalid config at cli layer"

This reverts commit a174be631a14e0271fde6858fcb4d7ab55165014.

Turns out we need that variable to accept peer groups.

6 years agoMerge pull request #1671 from donaldsharp/southbound_pointer
Russ White [Fri, 26 Jan 2018 21:40:01 +0000 (16:40 -0500)]
Merge pull request #1671 from donaldsharp/southbound_pointer

Southbound pointer

6 years agoMerge pull request #1676 from dslicenc/cm19322-bgp-json
Renato Westphal [Fri, 26 Jan 2018 12:52:19 +0000 (10:52 -0200)]
Merge pull request #1676 from dslicenc/cm19322-bgp-json

bgpd: remove poorly located bestpath json output

6 years agoMerge pull request #1672 from qlyoung/frr-pthread-improvements
Renato Westphal [Fri, 26 Jan 2018 12:47:55 +0000 (10:47 -0200)]
Merge pull request #1672 from qlyoung/frr-pthread-improvements

FRR pthread improvements

6 years agoMerge pull request #1675 from donaldsharp/ptm_crash
Renato Westphal [Thu, 25 Jan 2018 18:12:01 +0000 (16:12 -0200)]
Merge pull request #1675 from donaldsharp/ptm_crash

zebra: Fix crash in ptm code

6 years agobgpd: remove poorly located bestpath json output
Don Slice [Thu, 25 Jan 2018 17:45:40 +0000 (17:45 +0000)]
bgpd: remove poorly located bestpath json output

The bestpath multipath-relax setting was added to the output of
"show ip bgp neighbor json" several months ago but this is not
the correct place to display that information and this fix removes
it from there.  The multipath-relax setting  was also added
to the output of "show ip bgp sum json" which is fine.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoMerge pull request #1668 from qlyoung/fix-bgp-corrupt-header-assert
Russ White [Thu, 25 Jan 2018 14:15:20 +0000 (09:15 -0500)]
Merge pull request #1668 from qlyoung/fix-bgp-corrupt-header-assert

bgpd: fix race condition causing occasional assert

6 years agoMerge pull request #1674 from chiragshah6/mdev
Russ White [Thu, 25 Jan 2018 14:07:23 +0000 (09:07 -0500)]
Merge pull request #1674 from chiragshah6/mdev

ospfd: clean up route map prefixlist vrf during exit

6 years agoMerge pull request #1673 from opensourcerouting/ospfd-metric-issue
Donald Sharp [Thu, 25 Jan 2018 13:19:53 +0000 (08:19 -0500)]
Merge pull request #1673 from opensourcerouting/ospfd-metric-issue

ospfd: allow multiple options in the redistribute command

6 years agozebra: Fix crash in ptm code
Donald Sharp [Thu, 25 Jan 2018 01:53:40 +0000 (20:53 -0500)]
zebra: Fix crash in ptm code

The code change to switch from stream_getX to STREAM_GETX added
a goto statement to be handled for a failure case.  The failure
case was properly handled but the normal case was not tested
properly and there exists a situation where we would free
the out_ctxt 2 times.  Prevent that from happening.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospfd: clean route map prefixlist vrf during exit
Chirag Shah [Thu, 25 Jan 2018 00:41:07 +0000 (16:41 -0800)]
ospfd: clean route map prefixlist vrf during exit

Call Route-map, prefix-list clean up routines and
vrf clearnup during ospf daemon exit routine.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoospfd: allow multiple options in the redistribute command
Renato Westphal [Wed, 24 Jan 2018 23:05:27 +0000 (21:05 -0200)]
ospfd: allow multiple options in the redistribute command

Other variants of the redistribute command (e.g. "redistribute
<ospf|table> (1-65535) ..." already accept multiple options.

Fixes Issue #1670.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agozebra: Move selected_fib assignment
Donald Sharp [Wed, 24 Jan 2018 14:16:39 +0000 (09:16 -0500)]
zebra: Move selected_fib assignment

The dest->selected_fib assignment needs to happen
after the install and should be controlled by
the southbound api return of success or failure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: check flags before attempting keepalive ops
Quentin Young [Wed, 24 Jan 2018 22:47:17 +0000 (17:47 -0500)]
bgpd: check flags before attempting keepalive ops

If a peer already has keepalives turned on when asking to turn them on,
return immediately. Same thing for turning them off.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agotests: make tests happy for pthread changes
Quentin Young [Wed, 24 Jan 2018 20:53:07 +0000 (15:53 -0500)]
tests: make tests happy for pthread changes

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: update pthreads to use lib changes
Quentin Young [Wed, 24 Jan 2018 16:07:27 +0000 (11:07 -0500)]
bgpd: update pthreads to use lib changes

Use the new threading facilities provided in lib/ to streamline the
threads used in bgpd. In particular, all of the lifecycle code has been
removed from the I/O thread and replaced with the default loop. Did not
do the same to the keepalives thread as it is much smaller (doesn't need
the event system).

Also cleaned up some comments to match the style guide.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: streamline frr_pthreads, add default loop
Quentin Young [Mon, 22 Jan 2018 19:23:55 +0000 (14:23 -0500)]
lib: streamline frr_pthreads, add default loop

Some work on FRR's pthread wrapper.

* Provide a built-in way to synchronize thread startup
* Make utility functions take frr_pthread * instead of its integer ID
* Pass frr_pthread * as pthread start function argument
* Correct some comment styling
* Rename some variables to match naming conventions in the file
* Change parameter ordering in stop function prototype to follow the
  convention in the other functions
* Default new frr_pthreads to using a vanilla event loop

For the last point, the original goal when designing the implementation
of pthreads into FRR was to be able to use the thread.c event based
system inside pthreads. This code essentially encapuslates all the
thread.c functionality into an easy to use pthread out of the box.
Creating a new frr_pthread with a null attributes field will cause the
created frr_pthread to run a thread.c event loop. The upshot of this is
that it is now possible to safely run existing functions in a pthread in
roughly 3 lines of code. It also serves as an example / starting point
for others.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: Modify southbound interface to pass `struct route_node`
Donald Sharp [Wed, 24 Jan 2018 13:22:57 +0000 (08:22 -0500)]
zebra: Modify southbound interface to pass `struct route_node`

The route_node that we are working on is going to be interesting
to the kernel_route_rib_pass_fail.  So I am setting up the
code to allow me to pass it.  This will be done in a subsuquent
commit.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1664 from chiragshah6/ospfv3_dev
Russ White [Wed, 24 Jan 2018 00:20:43 +0000 (19:20 -0500)]
Merge pull request #1664 from chiragshah6/ospfv3_dev

ospf6d: SPF calculation w/ multiple Router LSAs originated from given Adv Router

6 years agoMerge pull request #1665 from donaldsharp/nexthop_labels
Russ White [Wed, 24 Jan 2018 00:09:08 +0000 (19:09 -0500)]
Merge pull request #1665 from donaldsharp/nexthop_labels

Cleanup some zclient code

6 years agoMerge pull request #1667 from Orange-OpenSource/master
Russ White [Wed, 24 Jan 2018 00:05:05 +0000 (19:05 -0500)]
Merge pull request #1667 from Orange-OpenSource/master

OSPFD: Solve Issue #1652

6 years agobgpd: fix race condition causing occasional assert
Quentin Young [Mon, 18 Dec 2017 18:19:22 +0000 (13:19 -0500)]
bgpd: fix race condition causing occasional assert

If a BGP message header fails validation we send a BGP NOTIFICATION from
the I/O thread. At this time we clear the output buffer, push a
NOTIFICATION and then call the manual write function for errors. But in
between the push and the write the main thread could have pushed some
other message. Thus we need to hold the lock for the duration of the
function. TOCTTOU.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoOSPFD: Solve Issue #1652
Olivier Dugeon [Tue, 23 Jan 2018 15:15:58 +0000 (16:15 +0100)]
OSPFD: Solve Issue #1652

Issue 1652 was related to OSPF Crash on termination when ospf is
configured to flood self Opaque LSA e.g TE or RI Opaque LSA.

Analysis:
The problem resides in free_opaque_info_per_type() line 576 of
ospf_opaque.c. Once LSA flush, the function removes by calling
listnode_delete() function the opaque_info_per_type data structure.
However, this is also performed at the upper level function
ospf_opaque_type10lsa_term() which call list_delete_and_null() function.
This result into a double free pointer exception.

Solution:
Remove call to listnode_delete() calls in free_opaque_info_per_type()
function as it is done by list_delete_and_null(). Delete lines 592 - 615.
Remove also second call to ospf_opaque_type10lsa_term() in ospfd.c line 848.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoOSPFD: Set Segment Routing patch conform to C99
Olivier Dugeon [Tue, 23 Jan 2018 11:19:50 +0000 (12:19 +0100)]
OSPFD: Set Segment Routing patch conform to C99

 - Change all u_intXX_t typedef to standard type uintXX_t
 - Correct removal of ZEBRA_OSPF_SR route in ospf_sr.c line 670

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoMerge pull request #1618 from donaldsharp/zebra_startup_ordering
Philippe Guibert [Tue, 23 Jan 2018 07:25:01 +0000 (08:25 +0100)]
Merge pull request #1618 from donaldsharp/zebra_startup_ordering

zebra route-leaking for static routes

6 years agoospf6d: spf calculation w/ multiple router lsas
Chirag Shah [Wed, 17 Jan 2018 18:55:46 +0000 (10:55 -0800)]
ospf6d: spf calculation w/ multiple router lsas

An OSPFv3 enabled Router can originate or receive
multiple Link State-IDs for Router LSAs.
As per RFC 5340 A 4.3, more than one Router LSAs,
from given Vertex is considered (as concatenated)
single large Router LSA.

Created hidden show command to simulate concatenated
large LSA from advertising/self Router LSAs.

Ticket:CM-19329
Reviewed By:
Testing Done:
Simulate 160 subinterfaces between R1 === R2--R3,
This triggers R1 and R2 to generate multiple link state
IDs for Router LSAs. During SPF calculation only aggregated
single router LSA processed and SPF tree formed.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agobgpd, lib, pimd: Abstract commands for nexthop tracking
Donald Sharp [Mon, 22 Jan 2018 23:36:03 +0000 (18:36 -0500)]
bgpd, lib, pimd: Abstract commands for nexthop tracking

Abstract the code that sends the zapi message into zebra
for the turn on/off of nexthop tracking for a prefix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: No need to assert on the redist_default
Donald Sharp [Mon, 22 Jan 2018 23:22:09 +0000 (18:22 -0500)]
pimd: No need to assert on the redist_default

zclient_init sets the redist_default to the appropriate
value, testing it with an assert doesn't really provide
us with much of anything useful.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Unset bitmap when not using it
Donald Sharp [Mon, 22 Jan 2018 23:18:38 +0000 (18:18 -0500)]
lib: Unset bitmap when not using it

The zclient->redist bitmap for vrf's was being set again
for the zclient_send_dereg_requests function.  This should
be a unset on tear down.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Cleanup some zclient clutter.
Donald Sharp [Mon, 22 Jan 2018 23:16:59 +0000 (18:16 -0500)]
lib: Cleanup some zclient clutter.

The zclient code can be cleaned up a tiny bit and hopefully
improve it's indentation some.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1655 from LabNConsulting/working/master/consistent_count
Quentin Young [Mon, 22 Jan 2018 23:53:19 +0000 (18:53 -0500)]
Merge pull request #1655 from LabNConsulting/working/master/consistent_count

bgpd: update last_update whenever obuf sent

6 years agobgpd: update last_update whenever obuf sent
Lou Berger [Sun, 7 Jan 2018 14:41:53 +0000 (09:41 -0500)]
bgpd: update last_update whenever obuf sent
      (to be consistent with last_write updates)

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoMerge pull request #1663 from donaldsharp/mpls
Renato Westphal [Mon, 22 Jan 2018 19:43:10 +0000 (17:43 -0200)]
Merge pull request #1663 from donaldsharp/mpls

Mpls

6 years agoMerge pull request #1656 from ak503/bgp
Renato Westphal [Mon, 22 Jan 2018 19:03:58 +0000 (17:03 -0200)]
Merge pull request #1656 from ak503/bgp

bgp: small fix for write to 'address-family l2vpn evpn' configuration

6 years agoOSPFD: Update Segment Routing following reviews
Olivier Dugeon [Mon, 22 Jan 2018 18:18:10 +0000 (19:18 +0100)]
OSPFD: Update Segment Routing following reviews

 - Remove OSPD_SR route type
 - Check that Segment Routing is enable only in default VRF
 - Add comment for SRGB in lib/mpls.h
 - Update documentation

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agozebra: implement recursive MPLS labels
Renato Westphal [Wed, 20 Sep 2017 03:05:25 +0000 (00:05 -0300)]
zebra: implement recursive MPLS labels

When a nexthop is resolved via a label based nexthop, copy
the labels into the newly created recursive nexthop.

Please note that this does not fix the case where we
have a label based nexthop that is recursively resolved
through *another* nexthop that is also label based.
In this case we need to create a new label stack
for those routes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agozebra: use zclient_create_header
Donald Sharp [Mon, 22 Jan 2018 13:16:27 +0000 (08:16 -0500)]
zebra: use zclient_create_header

The function zserv_create_header was exactly the same
as zclient_create_header.  Let's just have one in the
system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, zebra: Rename and place appropriately the label stack
Donald Sharp [Sun, 21 Jan 2018 21:11:50 +0000 (16:11 -0500)]
lib, zebra: Rename and place appropriately the label stack

Fix and rename the label stack to be better named.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1651 from donaldsharp/redhat_build_fpm
Russ White [Mon, 22 Jan 2018 14:16:21 +0000 (09:16 -0500)]
Merge pull request #1651 from donaldsharp/redhat_build_fpm

redhat: Build with FPM

6 years agoMerge pull request #1658 from Orange-OpenSource/TE
Russ White [Mon, 22 Jan 2018 14:01:39 +0000 (09:01 -0500)]
Merge pull request #1658 from Orange-OpenSource/TE

Doc: Update OSPF-TE and ISIS-TE example

6 years agoMerge pull request #1587 from pguibert6WIND/issue_385_step23
Russ White [Mon, 22 Jan 2018 14:01:01 +0000 (09:01 -0500)]
Merge pull request #1587 from pguibert6WIND/issue_385_step23

Netns Support / passing vrf_id_t to 32 bit work

6 years agozebra: replace 0 value on zebra with NS_DEFAULT
Philippe Guibert [Mon, 22 Jan 2018 08:55:26 +0000 (09:55 +0100)]
zebra: replace 0 value on zebra with NS_DEFAULT

On some places, macro NS_DEFAULT was not used. This commit is replacind
on some identified places where 0 can be replaced with NS_DEFAULT macro.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: replace 0 value on zebra with VRF_DEFAULT
Philippe Guibert [Mon, 22 Jan 2018 08:38:45 +0000 (09:38 +0100)]
zebra: replace 0 value on zebra with VRF_DEFAULT

On some places of code, the VRF_DEFAULT define was not used. This commit
is ensuring that the macros is well used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: bgp_redist_lookup param handles instances, not vrfs
Philippe Guibert [Thu, 11 Jan 2018 08:11:36 +0000 (09:11 +0100)]
bgpd: bgp_redist_lookup param handles instances, not vrfs

The VRF_DEFAULT parameter is incorrectly used. The 0 value for the bgp
instance is passed instead.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
fixup bgpd: fix compilation issue with bgpd

6 years agopim: fix compilation issue with pim
Philippe Guibert [Mon, 18 Dec 2017 11:42:12 +0000 (12:42 +0100)]
pim: fix compilation issue with pim

The change of vrf_id_t from 16 bit to 32 bit needs some changes in pim
daemon.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: fix compilation issue with bgpd
Philippe Guibert [Mon, 18 Dec 2017 11:33:29 +0000 (12:33 +0100)]
bgpd: fix compilation issue with bgpd

Changes due to the change of vrf_id_t moved from 16 bits to 32 bits.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoospfd: fix compilation issue with ospfd
Philippe Guibert [Mon, 18 Dec 2017 11:07:22 +0000 (12:07 +0100)]
ospfd: fix compilation issue with ospfd

the change of vrf_id field from 16 bit to 32 bit leads to some changes
in other daemon.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: ns_id_t changed to 32 bit
Philippe Guibert [Wed, 10 Jan 2018 13:13:50 +0000 (14:13 +0100)]
lib: ns_id_t changed to 32 bit

Because the VRF_ID is mapped into 32 bit, and because when NETNS will be
the backend of VRF, then the NS identifier must also be encoded as 32
bit.
Also, the NS_UNKNOWN value is changed accordingly to UINT32_MAX.
Also, the NS_UNKNOWN and NS_DEFAULT values are removed from zebra_ns.h
and kept on ns.h header file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: vrf_bitmap_groups increased from 8 to 1024
Philippe Guibert [Thu, 4 Jan 2018 13:30:28 +0000 (14:30 +0100)]
lib: vrf_bitmap_groups increased from 8 to 1024

The number of vrf bitmap groups is increased so as to avoid consuming
too much memory. This fix is related to a fork memory that occured when
running pimd as daemon.
A check on memory consumed shows that the memory consumed goes from
33480ko to 46888ko with that change. This is less compared to if the
value of the bitmap groups is increased to 16 ( 852776ko).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: increase vrf_id from 16 bit to 32 bit identifier
Philippe Guibert [Thu, 14 Dec 2017 15:01:36 +0000 (16:01 +0100)]
lib: increase vrf_id from 16 bit to 32 bit  identifier

This is a preparatory work for configuring vrf/frr over netns
vrf structure is being changed to 32 bit, and the VRF will have the
possibility to have a backend made up of NETNS.

Let's put some history.
Initially the 32 bit was because one wanted to map on vrf_id both the
VRFLITE and the NSID.
Initially, one would have liked to make zebra configure at the same time
both vrf lite and vrf from netns in a flat way. From the show
running perspective, one would have had both kind of vrfs, thatone
would configure on the same way.
however, it leads to inconsistencies in concepts, because it mixes vrf
vrf with vrf, and vrf is not always mapped with netns.
For instance, logical-router could also be used with netns. In that
case, it would not be possible to map vrf with netns.
There was an other reason why 32 bit is proposed. this is because
some systems handle NSID to 32 bits. As vrf lite exists only on
Linux, there are other systems that would like to use an other vrf
backend than vrf lite. The netns backend for vrf will be used for that
too. for instance, for windows or freebsd, some similar
netns concept exists; so it will be easier to reuse netns
backend for vrf, than reusing vrflite backend for vrf.

This commit is here to extend vrf_id to 32 bits. Following commits in a
second step will help in enable a VRF backend.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #1661 from donaldsharp/connected
Renato Westphal [Mon, 22 Jan 2018 11:47:04 +0000 (09:47 -0200)]
Merge pull request #1661 from donaldsharp/connected

zebra: Install connected routes during VRF change only if interface i…

6 years agozebra: Install connected routes during VRF change only if interface is up
vivek [Sat, 20 Jan 2018 21:21:05 +0000 (13:21 -0800)]
zebra: Install connected routes during VRF change only if interface is up

During VRF change handling, the connected route for the interface should be
installed only if the interface is up. Otherwise, we end up with duplicate
connected routes which can lead to other problems.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-19364
Reviewed By: CCR-7099
Testing Done: Manual verification

6 years agoospfd: show ip ospf neighbor json output format
Chirag Shah [Sat, 20 Jan 2018 02:17:53 +0000 (18:17 -0800)]
ospfd: show ip ospf neighbor json output format

Current json output does not differentiate start of
neighbor ip object. Adding "neighbors" keyword at the
beginning of neighbor list. This is useful when
displaying vrf level output along with neighbors
list.

Ticket:CM-19097
Testing Done:
show ip ospf neighbor json
show ip ospf vrf all neighbor json

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #1647 from chiragshah6/ospf_vrf_dev
Olivier Dugeon [Fri, 19 Jan 2018 16:40:14 +0000 (17:40 +0100)]
Merge pull request #1647 from chiragshah6/ospf_vrf_dev

ospfd: show ip ospf interface json output format

6 years agoDoc: Update OSPF-TE and ISIS-TE example
Olivier Dugeon [Fri, 19 Jan 2018 15:27:26 +0000 (16:27 +0100)]
Doc: Update OSPF-TE and ISIS-TE example

 - In ospfd and isisd documentation, Traffic Engineering examples
are referring to old interface syntax. Update both examples to
'link-param' syntax.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoOSPFD: Update Segment Routing implementation
Olivier Dugeon [Fri, 19 Jan 2018 14:04:41 +0000 (15:04 +0100)]
OSPFD: Update Segment Routing implementation

 - ospf_ext.c: Correct deferred pointer raised by valgrind
 - ospf_sr.c: Correct deffered pointer raised by valgrind. Modify
Segment Routing shutdown. This is due to the fact that RI LSA
4.0.0.0 is flush prior to 7.0.0.X & 8.0.0.X LSA. This trigger
SR-Node deletion which also remove all Extended Link / Prefix
leaving them unavailable when there are referenced by 7.0.0.X
& 8.0.0.X LSA flushing.
 - doc/OSPF-SR.rst: Correct Restructured Text syntax and add
Configuration example as well as Credit section

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoMerge pull request #1630 from LabNConsulting/working/master/pr1629-no-json
Donald Sharp [Fri, 19 Jan 2018 12:59:34 +0000 (07:59 -0500)]
Merge pull request #1630 from LabNConsulting/working/master/pr1629-no-json

bgpd: fix reporting of no vpn routes (no json)

6 years agobgp: small fix for write to 'address-family l2vpn evpn' configuration
dturlupov [Fri, 19 Jan 2018 07:53:32 +0000 (10:53 +0300)]
bgp: small fix for write to 'address-family l2vpn evpn' configuration

6 years agoOSPFD: Add Experimental Segment Routing support
Olivier Dugeon [Thu, 18 Jan 2018 18:11:11 +0000 (19:11 +0100)]
OSPFD: Add Experimental Segment Routing support

This is an implementation of draft-ietf-ospf-segment-routing-extensions-24
and RFC7684 for Extended Link & Prefix Opaque LSA.
Look to doc/OSPF_SR.rst for implementation details & known limitations.

New files:

 - ospfd/ospf_sr.h: Segment Routing structure definition (SubTLVs + SRDB)
 - ospfd/ospf_sr.c: Main functions for Segment Routing support
 - ospfd/ospf_ext.h: TLVs and SubTLVs definition for RFC7684
 - ospfd/ospf_ext.c: RFC7684 Extended Link / Prefix implementation
 - doc/OSPF-SRr.rst: Documentation

Modified Files:

 - doc/ospfd.texi: Add new Segment Routing CLI command definition
 - lib/command.h: Add new string command for Segment Routing CLI
 - lib/mpls.h: Add default value for SRGB
 - lib/route_types.txt: Add new OSPF Segment Routing route type
 - ospfd/ospf_dump.[c,h]: Add OSPF SR debug
 - ospfd/ospf_memory.[c,h]: Add new Segment Routing memory type
 - ospfd/ospf_opaque.[c,h]: Add ospf_sr_init() starting function
 - ospfd/ospf_ri.c: Add new functions to Set/Get Segment Routing TLVs
Add new ospf_router_info_lsa_upadte() to send Opaque LSA to ospf_sr.c()
 - ospfd/ospf_ri.h: Add new Router Information SR SubTLVs
 - ospfd/ospf_spf.c: Add new scheduler when running SPF to trigger
update of NHLFE
 - ospfd/ospfd.h: Add new thread for Segment Routing scheduler
 - ospfd/subdir.am: Add new files
 - vtysh/Makefile.am: Add new ospf_sr.c file for vtysh
 - zebra/kernel_netlink.c: Add new OSPF_SR route type
 - zebra/rt_netlink.[c,h]: Add new OSPF_SR route type
 - zebra/zebra_mpls.h: Add new OSPF_SR route type

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
6 years agoMerge pull request #1566 from chiragshah6/ospfv3_dev
Jafar Al-Gharaibeh [Thu, 18 Jan 2018 16:54:52 +0000 (10:54 -0600)]
Merge pull request #1566 from chiragshah6/ospfv3_dev

ospf6d: Fix External routes ECMP

6 years agoMerge pull request #1645 from qlyoung/fix-cancel-invalid-rw
Jafar Al-Gharaibeh [Thu, 18 Jan 2018 15:37:24 +0000 (09:37 -0600)]
Merge pull request #1645 from qlyoung/fix-cancel-invalid-rw

lib: avoid crash when cancelling invalid rw job

6 years agoMerge pull request #1648 from dwalton76/frr-reload
Jafar Al-Gharaibeh [Thu, 18 Jan 2018 15:32:41 +0000 (09:32 -0600)]
Merge pull request #1648 from dwalton76/frr-reload

tools: frr-reload 'vni' keyword does not always create a sub-context

6 years agoMerge pull request #1646 from qlyoung/update-readme
Jafar Al-Gharaibeh [Thu, 18 Jan 2018 15:27:48 +0000 (09:27 -0600)]
Merge pull request #1646 from qlyoung/update-readme

frr: update README

6 years agozebra: Add some more debug information on read issues in FPM
Donald Sharp [Thu, 18 Jan 2018 14:17:57 +0000 (09:17 -0500)]
zebra: Add some more debug information on read issues in FPM

When we receive a read failure in handling a FPM read
let's add a bit more information to what we think has
gone wrong, in a hope that debugging will be a bit easier.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoredhat: Build with FPM
Donald Sharp [Thu, 18 Jan 2018 14:05:36 +0000 (09:05 -0500)]
redhat: Build with FPM

Build redhat rpm's with FPM.  It's a module so not
a bad idea.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1650 from donaldsharp/hash_it_fucker
Renato Westphal [Wed, 17 Jan 2018 22:59:56 +0000 (20:59 -0200)]
Merge pull request #1650 from donaldsharp/hash_it_fucker

bgpd: Remove peer->hash as that it is unused

6 years agoMerge pull request #1649 from donaldsharp/ospfd_lsdb_loop
Renato Westphal [Wed, 17 Jan 2018 22:58:18 +0000 (20:58 -0200)]
Merge pull request #1649 from donaldsharp/ospfd_lsdb_loop

ospfd: LSDB_LOOP treat it as a loop.

6 years agobgpd: Remove peer->hash as that it is unused
Donald Sharp [Wed, 17 Jan 2018 19:17:15 +0000 (14:17 -0500)]
bgpd: Remove peer->hash as that it is unused

The peer->hash pointer is allocating a bunch of memory
but is never used.  Remove.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospfd: LSDB_LOOP treat it as a loop.
Donald Sharp [Wed, 17 Jan 2018 18:28:17 +0000 (13:28 -0500)]
ospfd: LSDB_LOOP treat it as a loop.

Inform the .clang-format file about LSDB_LOOP and
put the proper indentation for this loop into the
code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agotools: frr-reload 'vni' keyword does not always create a sub-context
Daniel Walton [Wed, 17 Jan 2018 15:57:50 +0000 (15:57 +0000)]
tools: frr-reload 'vni' keyword does not always create a sub-context

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
6 years agofrr: update README
Quentin Young [Tue, 16 Jan 2018 20:44:14 +0000 (15:44 -0500)]
frr: update README

* Clarify that FRR implements as well as manages protocols
* Move IS-IS out of "early support"
* Add Babel - friends don't leave friends out of READMEs!
* Add mention of further information

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoospfd: show ip ospf interface json output format
Chirag Shah [Sat, 30 Dec 2017 05:01:07 +0000 (21:01 -0800)]
ospfd: show ip ospf interface json output format

Current json output does not differentiate start of
interface objects. Adding "interfaces" keyword at the
beginning of the interface list. This is useful
when displaying vrf level output along with interface list.

Ticket:CM-19115
Testing Done:
show ip ospf vrf all interface json
show ip ospf vrf all interface <specific intf> json
show ip ospf interface json
show ip ospf interface <specific intf> json

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #1634 from qlyoung/vtysh-output-file
Russ White [Tue, 16 Jan 2018 20:31:50 +0000 (15:31 -0500)]
Merge pull request #1634 from qlyoung/vtysh-output-file

vtysh: add ability to output to file

6 years agoMerge pull request #1627 from qlyoung/bgp-autoshutdown
Russ White [Tue, 16 Jan 2018 20:29:17 +0000 (15:29 -0500)]
Merge pull request #1627 from qlyoung/bgp-autoshutdown

BGP auto-shutdown

6 years agolib: avoid crash when cancelling invalid rw job
Quentin Young [Fri, 1 Dec 2017 19:44:32 +0000 (14:44 -0500)]
lib: avoid crash when cancelling invalid rw job

There are some observed instances where we end up trying to cancel a rw
job based on a file descriptor that we don't have a reference on. The
specific cancel function for rw jobs assumes it's called with a file
descriptor that is valid within pollfds and will cause a segmentation
fault by buffer overrun if this is not the case.

Instead log it and move on. Since the fd does not exist this should
patch over the buggy behavior and provide additional information to help
in finding the root cause.

Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #1625 from qlyoung/fix-peer-group-admin-shutdown-override
Renato Westphal [Tue, 16 Jan 2018 19:40:35 +0000 (17:40 -0200)]
Merge pull request #1625 from qlyoung/fix-peer-group-admin-shutdown-override

bgpd: preserve admin shutdown on peer-group add

6 years agoMerge pull request #1611 from qlyoung/fix-vtysh-perf
Renato Westphal [Tue, 16 Jan 2018 19:31:10 +0000 (17:31 -0200)]
Merge pull request #1611 from qlyoung/fix-vtysh-perf

vtysh: optimize printout routine

6 years agoMerge pull request #1632 from dwalton76/bgpd-localas-allowasin
Russ White [Tue, 16 Jan 2018 18:48:46 +0000 (13:48 -0500)]
Merge pull request #1632 from dwalton76/bgpd-localas-allowasin

BGP "allowas-in" should accept AS paths with "local-as"

6 years agoMerge pull request #1614 from qlyoung/imp-bgpd-pthread-startup-sync
Lou Berger [Tue, 16 Jan 2018 18:43:27 +0000 (13:43 -0500)]
Merge pull request #1614 from qlyoung/imp-bgpd-pthread-startup-sync

improve bgpd thread startup characteristics