]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agotests: ospf6d: basic LSDB tests
David Lamparter [Sat, 8 Jul 2017 13:30:34 +0000 (15:30 +0200)]
tests: ospf6d: basic LSDB tests

Needed these while rewriting LSDB iteration.

NB: this commit fails because of a bug in ospf_lsdb_get_next, which will
SEGV when the LSDB is actually empty.  Whooo...  (this is fixed in the
following commits.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agotests: fix pytest API "surprise" in skipping tests
David Lamparter [Tue, 11 Jul 2017 12:53:31 +0000 (14:53 +0200)]
tests: fix pytest API "surprise" in skipping tests

pytest.mark.skipif apparently iterates through a class's methods,
applying itself onto the various methods.  Now, since we're deriving
from a parent class, the method is actually the same object inherited
from the parent, so the decorator will apply itself on the parent's
testrunning method (test_refout).  The result is that any TestRefout
tests after "test_commands.py" will be skipped...

This only became apparent after adding ospf6d/test_lsdb.py;  before,
test_commands.py was the last test in the list so it didn't matter...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoospf6d: use macro for LSDB walks
David Lamparter [Fri, 7 Jul 2017 15:23:30 +0000 (17:23 +0200)]
ospf6d: use macro for LSDB walks

... to make it easier to refactor all of the iteration uses.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agolib: table: use hash for exact-match lookups
David Lamparter [Thu, 6 Jul 2017 15:30:04 +0000 (17:30 +0200)]
lib: table: use hash for exact-match lookups

Most read accesses of route_table are actually exact matches where
walking down the tree is wildly inefficient.  Use a parallel hash
structure instead.

This significantly speeds up processes that are performance-bound by
table accesses, e.g. BGP withdraw processing.  In other locations, the
improvement is not seen as strongly, e.g. when filter processing is the
limiting factor.

[includes fix to ignore prefix host bits in hash comparison]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agolib: table: maintain parallel hash for route_table
David Lamparter [Thu, 6 Jul 2017 14:33:10 +0000 (16:33 +0200)]
lib: table: maintain parallel hash for route_table

See next commit for description.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agolib: add some abstraction guards for table code
David Lamparter [Thu, 6 Jul 2017 13:30:31 +0000 (15:30 +0200)]
lib: add some abstraction guards for table code

route_node->parent and route_node->link shouldn't be touched by user
code since that is a recipe for trouble once we have a hash table in
parallel.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agolib: use "union prefixconstptr" in table code
David Lamparter [Thu, 6 Jul 2017 12:58:49 +0000 (14:58 +0200)]
lib: use "union prefixconstptr" in table code

This allows passing struct prefix_{ipv4,ipv6,evpn} * in addition to
struct prefix * without an extra cast (since the union uses the gcc
transparent-union extension present in all compilers that we support.)

Also applies some "const" while we're at it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoMerge branch 'evpn-prep'
David Lamparter [Mon, 10 Jul 2017 21:22:46 +0000 (23:22 +0200)]
Merge branch 'evpn-prep'

First 12-and-a-half commits from PR #619

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoMerge pull request #786 from dwalton76/bgpd-peergroup-activate
Russ White [Mon, 10 Jul 2017 21:11:56 +0000 (17:11 -0400)]
Merge pull request #786 from dwalton76/bgpd-peergroup-activate

bgpd: peer-group members 'activate' when they shouldn't

6 years agolib: Remove typedef from ipaddr
Donald Sharp [Fri, 26 May 2017 17:44:29 +0000 (13:44 -0400)]
lib: Remove typedef from ipaddr

The ipaddr_t type was conflicting with code on omnios.

Remove the typedef

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge commit '3d22338f04d9554fa' into evpn-prep
David Lamparter [Mon, 10 Jul 2017 20:15:19 +0000 (22:15 +0200)]
Merge commit '3d22338f04d9554fa' into evpn-prep

Conflicts:
lib/Makefile.am

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoMerge pull request #733 from dwalton76/bgpd-ipv4-plus-label-misc3
Russ White [Mon, 10 Jul 2017 19:05:13 +0000 (15:05 -0400)]
Merge pull request #733 from dwalton76/bgpd-ipv4-plus-label-misc3

bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table

6 years agobgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Daniel Walton [Mon, 10 Jul 2017 14:08:43 +0000 (14:08 +0000)]
bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
6 years agoMerge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label...
Daniel Walton [Mon, 10 Jul 2017 13:06:19 +0000 (13:06 +0000)]
Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3

Conflicts:
bgpd/bgp_route.c
bgpd/bgp_zebra.c

6 years agoMerge pull request #750 from donaldsharp/bgp_buffer
Martin Winter [Fri, 7 Jul 2017 19:18:19 +0000 (12:18 -0700)]
Merge pull request #750 from donaldsharp/bgp_buffer

Bgp buffer

6 years agobgpd: peer-group members 'activate' when they shouldn't
Daniel Walton [Fri, 7 Jul 2017 19:09:22 +0000 (19:09 +0000)]
bgpd: peer-group members 'activate' when they shouldn't

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Today if you configure the following where the 'fabric' peer-group has
been deactivated for ipv4 unicast and then assign swp1/swp2 to that
peer-group we end up activating those two peers for ipv4 unicast.

conf t
no router bgp 100
router bgp 100
  neighbor fabric peer-group
  neighbor fabric capability extended-nexthop
  neighbor fabric remote-as external
  !
  address-family ipv4 unicast
    no neighbor fabric activate
  !
  neighbor swp1 interface peer-group fabric
  neighbor swp2 interface peer-group fabric
  neighbor 1.1.1.1 peer-group fabric
end

cel-redxp-10# show run bgp
!
router bgp 100
 neighbor fabric peer-group
 neighbor fabric remote-as external
 neighbor fabric capability extended-nexthop
 neighbor swp1 interface peer-group fabric
 neighbor swp2 interface peer-group fabric
 neighbor 1.1.1.1 peer-group fabric
 !
 address-family ipv4 unicast
  no neighbor fabric activate
  neighbor swp1 activate
  neighbor swp2 activate
 exit-address-family
!
cel-redxp-10#

With the patch we do not activate swp1/swp2

cel-redxp-10# show run bgp
!
router bgp 100
 neighbor fabric peer-group
 neighbor fabric remote-as external
 neighbor fabric capability extended-nexthop
 neighbor swp1 interface peer-group fabric
 neighbor swp2 interface peer-group fabric
 neighbor 1.1.1.1 peer-group fabric
 !
 address-family ipv4 unicast
  no neighbor fabric activate
 exit-address-family
!
cel-redxp-10#

6 years agoMerge pull request #778 from qlyoung/fix-excess-docstring
Russ White [Fri, 7 Jul 2017 17:31:08 +0000 (13:31 -0400)]
Merge pull request #778 from qlyoung/fix-excess-docstring

Fix excess docstring

6 years agoMerge pull request #779 from qlyoung/update-docs
Martin Winter [Thu, 6 Jul 2017 22:32:43 +0000 (15:32 -0700)]
Merge pull request #779 from qlyoung/update-docs

doc: update build docs for ubuntu

6 years agolib: fix more docstrings
Quentin Young [Thu, 6 Jul 2017 20:27:48 +0000 (16:27 -0400)]
lib: fix more docstrings

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #777 from qlyoung/fix-mpls-str2label
David Lamparter [Thu, 6 Jul 2017 17:35:06 +0000 (19:35 +0200)]
Merge pull request #777 from qlyoung/fix-mpls-str2label

zebra: fix mpls_str2label()

6 years agoMerge pull request #781 from opensourcerouting/vty-out-bufresize
Quentin Young [Thu, 6 Jul 2017 17:23:33 +0000 (13:23 -0400)]
Merge pull request #781 from opensourcerouting/vty-out-bufresize

lib: fix vty_out with >1024 bytes of output

6 years agolib: fix vty_out with >1024 bytes of output
David Lamparter [Thu, 6 Jul 2017 14:55:33 +0000 (16:55 +0200)]
lib: fix vty_out with >1024 bytes of output

Consuming va_args modifies its internal bits, hence the need to copy
it... but the copying wasn't quite right just yet.

Fixes: 4d5f445 ("lib: add vty_outln()")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoMerge pull request #780 from dwalton76/bgpd-address-family-vty-out
Quentin Young [Wed, 5 Jul 2017 21:17:04 +0000 (17:17 -0400)]
Merge pull request #780 from dwalton76/bgpd-address-family-vty-out

bgpd: "address-family" not displayed in configuration

6 years agobgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Daniel Walton [Wed, 5 Jul 2017 20:46:48 +0000 (20:46 +0000)]
bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
6 years agobgpd: "address-family" not displayed in configuration
Daniel Walton [Wed, 5 Jul 2017 20:14:13 +0000 (20:14 +0000)]
bgpd: "address-family" not displayed in configuration

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label...
Daniel Walton [Wed, 5 Jul 2017 19:41:51 +0000 (19:41 +0000)]
Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3

6 years ago*: fix excess docstring
Quentin Young [Wed, 5 Jul 2017 18:30:36 +0000 (14:30 -0400)]
*: fix excess docstring

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: update build docs for ubuntu
Quentin Young [Wed, 5 Jul 2017 19:30:19 +0000 (15:30 -0400)]
doc: update build docs for ubuntu

cumulus/etc --> tools/etc

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: warn about too much docstring
Quentin Young [Wed, 5 Jul 2017 17:20:21 +0000 (13:20 -0400)]
lib: warn about too much docstring

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agozebra: fix mpls_str2label()
Quentin Young [Wed, 5 Jul 2017 16:56:52 +0000 (12:56 -0400)]
zebra: fix mpls_str2label()

When making improvements to error handling in this code I accidentally
introduced an off-by-one. Fix it.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #742 from qlyoung/hashstats
Martin Winter [Tue, 4 Jul 2017 18:58:10 +0000 (11:58 -0700)]
Merge pull request #742 from qlyoung/hashstats

Hashtable statistics

6 years agolib, vtysh: rebase hashstats
Quentin Young [Fri, 30 Jun 2017 16:56:10 +0000 (16:56 +0000)]
lib, vtysh: rebase hashstats

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: use doubles instead of long doubles
Quentin Young [Fri, 23 Jun 2017 05:14:54 +0000 (05:14 +0000)]
lib: use doubles instead of long doubles

NetBSD can't take the square root of a long double
and we should be fine just using a double here anyway

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: update hash_create(), hash_create_size()
Quentin Young [Mon, 19 Jun 2017 22:49:44 +0000 (22:49 +0000)]
*: update hash_create(), hash_create_size()

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib, vtysh: hashtable statistics
Quentin Young [Mon, 19 Jun 2017 14:22:26 +0000 (14:22 +0000)]
lib, vtysh: hashtable statistics

Adds the ability to name hash tables, and a new cli command that will
show various summary statistics for named hash tables.

Statistics computed are
  - load factor
  - full load factor (see comments)
  - stddev of full load factor

Standard deviation is computed by storing the sum of squares of bucket
lengths. This is somewhat susceptible to overflow. On platforms where a
double is 32 bits, placing 65535 or more elements into a hash table
opens up the potential for overflow, depending on how they are arranged
in buckets (which depends on the hash function). For example, placing
65535 elements into one hash bucket would cause ssq overflow, but
distributing 40000000 elements evenly among 400000 buckets (100 elements
per bucket) would not.

These cases are extremely degenerate, so the vague possibility of
overflow in an informational command is deemed an acceptable tradeoff
for constant time calculation of variance without locks or compromising
efficiency of actual table operations.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add statistics for hash tables
Quentin Young [Tue, 30 May 2017 00:16:52 +0000 (00:16 +0000)]
lib: add statistics for hash tables

Adds a function that calculates various statistics on our implementation
of a hash table. These are useful for evaluating performance.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #771 from qlyoung/printf-madness
Jafar Al-Gharaibeh [Fri, 30 Jun 2017 18:07:23 +0000 (13:07 -0500)]
Merge pull request #771 from qlyoung/printf-madness

lib: printf bugfixes & improvement

6 years agobgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Daniel Walton [Fri, 30 Jun 2017 18:04:50 +0000 (18:04 +0000)]
bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
6 years agoMerge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label...
Daniel Walton [Fri, 30 Jun 2017 17:52:56 +0000 (17:52 +0000)]
Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3

Conflicts:
bgpd/bgp_route.c

6 years agoMerge pull request #740 from donaldsharp/ospf_commands
Jafar Al-Gharaibeh [Fri, 30 Jun 2017 17:28:13 +0000 (12:28 -0500)]
Merge pull request #740 from donaldsharp/ospf_commands

ospfd: Fix 'advanced' type data base show

6 years agolib: printf bugfixes & improvement
Quentin Young [Fri, 30 Jun 2017 16:18:20 +0000 (16:18 +0000)]
lib: printf bugfixes & improvement

* Fix bad format specifier in thread.[ch]
* Move PRINTF_ATTRIBUTE macro to zebra.h
* Use PRINTF_ATTRIBUTE on termtable printers

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #768 from qlyoung/fix-gitignore2
Jafar Al-Gharaibeh [Fri, 30 Jun 2017 15:38:20 +0000 (10:38 -0500)]
Merge pull request #768 from qlyoung/fix-gitignore2

lib, bgpd: fix .gitignore

6 years agoMerge pull request #770 from donaldsharp/zclient
Jafar Al-Gharaibeh [Fri, 30 Jun 2017 15:35:28 +0000 (10:35 -0500)]
Merge pull request #770 from donaldsharp/zclient

Zclient

6 years agoospfd: Fix 'advanced' type data base show
Donald Sharp [Mon, 19 Jun 2017 15:17:57 +0000 (11:17 -0400)]
ospfd: Fix 'advanced' type data base show

Two things:

1) Some advanced 'show ip ospf database'... code
was not working properly.  Fix the cli to handle
this appropriately

