Commit Graph

7856 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
f30a73277c Merge pull request #749 from qlyoung/fix-json-cli
lib: look at the correct token for json
2017-06-26 14:18:56 -05:00
Daniel Walton
4fbf55e986 Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-ipv4-plus-label-misc3 2017-06-26 17:24:44 +00:00
Daniel Walton
292caba3ba bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-06-26 17:22:14 +00:00
Don Slice
0c7ef48afe ospf6d: fix ifmtu settings when kernel changes values
Problem reported by customer that if an mtu value was set in the kernel,
quagga/frr would get very confused about what had been configured and
what had been learned.  This caused peers to not be successfully established.
Resolved by keeping a configuration value separate than the operational value
and set the operational accordingly.  If configured, it wins unless the config
defines a value that is higher than the kernel supports.

Ticket: CM-16876
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed By: CCR-6399
Testing Done: Manual testing successful, submitter tested, ospf-smoke completed
with no new failures.
2017-06-26 11:07:23 -04:00
Jafar Al-Gharaibeh
a1781c9347 Merge pull request #704 from chiragshah6/pim_dev_3_0
ospfd: ospf bandwidth handling
2017-06-23 10:29:27 -05:00
Donald Sharp
434f472158 bgpd: Refactor looping for talking to zebra
The data for each nexthop is stored off of the info
pointer, instead of handling the first one and then looping
over the remaining, just loop over them all and handle the
first one as a special case.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-22 14:28:23 -04:00
Donald Sharp
d1e7e033fd bgpd: Make buffer sizes automatically the correct size
In the bgp code to send routes to zebra we were spending
a non trivial amount of time managing buffer sizes.
We know a priori the multipath supported by our system
so let's just use that value to appropriately size
the buffers.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-22 13:39:47 -04:00
Quentin Young
5046f07672 lib: look at the correct token for json
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-22 00:19:24 +00:00
Quentin Young
e82a17c61b lib: actually exit when asked to do so
When vtysh sends 'exit' to a daemon, we set the vty->status to
VTY_CLOSE but never actually close the connection. Lovely.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-21 20:06:44 +00:00
Quentin Young
b2e266663b vtysh: fix various show commands
need 'do' to force ENABLE_NODE

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-21 18:42:17 +00:00
Olivier Dugeon
8ea37652c7 Merge pull request #745 from qlyoung/fix-lookup
*: simplify log message lookup
2017-06-21 18:22:52 +02:00
Quentin Young
af3346ecd5 lib: some minor cli fixups for routemap
Need to use the appropriate token field

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-21 15:41:35 +00:00
Quentin Young
56b4067930 *: simplify log message lookup
log.c provides functionality for associating a constant (typically a
protocol constant) with a string and finding the string given the
constant. However this is highly delicate code that is extremely prone
to stack overflows and off-by-one's due to requiring the developer to
always remember to update the array size constant and to do so correctly
which, as shown by example, is never a good idea.b

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

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-21 15:22:21 +00:00
Daniel Walton
c1a44e4367 Merge branch 'master' into bgpd-ipv4-plus-label-misc3 2017-06-21 10:30:29 -04:00
Christian Franke
cd35442a89 isisd: fix to adhere to new cli api 2017-06-20 22:49:37 +02:00
Christian Franke
e4220cb4f3 isisd: fix memtype counting issue 2017-06-20 22:48:36 +02:00
Christian Franke
113b1946e3 isisd: adjust redist functionality to current zapi 2017-06-20 22:47:54 +02:00
Christian Franke
b59fee54db isisd: fix formatting in metrics when showing database 2017-06-20 22:46:41 +02:00
Daniel Walton
bf468c3ca5 bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-06-20 19:53:27 +00:00
Daniel Walton
0826e83cf6 bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-06-20 14:50:00 +00:00
Russ White
2ca0207721 Merge pull request #741 from qlyoung/fix-vtysh-buffer-overrun
vtysh: fix stack buffer overflow
2017-06-19 22:02:49 -04:00
Russ White
4ce856eef7 Merge pull request #698 from dslicenc/cm16737-srgb-block
zebra: define default segment routing global block values
2017-06-19 22:00:57 -04:00
Russ White
ea52147f10 Merge pull request #707 from donaldsharp/debian_babel
tools: Fix startup to include babel
2017-06-19 21:58:36 -04:00
Russ White
7ee5d889e1 Merge pull request #728 from donaldsharp/owner
bgpd: Remove unset table.owner
2017-06-19 21:55:43 -04:00
Russ White
bfd93d11b8 Merge pull request #731 from qlyoung/fix-bgp-misc-cli
bgpd: fix misc cli ranges & config writes
2017-06-19 21:53:05 -04:00
Russ White
a88bbcb8a0 Merge pull request #732 from qlyoung/coverity-memes
lib: termtable coverity warnings
2017-06-19 21:52:10 -04:00
Donald Sharp
d368cd48b9 Merge pull request #730 from opensourcerouting/rbtree-improvement
RB tree improvement
2017-06-19 17:27:55 -04:00
Quentin Young
c25c61370f vtysh: fix stack buffer overflow
VARIABLE accepts arbitrary input

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-19 20:37:43 +00:00
Rafael Zalamena
b19ad86195 lib: fix __unused compilation on old platforms
Expand the macro __attribute__ to avoid problem with old platforms that
do not define this.
2017-06-19 13:24:04 -03:00
Rafael Zalamena
5508764270 lib: rename rb_tree to fix NetBSD compilation
Change rb_tree struct name to rbt_tree to avoid conflicts with NetBSD.
2017-06-19 13:17:35 -03:00
Quentin Young
58b0878ac6 ospfd: fix route-map brokenness
ospf redefines the standard route map commands which causes ambiguity
issues in the CLI parser, it also uses a signed integer to hold an
unsigned quantity leading to weirdness when specifying metrics larger
than 2,147,483,647

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-17 00:49:15 +00:00
Quentin Young
98f224ef22 lib: improve routemap error messages
indicate which daemon was the source of the message and that it may be a
question of daemon support rather than a malformed argument

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-16 22:43:09 +00:00
Donald Sharp
6021c8d382 lib: Fix ordering of RB Tree
So the *bsd implementations of RB Tree's for older
platforms use a macro implementation.  New platforms
have converted to a function implementation that uses
a different calling parameter list.  So when
we attempt to build FRR on older *bsd implementations
the macro's and functions do not interact too well.

