summaryrefslogtreecommitdiffstats
path: root/nhrpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: Track vrfs per nexthop not per route entryDonald Sharp2018-02-091-1/+1
| | | | | | | Track the vfrs on a per nexthop basis instead of on a per route entry basis. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Send/receive the nexthop vrf_idDonald Sharp2018-01-121-0/+2
| | | | | | | Modify the code to send and receive to/from zebra the nexthops vrf_id. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Make zapi route install Notifications optionalDonald Sharp2017-11-271-1/+1
| | | | | | | | | | | Allow the higher level protocol to specify if it would like to receive notifications about it's routes that it has installed. I've purposely made it part of zclient_new_notify because we need to track the routes on a per daemon basis only. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: add missing \n in some help stringsRenato Westphal2017-10-241-2/+2
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: Modify zclient_init to require privs dataDonald Sharp2017-10-241-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* nhrpd: Let struct zebra_privs_t be availableDonald Sharp2017-10-242-1/+3
| | | | signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-102-6/+6
| | | | | | | | | | This improves code readability and also future-proofs our codebase against new changes in the data structure used to store interfaces. The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but for now only babeld is using it. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: introduce new rb-tree to optimize interface lookup by ifindexRenato Westphal2017-10-101-1/+1
| | | | | | | | | | | | | | | | Performance tests showed that, when running on a system with a large number of interfaces, some daemons would spend a considerable amount of time in the if_lookup_by_index() function. Introduce a new rb-tree to solve this problem. With this change, we need to use the if_set_index() function whenever we want to change the ifindex of an interface. This is necessary to ensure that the 'ifaces_by_index' rb-tree is updated accordingly. The return value of all insert/remove operations in the interface rb-trees is checked to ensure that an error is logged if a corruption is detected. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal2017-10-102-10/+10
| | | | | | | | | | | This is an important optimization for users running FRR on systems with a large number of interfaces (e.g. thousands of tunnels). Red-black trees scale much better than sorted linked-lists and also store the elements in an ordered way (contrary to hash tables). This is a big patch but the interesting bits are all in lib/if.[ch]. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* nhrpd: Add hash table namesDonald Sharp2017-09-054-4/+12
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1056 from opensourcerouting/oldbits-0Donald Sharp2017-08-291-2/+2
|\ | | | | "pathspace" options, vtysh-suid-cleanups, "vty_frame()"
| * *: remove empty "interface XYZ" config blocksDavid Lamparter2017-08-291-2/+2
| | | | | | | | | | | | | | | | Using the previously-added vty_frame() support, this gets rid of all the pointless empty "interface XYZ" blocks that get added for any interface that shows up in the system (e.g. dummys, tunnels, etc.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: remove ZEBRA_FLAG_{BLACKHOLE,REJECT} from APIDavid Lamparter2017-08-281-2/+4
|/ | | | | | | | FLAG_BLACKHOLE is used for different things in different places. remove it from the zclient API, instead indicate blackholes as proper nexthops inside the message. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use zapi_route to send/receive redistributed routes as wellRenato Westphal2017-08-241-67/+28
| | | | | | | | | | | | | | | | | | Some differences compared to the old API: * Now the redistributed routes are sent using address-family independent messages (ZEBRA_REDISTRIBUTE_ROUTE_ADD and ZEBRA_REDISTRIBUTE_ROUTE_DEL). This allows us to unify the ipv4/ipv6 zclient callbacks in the client daemons and thus remove a lot of duplicate code; * Now zebra sends all nexthops of the redistributed routes to the client daemons, not only the first one. This shouldn't have any noticeable performance implications and will allow us to remove an ugly exception we had for ldpd (which needs to know all nexthops of the redistributed routes). The other client daemons can simply ignore the nexthops if they want or consult just the first one (e.g. ospfd/ospf6d/ripd/ripngd). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* nhrpd: unify ipv4/ipv6 zebra-tx functionsRenato Westphal2017-08-241-61/+34
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* nhrpd: use the new API to send routes to zebraRenato Westphal2017-08-231-24/+28
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* babeld/eigrpd/ldpd/nhrpd: add prefix length sanity checksRenato Westphal2017-08-231-1/+2
| | | | | | Pulled from d917882. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* babeld/nhrpd: ignore ipv6 srcdest routesRenato Westphal2017-08-231-0/+12
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #1009 from donaldsharp/show_cmdsDavid Lamparter2017-08-211-5/+5
|\ | | | | Show cmds
| * *: Add 'show debugging' command from vtyshDonald Sharp2017-08-211-5/+5
| | | | | | | | | | | | | | Allow vtysh to query every daemon about its debugging status in one go. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #929 from opensourcerouting/hooks-doc-irdpDonald Sharp2017-08-212-9/+4
|\ \ | |/ |/| hook improvements, more hooks, doc example, IRDP cleanup
| * lib: replace if_add_hook with hook_* logicDavid Lamparter2017-08-151-2/+2
| | | | | | | | | | | | | | This allows modules to register their own additional hooks on interface creation/deletion. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: centralize some exit cleanup into libfrrDavid Lamparter2017-08-151-7/+2
| | | | | | | | | | | | | | | | Start creating a counterpart to frr_init and frr_late_init. Unfortunately, some daemons don't do any exit handling, this doesn't change that just yet. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | nhrpd: use hop count 1 for registration requestsTimo Teräs2017-08-171-1/+1
|/ | | | | | | | | Cisco has a bug that it rejects packets with zero hop count. Use one to avoid potential forwarding of registration requests. Fixes #951 Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* nhrpd: fixes for clang scan-build issuesJorge Boncompte2017-08-111-4/+7
| | | | Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
* nhrpd: fix issues found by coverityJorge Boncompte2017-08-1010-18/+41
| | | | Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
* Merge pull request #911 from opensourcerouting/non-recursive-2Donald Sharp2017-08-094-47/+54
|\ | | | | more non-recursive build, fix cross-compile, & doc build mangling
| * build: non-recursive nhrpdDavid Lamparter2017-08-044-47/+54
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | nhrp: fix assertion with negative holding timesJorge Boncompte2017-08-041-1/+1
| | | | | | | | | | | | Correctly reset status or we later assert at nhrp_cache_free(). Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
* | nhrp: fix initialization and route redistribution registrationJorge Boncompte2017-08-041-20/+18
| | | | | | | | | | | | | | nhrpd wasn't registering correctly with zebra for route redistribution. It wasn't neither parsing the right messages nor parsing them correctly too. Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
* | nhrp: initialize interfaces after VRFsJorge Boncompte2017-08-041-1/+1
|/ | | | | | | Interfaces depend logically of VRF, initialize one after another just in case in the future someone adds something to this functions. Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
* nhrpd: enable -WerrorDavid Lamparter2017-07-141-1/+1
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix GCC 7 warnings/issuesDavid Lamparter2017-07-141-1/+0
| | | | | | | The label initializer & nhrpd variable are just to shut up GCC 7, the other two are actual bugs. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix GCC 7 switch/case fallthrough warningsDavid Lamparter2017-07-142-1/+4
| | | | | | Need a comment on these. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-2/+2
|\ | | | | | | | | | | Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * vtysh: return non-zero for configuration failuresDaniel Walton2017-07-131-2/+2
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
* | *: remove VTYNL, part 6 of 6David Lamparter2017-07-141-4/+2
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: remove VTYNL, part 3 of 6David Lamparter2017-07-141-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: remove VTYNL, part 1 of 6David Lamparter2017-07-141-1/+1
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: ditch vty_outln(), part 2 of 2David Lamparter2017-07-141-3/+3
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-36/+36
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: update hash_create(), hash_create_size()Quentin Young2017-07-024-4/+4
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* nhrpd: Fix zclient cleanup on shutdownDonald Sharp2017-06-301-0/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: vty_outln (vty, "") --> vty_out (vty, VTYNL)Quentin Young2017-06-291-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: s/VTY_NEWLINE/VTYNL/gQuentin Young2017-06-291-3/+3
| | | | | | Should be able to fit more vty_out onto one line now Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use vty_outlnQuentin Young2017-06-291-90/+78
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #754 from qlyoung/fix-argv-argRuss White2017-06-291-1/+1
|\ | | | | use argv->text where appropriate
| * *: use ->text and strmatch where appropriateQuentin Young2017-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | *: remove VTY_GET_*Quentin Young2017-06-271-4/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* *: simplify log message lookupQuentin Young2017-06-211-2/+2
| | | | | | | | | | | | | | | | 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>