2) Consolidate two cli functions into one.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworkscom>
6 years agoMerge pull request #723 from qlyoung/fix-static-pipe-poker-buf
Jafar Al-Gharaibeh [Fri, 30 Jun 2017 15:00:43 +0000 (10:00 -0500)]
Merge pull request #723 from qlyoung/fix-static-pipe-poker-buf

lib: more multithreading infra work

6 years agoMerge pull request #769 from qlyoung/fix-json-int
Russ White [Fri, 30 Jun 2017 14:44:03 +0000 (10:44 -0400)]
Merge pull request #769 from qlyoung/fix-json-int

lib: always use 64-bit integers for json

6 years agoospf6d: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:33:30 +0000 (10:33 -0400)]
ospf6d: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospfd: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:33:09 +0000 (10:33 -0400)]
ospfd: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulunsnetworks.com>
6 years agopimd: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:32:45 +0000 (10:32 -0400)]
pimd: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoripd: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:32:26 +0000 (10:32 -0400)]
ripd: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoripngd: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:32:01 +0000 (10:32 -0400)]
ripngd: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agonhrpd: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:31:34 +0000 (10:31 -0400)]
nhrpd: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoisisd: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:31:09 +0000 (10:31 -0400)]
isisd: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:30:34 +0000 (10:30 -0400)]
eigrpd: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobabeld: Fix zclient cleanup on shutdown
Donald Sharp [Fri, 30 Jun 2017 14:29:58 +0000 (10:29 -0400)]
babeld: Fix zclient cleanup on shutdown

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Fix clang warning
Donald Sharp [Fri, 30 Jun 2017 14:29:14 +0000 (10:29 -0400)]
lib: Fix clang warning

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Make SAFI-1 and SAFI-4 use the same table
Daniel Walton [Fri, 30 Jun 2017 14:24:58 +0000 (14:24 +0000)]
bgpd: Make SAFI-1 and SAFI-4 use the same table

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
6 years agobgpd: Make SAFI-1 and SAFI-4 use the same table
Daniel Walton [Fri, 30 Jun 2017 13:55:47 +0000 (13:55 +0000)]
bgpd: Make SAFI-1 and SAFI-4 use the same table

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
6 years agoMerge pull request #767 from donaldsharp/if_update
Jafar Al-Gharaibeh [Fri, 30 Jun 2017 04:42:21 +0000 (23:42 -0500)]
Merge pull request #767 from donaldsharp/if_update