As a workaround put the openbsd-tree.h #include
inside of zebra.h at a point before the particular
platforms version is included.  Since we use
the same #if guard for the header we should be ok.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-16 17:48:18 -04:00
Renato Westphal
522faa1f8b ldpd: fix fallouts from the rb-tree conversion
Signed-off-by: Renato Westphal <renato@openbsd.org>
2017-06-16 17:30:35 -03:00
David Lamparter
2dc1ef552b Merge pull request #725 from donaldsharp/vrf_completion
Vrf completion
2017-06-16 21:59:23 +02:00
Quentin Young
7feb7d7e65 lib: tighten up exit semantics for thread_fetch()
* Account for the pipe poker in poll() by explicitly returning NULL when
  we have no events, timers or file descriptors to work with
* Add a comment explaining exactly what we are doing and why

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-16 19:56:58 +00:00
Quentin Young
8797240ea4 lib: mt-safe cancel, round deux
* Update pollfds copy as well as the original
* Keep array count for copy in thread_master
* Remove last remnants of POLLHUP in .events field
* Remove unused snmpcount (lolwut)
* Improve docs
* Add missing do_thread_cancel() call in thread_cancel_event()
* Change thread_fetch() to always enter poll() to avoid starving i/o
* Remember to free up cancel_req when destroying thread_master
* Fix dereference of null pointer
* Fix dead store to timeval
* Fix missing condition for condition variable :-)

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-16 19:56:58 +00:00
Quentin Young
63ccb9cb12 lib: add mt-safe thread_cancel
This patch implements an MT-safe version of thread_cancel() in
thread_cancel_async(). Behavior as follows:

* Cancellation requests are queued into a list

* Cancellation requests made from the same pthread as the thread_master
  owner are serviced immediately (thread_cancel())

* Cancellation requests made from a separate pthread are queued and the
  call blocks on a condition variable until the owning pthread services
  the request, at which point the condition variable is signaled and
  execution continues (thread_cancel_async())

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-16 19:56:58 +00:00
Quentin Young
430000deee Merge pull request #702 from opensourcerouting/ldpd-cli-rewrite
ldpd: convert cli and get rid of the xml interface
2017-06-16 15:53:50 -04:00
Daniel Walton
9bedbb1e52 bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST table
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>

- All ipv4 labeled-unicast routes are now installed in the ipv4 unicast
  table. This allows us to do things like take routes from an ipv4
  unicast peer, allocate a label for them and TX them to a ipv4
  labeled-unicast peer. We can do the opposite where we take routes from
  a labeled-unicast peer, remove the label and advertise them to an ipv4
  unicast peer.

- Multipath over a labeled route and non-labeled route is not allowed.

- You cannot activate a peer for both 'ipv4 unicast' and 'ipv4
  labeled-unicast'

- The 'tag' variable was overloaded for zebra's route tag feature as
  well as the mpls label. I added a 'mpls_label_t mpls' variable to
  avoid this.  This is much cleaner but resulted in touching a lot of
  code.
2017-06-16 19:12:57 +00:00
Quentin Young
4668a15109 bgpd: fix misc cli ranges & config writes
* Ranges for some MED were 2^32 - 2 instead of 2^32 - 1
* Use correct printf specifiers for unsigned values
* Some drive-by CLI collapsing and simplification

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-16 19:09:05 +00:00
Quentin Young
94b989402f lib: termtable coverity warnings
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-16 19:04:57 +00:00
Renato Westphal
180fc2cd70 ldpd: update copyright information
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-06-16 14:43:55 -03:00
Renato Westphal
c740f7d367 ldpd: convert cli and get rid of the xml interface
The xml2cli.pl script was useful years ago when the vty code was very
rudimentary. This is not the case anymore, so convert all ldpd CLI
commands to use DEFUNs directly and get rid of the XML interface.

The benefits are:
* Consistency with the other daemons;
* One less build dependency (the LibXML perl module);
* Easier to add new commands.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-06-16 14:43:42 -03:00
David Lamparter
18483e8fb3 Merge pull request #713 from qlyoung/fix-zebra-dbz-3.0
Fix zebra div by zero
2017-06-16 19:40:52 +02:00
Donald Sharp
23312e7173 bgpd: Fix as per Code Review comment
Add ending value in the array.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-16 13:12:42 -04:00
Donald Sharp
d7a75a6ca6 lib, vtysh, zebra: Fix per CR comments
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-16 13:09:37 -04:00
Donald Sharp
18c5703710 bgpd: Add view/vrf auto completion to commands
Modify the '<view|vrf> NAME' commands to allow auto-completion
of available choices.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-16 13:01:51 -04:00
Donald Sharp
d617d5febf *: Add vrf autocompletion for commands
Switch NAME to VRFNAME and add vrf autocompletion
to commands that have them

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-06-16 13:01:51 -04:00
Quentin Young
11e2897282 zebra: more dbzing
Revert to the previous <= restrictions, improve error messages, fix the
divide by zero.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-16 16:33:46 +00:00