summaryrefslogtreecommitdiffstats
path: root/ripd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: remove -r from daemons except zebraQuentin Young2018-05-211-11/+18
| | | | | | | | | | | | | | | | | | | | | | This option is only implemented by 4 daemons: - BGPD - RIPD - RIPNGD - Zebra Manpages and documentation say that the option causes routes to not be uninstalled from zebra when the daemon terminates. This is true for RIPD and RIPNGD. This is not true for BGPD; in that daemon it only prevents transmission of Cease / Peer Unconfig NOTIFICATION messages to peers. Moreover, when any daemon disconnects from Zebra, all of its routes are uninstalled from Zebra and the kernel regardless of this option, rendering the option largely vestigial. It is still useful in Zebra, where it prevents all routes from being uninstalled when Zebra shuts down, so it is left there. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ripd: rip_snmp.c - Remove not needed checkIlya Shipitsin2018-04-111-1/+1
| | | | | | | | | | | | rn cannot be null here issue detected by cppcheck: [ripd/rip_snmp.c:208] -> [ripd/rip_snmp.c:207]: (warning) Either the condition 'if(rn&&!strncmp(i->name,ifp->name,INTERFACE_NAMSIZ))' is redundant or there is possible null pointer dereference: rn. Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-278-111/+111
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ripd: considering a interface with 2 or more IPlyq1402018-03-211-9/+27
| | | | | | | | | | | | | This commit fixes these three issues: 1) rinfo is used for rip packet sending not tmp_rinfo 2) With RIP_SPLIT_HORIZON and an interface with more than 1 ip addresses we will not send the routes out an interface that they originate on 3) With RIP_SPLIT_HORIZON_POISONED_REVERSE and an interface with more than 1 ip address we will not send out ipA with a metric of 16 and ipb with a metric of 1. Both will be 16 now. Signed-off-by: lyq140 <34637052+lyq140@users.noreply.github.com>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-065-38/+28
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* Merge pull request #1701 from donaldsharp/zapi_vrf_labelMartin Winter2018-02-141-1/+1
|\ | | | | Zapi vrf label
| * *: 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>
* | ripd: Fix crash when ip rip split-horizon poisoned-reverse is configedDonald Sharp2018-02-071-4/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | The code was attempting to access a variable that would always be NULL. In fact this code has been broken since the rip ECMP changes were put into place a few years back. I'm going to come straight out and say that I don't fully understand this code. rinfo is the first item in the ecmp list and tmp_rinfo is used to iterate over all the items in the ecmp list. It sure looks like that the changes made here were just hacked together. So I modified the tmp_rinfo loop to just work on tmp_rinfo and the check that was crashing I modified to just use the rinfo since that what was checked originally in code before the ECMP was added. So consider this a hack job to stop the crashing. I think worse case is that we might be sending some routes back out interfaces it shouldn't be if you have ip rip split-horizon poisoned-reverse configured but that is less bad(tm) than crashing. Fixes: #1717 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Send/receive the nexthop vrf_idDonald Sharp2018-01-121-0/+1
| | | | | | | Modify the code to send and receive to/from zebra the nexthops vrf_id. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Remove cvs control pointsDonald Sharp2017-12-051-2/+0
| | | | | | | | The $Id: lines would allow code kept in cvs to substitute the file version upon checkout. Since we are not using cvs there is no need to keep these lines anymore. 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>
* ripd: Fix SA issuesDonald Sharp2017-11-161-2/+2
| | | | | | | | | | | The rinfo variable was being set but never used. We just need to call rip_ecmp_replace or rip_ecmp_add this function does not care about the return values because the rinfo returned is stored on the rip route entry. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ripd: Fix spelling mistake in debugDonald Sharp2017-11-161-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ripd: Allow rip_redistribute_add to know the nexthop typeDonald Sharp2017-11-164-34/+61
| | | | | | | | | Allow rip_redistribute_add to receive and properly store the nexthop type passed up from zebra. Additionally display the different nexthop types appropriately. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ripd: Convert to using 'struct nexthop' for nexthop informationDonald Sharp2017-11-165-27/+30
| | | | | | | | | | | RIP is not using the nexthop data structure and as such when it does not fully understand when it receives some of the more exotic nexthop types what to do with it. This is the start of a series of commits to allow RIP to start understanding and properly displaying information about different nexthop types. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Modify zclient_init to require privs dataDonald Sharp2017-10-241-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ripd: Make 'struct zebra_privs_t' availableDonald Sharp2017-10-243-5/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-102-13/+13
| | | | | | | | | | 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>
* *: eliminate IFINDEX_DELETED in favor of IFINDEX_INTERNALRenato Westphal2017-10-101-4/+1
| | | | | | | | | IFINDEX_DELETED is not necessary anymore as we moved from a global list of interfaces to a list of interfaces per VRF. This reverts commit 84361d615. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal2017-10-102-26/+26
| | | | | | | | | | | 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>
* *: use argv[]->text instead of argv[]->arg when appropriateRenato Westphal2017-10-061-12/+4
| | | | | | | | Incomplete commands like "debug ospf6 route mem" were being ignored. The changes in ripd and ripngd are intended to make the code easier to read, no bugs were fixed in these two daemons. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: Convert list_free usage to list_deleteDonald Sharp2017-10-051-2/+1
| | | | | | | | | | list_free is occassionally being used to delete the list and accidently not deleting all the nodes. We keep running across this usage pattern. Let's remove the temptation and only allow list_delete to handle list deletion. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-052-2/+2
| | | | | | | | | | | | | | | | | | | Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1215 from opensourcerouting/zapi_nexthopsDonald Sharp2017-09-221-0/+2
|\ | | | | *: fix segfault when sending more than MULTIPATH_NUM nexthops
| * *: fix segfault when sending more than MULTIPATH_NUM nexthopsRenato Westphal2017-09-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a fallout from PR #1022 (zapi consolidation). In the early days, the client daemons would allocate enough memory to send all nexthops to zebra. Then zebra would add all nexthops to the RIB and respect MULTIPATH_NUM only when installing the routes in the kernel. Now things are different and the client daemons can send at most MULTIPATH_NUM nexthops to zebra, and failure to respect that will result in a buffer overflow. The MULTIPATH_NUM limit in the new zebra API is a small price we pay to avoid allocating memory for each route sent to zebra. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | ripd: Free leaked memory on shutdownDonald Sharp2017-09-211-0/+1
|/ | | | | | | Usage of the address sanitizer and topotests showed that rip was leaking obuf on shutdown Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: make all daemons call frr_fini() on exitRenato Westphal2017-09-121-0/+1
| | | | | | This allow us to find real leaks more easily with tools like valgrind. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ripd: Fix warning about metric value less than 0Donald Sharp2017-09-051-2/+1
| | | | | | | | | | | | | RIP is testing to ensure that the metric returned isn't negative. We should be looking at the returned value from the cli strtol. If we get a metric value that is less than zero that means that we shouldn't use this value in RIP currently. So signify that by returning mod here. Fixes: #1107 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1075 from donaldsharp/rip_metricDavid Lamparter2017-09-051-16/+25
|\ | | | | lib, ospfd, ripd, ripngd: Fix 'set metric'
| * lib, ospfd, ripd, ripngd: Fix 'set metric'Donald Sharp2017-08-291-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a variety of cli's associated with the 'set metric ...' command. The problem that we are experiencing is that not all the daemons support all the varieties of the set metric and the returned of NULL during the XXX_compile phase for these unsupported commands is causing issues. Modify the code base to only return NULL if we encounter a true parsing issue. Else we need to keep track if this metric applies to us or not. In the case of rip or ripngd if the metric passed to us is greater than 16 just turn it internally into a MAX_METRIC. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #1078 from dwalton76/ospfd-network-cmd-warningRenato Westphal2017-08-311-3/+3
|\ \ | | | | | | *: return CMD_WARNING if command was already configured
| * | *: return CMD_WARNING if command was already configuredDaniel Walton2017-08-311-3/+3
| |/ | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> If the user configures some command that is already in the config we should return CMD_WARNING instead of CMD_WARNING_CONFIG_FAILED
* | Merge pull request #1044 from donaldsharp/combinationJafar Al-Gharaibeh2017-08-311-0/+1
|\ \ | | | | | | Coverity Cleanup of Stuff
| * | *: fix assorted issues detected by Coverity ScanRenato Westphal2017-08-251-0/+1
| |/ | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* / *: 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>
* *: use zapi_route to send/receive redistributed routes as wellRenato Westphal2017-08-241-52/+19
| | | | | | | | | | | | | | | | | | 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>
* ripd/ripngd: use the new API to send routes to zebraRenato Westphal2017-08-231-22/+14
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: remove leftovers from "router zebra"Renato Westphal2017-08-231-53/+0
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: reduce excessive indentation in a few placesRenato Westphal2017-08-231-91/+88
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #1009 from donaldsharp/show_cmdsDavid Lamparter2017-08-211-6/+6
|\ | | | | Show cmds
| * *: Add 'show debugging' command from vtyshDonald Sharp2017-08-211-6/+6
| | | | | | | | | | | | | | Allow vtysh to query every daemon about its debugging status in one go. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | 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>
* Merge pull request #911 from opensourcerouting/non-recursive-2Donald Sharp2017-08-094-40/+53
|\ | | | | more non-recursive build, fix cross-compile, & doc build mangling
| * build: non-recursive ripd & ripngdDavid Lamparter2017-08-044-40/+53
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: Define the number of seconds in a Day, Week and yearDonald Sharp2017-08-081-4/+0
|/ | | | | | | | | | | | | The defines: ONE_DAY_SECOND ONE_WEEK_SECOND ONE_YEAR_SECOND were being defined all over the system, move the define to a central location. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ripd: Fix debug config failuresDonald Sharp2017-07-241-3/+3
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Revert "*: reindent pt. 2"David Lamparter2017-07-224-13/+7
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindent pt. 2whitespace / reindent2017-07-174-7/+13
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-1713-6899/+6581
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>