bgpd, lib, zebra: Fix if_update function to represent what it does

6 years agolib: fix merge error
Quentin Young [Thu, 29 Jun 2017 17:49:45 +0000 (17:49 +0000)]
lib: fix merge error

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: more `show thread cpu`
Quentin Young [Thu, 15 Jun 2017 20:17:44 +0000 (20:17 +0000)]
lib: more `show thread cpu`

Add support for naming pthreads. Also, note that we don't have any
records yet if that's the case.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: make `show thread...` commands mt-aware
Quentin Young [Thu, 15 Jun 2017 19:10:57 +0000 (19:10 +0000)]
lib: make `show thread...` commands mt-aware

This patch fixes up show thread commands so that they know about
and operate on all extant thread_masters, since we can now have multiple
running in any given application.

This change also eliminates a heap use after free that appears when
using a single cpu_record shared among multiple threads. Since struct
thread's have pointers to bits of memory that are freed when the global
statistics hash table is freed, later accesses are invalid. By moving
the stats hash to be unique to each thread_master this problem is
sidestepped.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: mt-safe tracebacks
Quentin Young [Thu, 15 Jun 2017 16:05:19 +0000 (16:05 +0000)]
lib: mt-safe tracebacks

can't be using them statics anymore sonny

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: un-static trash buffer for pipe poker
Quentin Young [Thu, 15 Jun 2017 14:24:51 +0000 (14:24 +0000)]
lib: un-static trash buffer for pipe poker

