| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: F. Aragon <paco@voltanet.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|\
| |
| | |
Use rb-trees to store interfaces instead of linked-lists
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
|
| |
There exists a path where we do not save the route_node
after creation. Allow cleanup.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
| |
this value len is not used for this vty_out() case.
Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
|
|
|
|
|
|
|
|
|
|
| |
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 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>
|
|\
| |
| | |
*: return CMD_WARNING if command was already configured
|
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
| |
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
w/ clang 5
* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
|
|
|
|
|
|
| |
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|\
| |
| |
| |
| |
| | |
Lots of conflicts from CMD_WARNING_CONFIG_FAILED...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
| |
| |
| |
| | |
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
| |
| |
| |
| | |
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
| |
| |
| |
| | |
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
| |
| |
| |
| | |
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|/
|
|
| |
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
|
|
|
| |
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
| |
Should be able to fit more vty_out onto one line now
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
| |
Saves 400 lines
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
Fix #668
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| | |
- 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>
|
| |
| |
| |
| |
| |
| | |
Found by visual inspection and some squinting
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
- 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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
| |
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
| |
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
bgpd/rfapi/bgp_rfapi_cfg.c
bgpd/rfapi/vnc_debug.c
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| | |
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Conflicts:
lib/command_match.c
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
bgpd/bgp_route.c
lib/if.c
ripd/rip_interface.c
zebra/interface.c
zebra/zebra_vty.c
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|