Commit Graph

78 Commits

Author SHA1 Message Date
F. Aragon
1230a82d5b
bgpd isisd: null check (Clang scan)
This correction fixes three bugs detected by Clang scan:

Bug Group: Logic error
Bug Type: Dereference of null pointer

File: bgpd/bgp_evpn.c
Function: bgp_evpn_unconfigure_import_rt_for_vrf
Line: 4246

File: isisd/isis_spf.c
Function: isis_print_paths
Line: 69 (two bugs of same type in one line)

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-29 17:51:44 +02:00
paco
ae9c9aba09
isisd: out-of-bounds access (Coverity 1452552)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-25 12:16:32 +02:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
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>
2018-03-27 15:13:34 -04:00
Christian Franke
44b895115e isisd: P2P adjacencies should only be included in LSPDB/SPF when they are up 2018-03-10 18:38:03 +01:00
Christian Franke
0849c75e5d isisd: allocate circuit_id only for broadcast circuits
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-03-10 18:38:03 +01:00
Christian Franke
98c5bc15e7 isisd: revert some counterproductive indentation
This reverts some of commit 996c93142d.
2018-03-10 18:37:12 +01:00
Lou Berger
996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Donald Sharp
478becd9ae
Merge pull request #1536 from opensourcerouting/isis-l2conv
Fix ISIS L2 formations
2017-12-14 07:40:23 -05:00
Rafael Zalamena
a699dd69ea isisd: save a clock_gettime() call
Use the thread cached clock to use as start time. It will save a call to
clock_gettime() and also provide a more 'accurate' time measurement from
the start of the procedure.
2017-12-12 11:47:04 -02:00
Rafael Zalamena
013b29d7ea isisd: fix debug message
Show the actual timer instead of doing the arithmetic operation again.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2017-12-12 10:43:54 -02:00
Donald Sharp
affe9e9983 *: Convert list_delete(struct list *) to ** to allow nulling
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>
2017-10-05 10:53:13 -04:00
Christian Franke
60d3914270 isisd: fix vertex queue comparator
While vertizes should be strictly ordered on insertion, deletion
will of course encouter equality.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-10-02 16:03:11 +02:00
Christian Franke
05278b9378 isisd: cleanup unused variables
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-09-23 19:33:56 +02:00
Christian Franke
3dca3c8c48 isisd: always trigger spf run asynchronously
isis_spf_schedule gets called in states where an immediate spf run
will lead to crashes, e.g. from lsp_destroy. Delay the spf execution
until the event calling isis_spf_schedule has run to completion to
avoid this.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-09-23 19:33:56 +02:00
Christian Franke
d78b5f4176 isisd: SPF doesn't need to maintain children
SPF maintains a datastructure which is never actually read. I think
we can spend CPU more sensibly.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-09-22 21:20:26 +02:00
Christian Franke
bded4060fa isisd: use skiplist to implement ordered list for SPF
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-09-22 21:20:03 +02:00
Christian Franke
af88c591d1 isisd: cleanup output of show isis topology
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-09-01 00:58:21 +02:00
Christian Franke
ce837d81cc isisd: guard SPF warning by debug flag
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-29 00:23:53 +02:00
Christian Franke
eb919f07ab isisd: Use a hashtable to speed up lookups during SPF
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-03 14:30:32 +02:00
Christian Franke
02cd317ea0 isisd: make isis_spftree non-public
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-03 11:45:58 +02:00
Christian Franke
39a275aa0f isisd: only process overload info from fragment #0
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-03 11:34:04 +02:00
Christian Franke
841791b65b isisd: rework complete, move "tlvs2" to "tlvs"
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-03 11:34:04 +02:00
Christian Franke
af8ac8f98f isisd: send/receive LSPs with new parser
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-03 11:34:04 +02:00
David Lamparter
9d303b37d7 Revert "*: reindent pt. 2"
This reverts commit c14777c6bf.

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>
2017-07-22 14:52:33 +02:00
whitespace / reindent
c14777c6bf
*: reindent pt. 2
w/ clang 5