data races

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: always use 64-bit integers for json
Quentin Young [Thu, 29 Jun 2017 23:05:36 +0000 (23:05 +0000)]
lib: always use 64-bit integers for json

json-c does not (yet) offer support for unsigned integer types, and
furthermore, the docs state that all integers are stored internally as
64-bit. So there's never a case in which we would want to limit,
implicitly or otherwise, the range of an integer when adding it to a
json object.

Among other things this fixes the display of ASN values greater than
(1/2) * (2^32 - 1)

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib, bgpd: fix .gitignore
Quentin Young [Thu, 29 Jun 2017 19:39:36 +0000 (19:39 +0000)]
lib, bgpd: fix .gitignore

gotta ignore clippy stuff

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #746 from qlyoung/vty-outln
Jafar Al-Gharaibeh [Thu, 29 Jun 2017 18:22:37 +0000 (13:22 -0500)]
Merge pull request #746 from qlyoung/vty-outln

vty_outln()

6 years ago*: rebase vty_outln() -> master
Quentin Young [Wed, 28 Jun 2017 16:30:14 +0000 (16:30 +0000)]
*: rebase vty_outln() -> master

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: vty_outln (vty, "") --> vty_out (vty, VTYNL)
Quentin Young [Wed, 21 Jun 2017 18:10:29 +0000 (18:10 +0000)]
*: vty_outln (vty, "") --> vty_out (vty, VTYNL)

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: s/VTY_NEWLINE/VTYNL/g
Quentin Young [Wed, 21 Jun 2017 17:15:40 +0000 (17:15 +0000)]
*: s/VTY_NEWLINE/VTYNL/g

