summaryrefslogtreecommitdiffstats
path: root/ripngd/ripngd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* bgpd lib ospfd pimd ripngd: null chk (PVS-Studio)F. Aragon2018-07-031-2/+3
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* *: fix coverity warnings - resource leaksRenato Westphal2017-10-241-6/+10
| | | | | | | | | | | | | | These are mostly trivial fixes for leaks in the error path of some functions. The changes in bgpd/bgp_mpath.c deserves a bit of explanation though. In the bgp_info_mpath_aggregate_update() function, we were allocating memory for the lcomm variable but doing nothing with it. Since the code for communities, extended communities and large communities is pretty much the same in this function, it's clear that this was a copy and paste error where most of the ext. community code was copied but not all of it as it should have been. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ripngd: Make 'struct zebra_privs_t' availableDonald Sharp2017-10-241-2/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1298 from opensourcerouting/iface-rb-treeDonald Sharp2017-10-161-10/+10
|\ | | | | Use rb-trees to store interfaces instead of linked-lists
| * *: use the FOR_ALL_INTERFACES abstraction from babeldRenato Westphal2017-10-101-5/+5
| | | | | | | | | | | | | | | | | | | | 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>
| * *: use rb-trees to store interfaces instead of sorted linked-listsRenato Westphal2017-10-101-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>
* | ripngd: Fix possible memory leak of route_nodeDonald Sharp2017-10-101-0/+2
|/ | | | | | | There exists a path where we do not save the route_node after creation. Allow cleanup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ripngd: fix clang warningVincent JARDIN2017-10-081-1/+1
| | | | | | this value len is not used for this vty_out() case. Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
* *: Convert list_free usage to list_deleteDonald Sharp2017-10-051-3/+2
| | | | | | | | | | 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-051-1/+1
| | | | | | | | | | | | | | | | | | | 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 #1078 from dwalton76/ospfd-network-cmd-warningRenato Westphal2017-08-311-4/+4
|\ | | | | *: return CMD_WARNING if command was already configured
| * *: return CMD_WARNING if command was already configuredDaniel Walton2017-08-311-4/+4
| | | | | | | | | | | | | | 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
* | *: fix assorted issues detected by Coverity ScanRenato Westphal2017-08-251-0/+2
|/ | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-5/+4
| | | | | | | | | 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-171-4/+5
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-2381/+2295
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter2017-07-141-14/+14
|\ | | | | | | | | | | 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-14/+14
| | | | | | | | | | | | | | 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-7/+5
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: remove VTYNL, part 4 of 6David Lamparter2017-07-141-12/+7
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: remove VTYNL, part 2 of 6David Lamparter2017-07-141-4/+4
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: remove VTYNL, part 1 of 6David Lamparter2017-07-141-4/+4
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: ditch vty_outln(), part 2 of 2David Lamparter2017-07-141-4/+4
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-27/+27
|/ | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: vty_outln (vty, "") --> vty_out (vty, VTYNL)Quentin Young2017-06-291-4/+4
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: s/VTY_NEWLINE/VTYNL/gQuentin Young2017-06-291-11/+11
| | | | | | 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-52/+44
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove VTY_GET_*Quentin Young2017-06-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch 'stable/3.0'David Lamparter2017-06-131-0/+3
|\ | | | | | | | | | | | | | | | | | | | | Dropped: redhat/README.rpm_build.md redhat/daemons redhat/frr.init redhat/frr.logrotate redhat/frr.spec.in Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * ripngd: fix packet buffer memleakQuentin Young2017-06-061-0/+3
| | | | | | | | | | | | Fix #668 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
| * Address the error "Dead assignment" of static analysifHung-Weic Chiu2017-05-101-6/+6
| | | | | | | | | | | | | | - Refer to https://ci1.netdef.org/browse/FRR-FRR4-44/artifact/shared/static_analysis/index.html - Remove unused variable Signed-off-by: Hung-Weic Chiu <sppsorrg@gmail.com>
* | ripngd: Fix missing newlines at end of help stringsDonald Sharp2017-05-281-3/+3
| | | | | | | | | | | | Found by visual inspection and some squinting Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Address the error "Dead assignment" of static analysifHung-Weic Chiu2017-05-101-6/+6
| | | | | | | | | | | | | | - Refer to https://ci1.netdef.org/browse/FRR-FRR4-44/artifact/shared/static_analysis/index.html - Remove unused variable Signed-off-by: Hung-Weic Chiu <sppsorrg@gmail.com>
* | *: update thread_add_* callsQuentin Young2017-05-091-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | *: remove THREAD_ON macros, add nullity checkQuentin Young2017-05-091-8/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way thread.c is written, a caller who wishes to be able to cancel a thread or avoid scheduling it twice must keep a reference to the thread. Typically this is done with a long lived pointer whose value is checked for null in order to know if the thread is currently scheduled. The check-and-schedule idiom is so common that several wrapper macros in thread.h existed solely to provide it. This patch removes those macros and adds a new parameter to all thread_add_* functions which is a pointer to the struct thread * to store the result of a scheduling call. If the value passed is non-null, the thread will only be scheduled if the value is null. This helps with consistency. A Coccinelle spatch has been used to transform code of the form: if (t == NULL) t = thread_add_* (...) to the form thread_add_* (..., &t) The THREAD_ON macros have also been transformed to the underlying thread.c calls. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: apply DEFUN_NOSH for node-switch CLI commandsDavid Lamparter2017-03-281-1/+1
| | | | | | | | | | 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>
* *: Refactor ifindex2ifname to be VRF awareDonald Sharp2017-03-151-8/+8
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Refactor if_lookup_by_name to be VRF awareDonald Sharp2017-03-151-2/+2
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Remove non-vrf based ifindex lookupDonald Sharp2017-03-151-1/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: get rid of zlog(*, LOG_LEVEL, ...)David Lamparter2017-03-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Result of running the following Coccinelle patch + fixups: <<EOF /* long-forms: zlog(NULL, <level>, ...) * => zlog_level(...) */ @@ expression list args; @@ - zlog(NULL, LOG_DEBUG, args) + zlog_debug(args) @@ expression list args; @@ - zlog(NULL, LOG_NOTICE, args) + zlog_notice(args) @@ expression list args; @@ - zlog(NULL, LOG_INFO, args) + zlog_info(args) @@ expression list args; @@ - zlog(NULL, LOG_WARNING, args) + zlog_warn(args) @@ expression list args; @@ - zlog(NULL, LOG_ERR, args) + zlog_err(args) /* long-forms: zlog(base->log, <level>, ...) * => zlog_level(...) */ @@ expression base; expression list args; @@ - zlog(base->log, LOG_DEBUG, args) + zlog_debug(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_NOTICE, args) + zlog_notice(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_INFO, args) + zlog_info(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_WARNING, args) + zlog_warn(args) @@ expression base; expression list args; @@ - zlog(base->log, LOG_ERR, args) + zlog_err(args) EOF Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: add frr_init() infrastructureDavid Lamparter2017-03-071-3/+0
| | | | | | | | | Start centralising startup & option parsing into the library. FRR_DAEMON_INFO is a bit weird, but it will become useful later (e.g. for killing the ZLOG_* enum, and having the daemon name available) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'stable/2.0'David Lamparter2016-12-081-3/+1
|\ | | | | | | | | | | | | | | Conflicts: bgpd/rfapi/bgp_rfapi_cfg.c bgpd/rfapi/vnc_debug.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: always set SO_SNDBUF and SO_RCVBUF using a best effort approachRenato Westphal2016-12-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | If we fail to set any socket's buffer size, try again with a smaller value and keep going until it succeeds. This is better than just giving up or, even worse, abort the creation of a socket (ospf6d and ripd). Fix broken ospf6d on FreeBSD. Signed-off-by: Renato Westphal <renato@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | lib, ripngd: clean up merge leftoversQuentin Young2016-12-061-1/+1
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge remote-tracking branch 'osr/master' into vtysh-grammarQuentin Young2016-12-061-3/+70
|\ \ | | | | | | | | | | | | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: lib/command_match.c
| * | *: fix up DEFUNs without install_element callsDavid Lamparter2016-12-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | These now generate warnings which will break the build with -Werror. Note this may have enabled commands that should be disabled, or the other way around... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * | Merge branch 'stable/2.0'David Lamparter2016-12-051-3/+68
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bgpd/bgp_route.c lib/if.c ripd/rip_interface.c zebra/interface.c zebra/zebra_vty.c
| | * ripngd: implement the "clear ipv6 ripng" vty commandRenato Westphal2016-11-251-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | This command deletes all received routes from the RIPng routing table. It should be used with caution as it can create black holes in the network (until it reconverges). Very useful to make automated testing (e.g. ANVL) more predictable. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>