* reflow comments
* struct members go 1 per line
* binpack algo was adjusted
2017-07-17 15:26:02 -04:00
whitespace / reindent
d62a17aede *: reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17 14:04:07 +02:00
David Lamparter
6d3c2ed4ed *: remove VTYNL, part 1 of 6
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:20:02 +02:00
David Lamparter
181039f3d7 *: ditch vty_outln(), part 2 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14 10:19:58 +02:00
David Lamparter
5c7571d43f *: ditch vty_outln(), part 1 of 2
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13 20:29:22 +02:00
Quentin Young
e31b6333f4 *: vty_outln (vty, "") --> vty_out (vty, VTYNL)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:34:56 +00:00
Quentin Young
96ade3ed77 *: use vty_outln
Saves 400 lines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-06-29 17:31:28 +00:00
Quentin Young
7e045c3d42 *: use ->text and strmatch where appropriate
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>
2017-06-27 17:46:42 +00:00
David Lamparter
896014f4bc *: make consistent & update GPLv2 file headers
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>
2017-05-15 16:37:41 +02:00
Quentin Young
ffa2c8986d *: remove THREAD_ON macros, add nullity check
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>
2017-05-09 20:44:19 +00:00
Christian Franke
8b8c94eb56 isisd: fix initialization of ES vertizes
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-05-06 15:50:37 +02:00
Christian Franke
2b67862cca isisd: make spf MT aware
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-04-28 12:03:23 +02:00
Christian Franke
1b49e4f0ba isisd: do some cleanup on the spf implementation
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-04-28 12:03:23 +02:00
Donald Sharp
264f864625 isisd: Fix some various clang warnings
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-01 08:42:19 -04:00
Stephane Litkowski
03f7e182af isisd: add support for draft-ietf-rtgwg-backoff-algo
Adds CLI command "spf-delay-ietf" to area node for configuration
and "show isis spf-delay-ietf" to enable node for displaying status.
2017-02-22 17:13:17 +01:00
Stephane Litkowski
5475ecf7c5 isisd: cleanup SPF scheduling
- SPF is now per level only (no more per family)
 - t_spf and pending removed from struct spftree and moved to
   spf_timer field in struct isis_area
 - show isis summary output changed to accomodate the per level SPF
 - isis_spf_schedule6 and isis_run_spf6_lx functions are removed,
   isis_run_spf_lx now calls isis_run_spf for both INET and INET6
 - lsp related functions now call isis_spf_schedule only
2017-02-22 16:18:40 +01:00
David Lamparter
cf672a8654 *: use monotime()
This is largely a bulk-replace made with coccinelle.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-23 18:26:32 +01:00
Donald Sharp
56c1f7d852 frr: Remove HAVE_IPV6 from code base
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-13 08:05:50 -05:00
Donald Sharp
0b1442e37b *: Consolidate all double VIEW_NODE and ENABLE_NODE's
If a command is put into the VIEW_NODE, it is going into the
ENABLE_NODE as well.  This is especially true for show commands.
As such if a command is in both consolidate it down to VIEW_NODE.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-10-07 21:05:06 -04:00
David Lamparter
a8fd820281 lib: linklist: clean up insert-before/after dups
- list_add_node_next was in fact unused
- list_add_node_prev performs a subset of listnode_add_before and
  its only use in isisd replaced with that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-07-28 07:27:47 -04:00
David Lamparter
6c4f4e6e6a *: use void * for printing pointers
On higher warning levels, compilers expect %p printf arguments to be
void *.  Since format string / argument warnings can be useful
otherwise, let's get rid of this noise by sprinkling casts to void *
over printf calls.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-05-29 21:27:26 -04:00
David Lamparter
8f2c16aab0 *: use long long to print time_t
Since we can't assume time_t to be long, int, or even long long, this
consistently uses %lld/long long (or %llu/unsigned long long in a few
cases) to print time_t/susecond_t values.  This should fix a bunch of
warnings, on NetBSD in particular.

(Unfortunately, there seems to be no "PRId64" style printing macro for
time_t...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit ef008d2f8dc8f7160d8a3d24a15f2fad79ef3242)
2016-05-29 21:08:04 -04:00
Christian Franke
d66fa22127 isisd: remove superfluous checks after XMALLOC etc.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-03-29 20:26:13 -04:00
Donald Sharp
4690c7d74c Quagga: prefix2str fixup
During CR for nexthop upstream it was noticed that usage
of prefix2str was not consistent.  This fixes this problem

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2015-11-23 13:31:11 -08:00
Donald Sharp
91283e7641 isisd: isisd-warnings.patch
Remove compile warnings for the isisd directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
2015-05-19 18:29:15 -07:00
Nick Hilliard
e1a555b67c isisd: fix ipv6 metric endianness
the isis ipv6 reachability metric is transmitted in big endian / network
format, but isis_spf_process_lsp() does not convert this into host endian
format when mucking around with local cost + received metric.  This patch
fixes this problem and makes received ipv6 metrics work properly on
little-endian machines.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-12-12 15:38:14 +01:00