Should be able to fit more vty_out onto one line now

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: use vty_outln
Quentin Young [Wed, 21 Jun 2017 03:10:57 +0000 (03:10 +0000)]
*: use vty_outln

Saves 400 lines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add vty_outln()
Quentin Young [Wed, 21 Jun 2017 02:47:44 +0000 (02:47 +0000)]
lib: add vty_outln()

Like *.println() in some other unspeakable languages

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #701 from qlyoung/mt-safe-cancel
Russ White [Thu, 29 Jun 2017 15:09:24 +0000 (11:09 -0400)]
Merge pull request #701 from qlyoung/mt-safe-cancel

mt-safe thread_cancel()

6 years agoMerge pull request #735 from qlyoung/fix-routemap
Russ White [Thu, 29 Jun 2017 15:06:52 +0000 (11:06 -0400)]
Merge pull request #735 from qlyoung/fix-routemap

Fix routemap

6 years agoMerge pull request #754 from qlyoung/fix-argv-arg
Russ White [Thu, 29 Jun 2017 15:06:15 +0000 (11:06 -0400)]
Merge pull request #754 from qlyoung/fix-argv-arg

use argv->text where appropriate

6 years agoMerge pull request #759 from qlyoung/remove-vty-argparsers
Jafar Al-Gharaibeh [Thu, 29 Jun 2017 14:36:06 +0000 (09:36 -0500)]
Merge pull request #759 from qlyoung/remove-vty-argparsers

*: remove VTY_GET_*

6 years agoMerge pull request #763 from dslicenc/ospfd-network-statement
Jafar Al-Gharaibeh [Thu, 29 Jun 2017 14:35:36 +0000 (09:35 -0500)]
Merge pull request #763 from dslicenc/ospfd-network-statement

lib/ospf/eigrp: enable ospf and eigrp to use more specific network st…

6 years agoMerge remote-tracking branch 'origin/stable/3.0'
Donald Sharp [Thu, 29 Jun 2017 14:10:15 +0000 (10:10 -0400)]
Merge remote-tracking branch 'origin/stable/3.0'

