summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-09-19lib: allow 'do' commands in ENABLE_NODEQuentin Young
'do' is syntax sugar that allows the user to execute a command under ENABLE_NODE when in another CLI node. If the user is already in ENABLE_NODE, use of 'do' was previously disallowed. This patch allows it because it makes it easier for us to hack around certain instances of the node synchronization problem with vtysh. Also included is a fix for one of these problems. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-09-12lib: Add json support for 'show version' commandDonald Sharp
Fixes: #1167 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-09-08lib: add #pragma's to ignore flex sign cmp errorQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-08-28lib: "show route-map" is missing from the parserDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> (cherry picked from commit 6d2729e3d793bdc190f5d59b6f9825ab42d80123)
2017-08-11lib: fix prefix list trie corruptionDavid Lamparter
The specific code here needs to establish an absolute order of more specific to less specific possible matches in a prefix list. This is indirectly checked by an assert on insertion, because the "next best" entry is required to be consistent even when joining multiple chains of candidates. Unfortunately, trie_install_fn() would insert entries too far ahead in the chain if another entry with higher sequence number was seen. This breaks the trie and (rightfully) triggers the assertion failure on insert. Fixes: #937 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-09*: reindentreindent-3.0-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-08Merge pull request #783 from opensourcerouting/pw-manager-2Donald Sharp
Add Pseudowire management in Zebra
2017-08-04lib: vty: fix config-write fd leakDavid Lamparter
Since we were only setting vty->wfd in config_write, vty->fd would remain 0 and vty_close() wouldn't close vty->wfd. Clean up the entire fd closing and make it more explicit. We were even trying to write to stdin... [master commit: 10b8a9c] Reported-by: Jorge Boncompte <jbonor@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-08-01zebra: add support for static pseudowiresRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-08-01ospf: Fix segfault if compiled with DEBUGßingen
If OSPF_LS_REFRESH_TIME is 60, min_delay in ospf_refresher_register_lsa function (ospf_lsa.c) would be negative, so index (which is unsigned) would be out of range, causing a segfault. Signed-off-by: ßingen <bingen@voltanet.io>
2017-07-25ldpd: integrate with the pseudowire manager in zebraRenato Westphal
If we receive a notification from zebra indicating that the installation of a pseudowire has failed (e.g. no reachability), send a PW Status notification to the remote peer (or a Label Withdraw if the remote peer doesn't support the PW Status TLV). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-25zebra: add pseudowire managerßingen
Base framework for supporting MPLS pseudowires in FRR. A consistent zserv interface is provided so that any client daemon (e.g. ldpd, bgpd) can install/uninstall pseudowires in a standard way. Static pseudowires can also be implemented by using the same interface. When zebra receives a request to install a pseudowire and the installation in the kernel or hardware fails, a notification is sent back to the client daemon and a new install attempt is made every 60 seconds (until it succeeds). Support for external dataplanes is provided by the use of hooks to install/uninstall pseudowires. Signed-off-by: ßingen <bingen@voltanet.io> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-06-30*: simplify log message lookupQuentin Young
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-05-23lib: remove BGP_ENCAP(V6)_NODELou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-05-22lib: fix array sizes for capability mapQuentin Young
incorrect array sizes causing out of bounds read and potentially incorrect capability settings introduced in 1b322039 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-18Merge pull request #512 from bingen/tmp_lm_relay_asyncDonald Sharp
lm: Make relay label manager async
2017-05-17lib: correctly handle EOF when using poll()Quentin Young
Descriptor owner should handle EOF, not thread.c Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-12lib: use %p specifier for pointersQuentin Young
Fixes builds on ARM Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-11lm: Make relay label manager asyncßingen
To avoid blocking zebra when it's acting as a proxy for an external label manager. Besides: Fix get chunk reconnection. Socket was still being destroyed on failure, so next attempt would never work. Filter out unwanted messages in lm sync sock. Until LDE client sends ZEBRA_LABEL_MANAGER_CONNECT message, zserv doesn't know which kind of client it is, so it might enqueue unwanted messages like interface add, interface up, etc. Changes in this commit discard those messages in the client side in case they arrive before the expected response. Change function name for zclient_connect in label manager to avoid confusion with zclient one. Signed-off-by: ßingen <bingen@voltanet.io>
2017-05-10- Solve the Coverity Scan PW.ASSIGN_WHERE_COMPARE_MEANTHung-Weic Chiu
- Minor refactoring Signed-off-by: Hung-Weic Chiu <sppsorrg@gmail.com>
2017-05-09Merge pull request #469 from qlyoung/fix-list-perm-3.0David Lamparter
lib: fix 'list permutations' (3.0)
2017-05-05lib: fix 'list permutations'Quentin Young
Cyclic graphs ftw Also remove graph pretty printer from permutations.c 'cause it's not really needed anymore Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-04lib: Rename HAVE_POLL to prevent conflicting #definesDonald Sharp
Rename HAVE_POLL to HAVE_POLL_CALL, when compiling with snmp and poll enabled this was causing issues. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-21lib: Add CLI option --moduledir to override default module location (needed ↵Martin Winter
for snap support) Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-04-08lib: Fix debugs to be guarded.Donald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-05lib: Fix missing help stringsDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-04Merge branch 'master'David Lamparter
2017-04-04Merge branch 'stable/2.0'David Lamparter
Fixed minor conflicts from "defaults" change on stable. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-04-04Merge pull request #294 from opensourcerouting/modulesDonald Sharp
Loadable module support
2017-04-04vtysh: handle "show modules" like "show memory"David Lamparter
Preface with line identifying which daemon it applies to. [Also fixes a missed "plugin" -> "module" replace.] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-04-04Merge pull request #321 from donaldsharp/speedDavid Lamparter
Speedy McSpeederson
2017-04-03lib, zebra: Fix CR commentsDonald Sharp
lib -> Add a bit of documentation about what units we are in. zebra -> Fix failure case to be a bit better. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-03lib, zebra: Add ability to pass interface speed up from zebraDonald Sharp
This is a prepatory commit for future improvements. Add a change to the zapi to pass the interface speed up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-02lib: fix proto_redistnum() oversight from #257Quentin Young
proto_redistnum() now accepts full protocol strings and not partial names per #10 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-04-01lib: fix usage of getgrouplist() in *BSDMike Tancsa
On BSD systems, the getgrouplist() function returns 0 if successful and -1 on error. Linux in the other hand returns *ngroups (the number of groups of which user is a member) on success and -1 on error. Given this difference, the most portable way to use getgrouplist() is use its return value only for checking if it succeeded or not. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-30Rename: FreeRangeRouting FRRoutingLou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2017-03-30Merge pull request #296 from opensourcerouting/ldpd-sighupDonald Sharp
ldpd: do a full configuration reload upon receiving a SIGHUP
2017-03-28lib: sandbox: print vtysh daemon targetsDavid Lamparter
This is very useful to check whether a command disappeared from a specific daemon (by comparing against an earlier output of "grammar find-ambiguous printall nodescan") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-28vtysh: parsing fixes on distribute-listDavid Lamparter
The vtysh preprocessing stuff doesn't like the first argument to install_element() being something other than a _NODE constant, and the comment hack wasn't cutting it... just expand this. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-28*: apply DEFUN_NOSH for node-switch CLI commandsDavid Lamparter
These have copies in vtysh that do the node-switch locally and are listed in extract.pl's ignore list. The ignore list however is redundant since DEFUN_NOSH does the same thing... ldpd is a bit hacky, but Renato is reworking this anyway. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-28*: track version & "defaults" in configsDavid Lamparter
[CF]: Move default name to autoconf and update tests Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-03-27ldpd: ignore the SIGHUP signal in the child processesRenato Westphal
Only the parent process should handle the SIGHUP signal, but we need to make sure that this signal is ignored in the child processes so a command like "killall -SIGHUP ldpd" won't kill ldpd. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-03-25*: snmp: convert into modulesDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-25build: split off libfrrsnmpDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-25lib: add hook infrastructureDavid Lamparter
Please refer to lib/hook.h for a description/documentation. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-24lib: add "show modules" CLI commandDavid Lamparter
(for simplicity, this is stuffed in with memory_vty.c) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-24lib: dynamic module loadingDavid Lamparter
This adds a "-M" option to each daemon, to load dynamic modules at startup. Modules are by default located in /usr/lib/frr/modules (lib64 if appropriate). Unloading or loading at runtime is not supported at this point to keep things simple. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-24lib: remove unused add_snmp_pollfds()David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-21Merge pull request #285 from bingen/label_manager_3Donald Sharp
Implement generic label manager
2017-03-20Implement generic label managerßingen
Label Manager allows to share MPLS label space among different daemons. Each daemon can request a chunk of consecutive labels and release it if it doesn't need them anymore. Label Manager stores the daemon protocol and instance to identify the owner client. It uses them to perform garbage collection, releasing all label chunks from a client when it gets disconnected or reconnected. Additionally, every client can request that the chunk is never garbage collected. In that case client has the responsibility to release non-used labels. Zebra can host the label manager itself (if no -l param is provided) or connect to an external one using zserv/zclient (providing its address with -l param). Client code is in lib/zclient.c, but currently only LDP is using it. TODO: Allow for custom ranges requests, i.e., specify the start label besides the chunk. TODO: Release labels from LDP. Signed-off-by: Bingen Eguzkitza <bingen@voltanet.io>