6 years agobgpd, lib, zebra: Fix if_update function to represent what it does
Donald Sharp [Thu, 29 Jun 2017 13:09:23 +0000 (09:09 -0400)]
bgpd, lib, zebra: Fix if_update function to represent what it does

The if_update function was taking the interface name as
input and reapplying it, using strncpy to reapply the name.
This has several issues.  strncpy should not be used
to copy memory in place.  The second issue is that
the interface name is not actually changing when we
update interface to be in the new vrf.

Since every usage of if_update was just reapplying the same
name the interface actually had, just remove that part of
the function and rename it to if_update_to_new_vrf
to represent what it is actually doing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #764 from Jafaral/ospfintaddr
Donald Sharp [Thu, 29 Jun 2017 12:16:30 +0000 (08:16 -0400)]
Merge pull request #764 from Jafaral/ospfintaddr

ospfd: Bring in some OSPF changes lost during Quagga fork

6 years agoospfd: The CLI validates the IP address
Jafar Al-Gharaibeh [Thu, 29 Jun 2017 04:21:14 +0000 (23:21 -0500)]
ospfd: The CLI validates the IP address

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 years agoMerge remote-tracking branch 'origin/stable/2.0'
Donald Sharp [Wed, 28 Jun 2017 23:10:20 +0000 (19:10 -0400)]
Merge remote-tracking branch 'origin/stable/2.0'

6 years agoospfd: Bring in some OSPF useful changes that were lost during Quagga fork
Jafar Al-Gharaibeh [Thu, 27 Aug 2009 15:51:42 +0000 (16:51 +0100)]
ospfd: Bring in some OSPF useful changes that were lost during Quagga fork

  Several changes were made from the original patch to resolve conflicts
  and also to fix various issues that were discovered during testing. Below
  is the original commit message minus a few parts that correspond to code
  that was dropped during bug fixing.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
  ospfd: Extend 'ip ospf area' to take address argument + rationalise ospf enable
* ospfd.c: (general) Clean up the whole running of OSPF on interfaces.
  (add_ospf_interface) taking (struct interface *) arg is pointless here.
  (ospf_is_ready) new helper.
  (ospf_network_run_subnet) Put all the code for choosing whether to enable
  OSPF on a subnet, and if so which area configuration to use, here. If a
  subnet should not be enabled, ensure an existing oi is freed.
  (ospf_network_run_interface) Just call run_subnet for all subnets on an
  interface.
  (ospf_network_run) Just call run_interface for all interfaces.
  (ospf_if_update) Just call run_interface for the given interface.
  (ospf_network_unset) Just call run_subnet for existing ois.
  (ospf_update_interface_area) helper: update area on an oi, or create it.
  (ospf_interface_set) renamed to ospf_interface_area_set for clarity.
  Ensures OSPF is created, then into if_update.
  (ospf_interface_unset) renamed to ospf_interface_area_unset and collapses
  down to simple loop to call run_subnet for all ois.
* ospf_interface.h: add a more general OSPF_IF_PARAM_IS_SET, which does the
  right thing and takes default config into account.
* doc/ospfd.texi: add 'ip ospf area' command.

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
  This patch has been part of Quagga since October 2015

  Orignial Author:    Paul Jakma <paul@quagga.net>
  Date:      Thu Aug 27 16:51:42 2009 +0100

6 years agolib/ospf/eigrp: enable ospf and eigrp to use more specific network statements
Don Slice [Wed, 28 Jun 2017 18:53:27 +0000 (14:53 -0400)]
lib/ospf/eigrp: enable ospf and eigrp to use more specific network statements

Issue reported that a configuration commonly used on other routing implementations
fails in frr.  If under ospf, "network 172.16.1.1/32 area 0" or under eigrp, "network
172.16.1.1/32" is entered, the appropriate interfaces are not included in the routing
protocol.  This was because the code was calling prefix_match, which did not match if
the network statement had a longer mask than the interface being matched.  This fix
takes away that restriction by creating a "lib/prefix_match_network_statement" function
which doesn't care about the mask of the interface.  Manual testing shows both ospf and
eigrp now can be defined with more specific network statements.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoMerge pull request #753 from dslicenc/cm16876-ospfv6-mtu
Olivier Dugeon [Wed, 28 Jun 2017 14:10:58 +0000 (16:10 +0200)]
Merge pull request #753 from dslicenc/cm16876-ospfv6-mtu

ospf6d: fix ifmtu settings when kernel changes values

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 #760 from opensourcerouting/rpm-non-redhat-fix
Donald Sharp [Wed, 28 Jun 2017 13:49:10 +0000 (09:49 -0400)]
Merge pull request #760 from opensourcerouting/rpm-non-redhat-fix

redhat: Fix fallout from PR722 (accidently disabled PIMd on non-Redha…

6 years agoMerge pull request #714 from opensourcerouting/cli_magic_defpy
Donald Sharp [Wed, 28 Jun 2017 13:48:33 +0000 (09:48 -0400)]
Merge pull request #714 from opensourcerouting/cli_magic_defpy

CLI magic: part 1 (DEFPY)

6 years agoospf6d: add buffer length check to ifmtu changes
Don Slice [Wed, 28 Jun 2017 12:37:32 +0000 (08:37 -0400)]
ospf6d: add buffer length check to ifmtu changes

Previous fix was missing the possibility of having to modify the io
buffer size if the kernel reports an new mtu value.  This fix adds
that check.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoredhat: On CentOS/RedHat 6, use python27-devel from iuscommunity.org
Martin Winter [Wed, 28 Jun 2017 02:49:38 +0000 (19:49 -0700)]
redhat: On CentOS/RedHat 6, use python27-devel from iuscommunity.org

FRR requires now Python 2.7 development libraries, but CentOS 6
does not provide this (not in main and not in EPEL library)
This is only a build limitation.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoredhat: Fix fallout from PR722 (accidently disabled PIMd on non-Redhat systems)
Martin Winter [Wed, 28 Jun 2017 02:09:59 +0000 (19:09 -0700)]
redhat: Fix fallout from PR722 (accidently disabled PIMd on non-Redhat systems)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoredhat: python-devel is now a build requirement for main package
Martin Winter [Wed, 28 Jun 2017 01:10:29 +0000 (18:10 -0700)]
redhat: python-devel is now a build requirement for main package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agodebian: python3-dev is now a build requirement for main package
Martin Winter [Wed, 28 Jun 2017 01:09:38 +0000 (18:09 -0700)]
debian: python3-dev is now a build requirement for main package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agodoc: Update to reflect Python Development Library dependency for all builds
Martin Winter [Wed, 28 Jun 2017 01:08:55 +0000 (18:08 -0700)]
doc: Update to reflect Python Development Library dependency for all builds

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoMerge pull request #722 from drizzt/rpm-fixes-2.0
Martin Winter [Wed, 28 Jun 2017 00:03:44 +0000 (17:03 -0700)]
Merge pull request #722 from drizzt/rpm-fixes-2.0

redhat/frr.spec.in: Avoid expand when possible

6 years ago*: remove VTY_GET_*
Quentin Young [Tue, 27 Jun 2017 18:47:03 +0000 (18:47 +0000)]
*: remove VTY_GET_*

CLI validates input tokens, so there's no need to do it in handler
functions anymore.

spatch follows
----------------

@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>

@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>

@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>

@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: argv->arg grab bag
Quentin Young [Tue, 27 Jun 2017 17:42:43 +0000 (17:42 +0000)]
bgpd: argv->arg grab bag

* Pass ->text to functions that now do full string matching
* Remove cases for l2vpn and evpn where they cannot occur

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: more cli-ening
Quentin Young [Mon, 26 Jun 2017 19:08:31 +0000 (19:08 +0000)]
bgpd: more cli-ening

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: use ->text and strmatch where appropriate
Quentin Young [Mon, 26 Jun 2017 18:15:19 +0000 (18:15 +0000)]
*: use ->text and strmatch where appropriate

Still need to go fix all the places where we do a 1-char strncmp...

spatch follows
------------------

@asdf@
expression idx;
@@
<...
 strcmp (
- argv[idx]->arg,
+ argv[idx]->text,
  ...)
...>

@depends on asdf@
expression idx;
@@
<...
- !strcmp (argv[idx]->text,
+ strmatch (argv[idx]->text,
           ...)
...>

@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) == 0
+ strmatch (argv[idx]->text, arg)
...>

@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) != 0
+ !strmatch (argv[idx]->text, arg)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: Make SAFI-1 and SAFI-4 use the same table
Daniel Walton [Tue, 27 Jun 2017 17:46:20 +0000 (17:46 +0000)]
bgpd: Make SAFI-1 and SAFI-4 use the same table

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>