Commit Graph

176 Commits

Author SHA1 Message Date
Emanuele Di Pascale
8637060424 isisd: add the 'lsp-error-detected' notification
Note that we do not return the actual tlv_type and offset
of the erroneous TLV. This is because unpacking tlvs currently
uses a chain of function calls, where the notification can only
be sent at the start of the chain, but the tlv_type and offset
information are only available at the end. Unless we change the
code to propagate those values, we have no way to feed them to
the notification. So these leafs are not generated.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
0532bd84ab isisd: implement the 'version-skew' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
e98d763376 isisd: implement the 'id-len-mismatch' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
8375020ac6 isisd: implement the 'lsp-received' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
9d92b84be7 isisd: implement the 'area-mismatch' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
af6911c98c isisd: implement the 'rejected-adjacency' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
3380c990a3 isisd: implement the authentication failure notifications
the original isisd code did not distinguish between
authentication_failure and authentication_type_failure, so
additional code had to be added to differentiate between the two
and to return the raw_pdu as requested by the IETF YANG model.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
2ab5a2d155 isisd: implement 'max-area-addresses-mismatch' notification
Note that the original IETF YANG model also included
a requirement to throttle such notifications so that they would
not be sent more often than once every 5 seconds. I did not
implement any throttling mechanism yet, mostly because I am
not sure whether this limit should apply to the entire isis daemon,
to each area, to each neighbor etc.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Emanuele Di Pascale
56e22fb62c isisd: implement the 'lsp-too-large' notification
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2018-12-18 15:24:46 +01:00
Rodny Molina
89cdc4df6c Minor adjustments to address CI warnings 2018-12-12 00:23:23 +00:00
Christian Franke
39bb53d67a isisd: Provide statistics about sent/received PDU count
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
e923107c7b fabricd: make triggered csnp delay configurable
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
a6b60da99a fabricd: Improve LSP flooding log
Also track when we received an LSP as do not reflood, as well as the
time when we last considered flooding it.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
161fa356fb isisd: Add debug output for tx-queues
To allow easier debugging of LSP transmission scheduling, add a debug
mode where all tx-queue insertions/deletions are logged.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-07 19:45:14 +00:00
Christian Franke
a0a707ee6c isisd: add send_hello_sched function
Add a function send_hello_sched so that the logic for scheduling a
hello is not replicated inconsistently into different locations.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-04 16:13:24 +01:00
Christian Franke
7c4f7aabc5 isisd: reduce code duplication for levels
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-04 12:49:25 +01:00
David Lamparter
3e30070331 Revert "isisd lib ospfd pbrd python: fix empty init"
This reverts commit 48944eb65e.

We're using GNU C, not ISO C - and this commit triggers new (real)
warnings about {0} instead of bogus ones about {}.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-01 16:49:45 +01:00
Renato Westphal
e3ae78a829
Merge pull request #3368 from pacovn/static_analysis__ISO_C_empty_initializer
isisd lib ospfd pbrd python: fix empty init
2018-11-21 14:14:45 -02:00
F. Aragon
48944eb65e
isisd lib ospfd pbrd python: fix empty init
ISO C forbids empty initializer braces. Empty initializers have been
replaced with {0}

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-11-21 14:45:42 +01:00
Christian Franke
562d7ef703 isisd: Fix behavior on reception of self-originated LSP
We should only update and reflood our own LSPs when the received LSP
is newer than the local copy.

In all other cases, we should simply acknowledge it or resend our own
LSP.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-15 15:06:40 +01:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
Quentin Young
1c50c1c0d6 *: style for EC replacements
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:38:57 +00:00
Quentin Young
450971aa99 *: LIB_[ERR|WARN] -> EC_LIB
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:34:28 +00:00
Quentin Young
1a7ecb9630 isisd: ISIS_[ERR|WARN] -> EC_ISIS
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:12:08 +00:00
F. Aragon
f7813c7c7f
bgpd isisd ospf6d ospfd: variable shadowing fixes
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-12 16:44:36 +02:00
Christian Franke
4141588823 fabricd: add support for completely unnumbered operation
With this commit, fabricd can run without any IPv4 addresses configured
except on loopback. There are two changes to achieve this:

a) If a circuit has no IPv4 address configured, fabricd will resort to
advertise the routers loopback IP in the OpenFabric hellos.

b) All the routes from OpenFabric are sent with ZEBRA_FLAG_ONLINK set,
so that zebra will install them into the fib without checking whether
the nexthop is reachable

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
df0ba689eb fabricd: trigger CSNP after flooding scope LSP has been received
Have fabricd send out a CSNP whenever a circuit scoped LSP is received,
and log a warning if the CSNP showed resynchronization was necessary.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
a2d41bb0ee fabricd: Remove processing for unneded PDUs and TLVs
The OpenFabric draft prescribes that any IS-IS PDUs not needed for
OpenFabric operation MUST be ignored. So this commit makes fabricd
ignore any LAN IIHs and any L1 LSPs.

Also the draft specifies that any reachabilities given as narrow-metric
TLVs SHALL be ignored, so adhere to that too.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
2c92bee499 isisd: add purge originator identification support
Implement RFC 6232, optionally allowing to flood isisd's NET and
hostname in purges it originates.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
1cbd5b37b7 fabricd: support transmission/reception of circuit-scoped LSPs
OpenFabric makes use of flooding scope LSPs to reduce the amount of
reflooding caused by the update process. Implement transmission and
reception of such PDUs.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
9b39405f00 fabricd: reimplement LSP transmission logic
Before this commit, isisd/fabricd maintained a bitfield for each LSP
to track the SRM bit for each circuit, which specifies whether an LSP
needs to be sent on that circuit. Every second, it would scan over all
LSPs in `lsp_tick` and queue them up for transmission accordingly.

This design has two drawbacks: a) it scales poorly b) it adds
unacceptable latency to the update process: each router takes a random
amount of time between 0 and 1 seconds to forward an update. In a
network with a diamter of 10, it might already take 10 seconds for an
update to traverse the network.

To mitigate this, a new design was chosen. Instead of tracking SRM in a
bitfield, have one tx_queue per circuit and declare that an LSP is in
that queue if and only if it would have SRM set for that circuit.

This way, we can track SRM similarly as we did before, however, on
insertion into the LSP queue, we can add a timer for (re)transmission,
alleviating the need for a periodic scan with LSP tick and reducing the
latency for forwarding of updates.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Christian Franke
8e6fb83b4b fabricd: adjacency formation optimization as per section 2.4
OpenFabric changes IS-IS's initial database synchronization. While
regular IS-IS will simultaneuously exchange LSPs with all neighboring
routers during startup, this is considered too much churn for a densely
connected fabric.

To mitigate this, OpenFabric prescribes that a router should only
bring up an adjacency with a single neighbor and perform a full
synchronization with that neighbor, before bringing up further
adjacencies.

This is implemented by having a field `initial_sync_state` in the
fabricd datastructure which tracks whether an initial sync is still
pending, currently in progress, or complete.

When an initial sync is pending, the state will transition to the
in-progress state when the first IIH is received.

During this state, all IIHs from other routers are ignored. Any
IIHs transmitted on any link other than the one to the router with
which we are performing the initial sync will always report the far
end as DOWN in their threeway handshake state, avoiding the formation of
additional adjacencies.

The state will be left if all the SRM and SSN flags on the
initial-sync circuit are cleared (meaning that initial sync has
completed). This is checked in `lsp_tick`. When this condition occurrs,
we progress to the initial-sync-complete state, allowing other
adjacencies to form.

The state can also be left if the initial synchronization is taking too
long to succeed, for whatever reason. In that case, we fall back to the
initial-sync-pending state and will reattempt initial synchronization
with a different neighbor.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:13 +02:00
Quentin Young
af4c27286d *: rename zlog_fer -> flog_err
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Donald Sharp
54ece69899 isisd: Add isis_errors and generate custom Error Codes
Generate appropriate error codes for ISIS.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Donald Sharp
38937bd540 isisd: Convert to use LIB_ERR_XXX
Where an obvious choice could be made about converting
to a LIB_ERR_XXX function do so.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-14 20:02:05 +00:00
Christian Franke
c9b0e434bc isisd: add debug message if adjacency is ignored because IP is unusable
isisd verifies whether the neighboring IPv4 addresses overlap with its own
unless the interface is running in unnumbered mode. If no overlap is found
and IPv6 is also not enabled, IIHs will be ignored.

Add a debug message for this case, to avoid people wondering why adjacencies
are not coming up.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-08-03 13:25:38 +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
Donald Sharp
bd6a17203d
Merge pull request #1925 from opensourcerouting/bugfix-isis_bpf_read
isisd: Fixed the way isis reads from bpf
2018-03-19 10:13:35 -04:00
ipinlnd
b9347997d6 isisd: Fixed the way isis reads from bpf
With this fix, we parse the bpf to process every packet read

Signed-off-by: Ali Rezaee nlndipi@hotmail.com
2018-03-19 10:02:03 -03:00
Christian Franke
58e5d748c9 isisd: add nerd-knob to turn three-way-adj off
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-03-10 18:38:03 +01:00
Christian Franke
42fe262197 isisd: implement threeway adjacencies
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-03-10 18:38:03 +01:00
Christian Franke
c59f88c809 isisd: cleanup usage of circuit_id
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
ef47f23b91 Merge pull request #1358 from opensourcerouting/isis-lsp_tick-fixes
Isis lsp_tick fix and improve perfomance for processing LSP updates
2017-10-25 09:19:06 -04:00
Donald Sharp
a3acf37dc2 isisd: Fix leaked memory in error case
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-10 12:27:17 -04: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
e5973ce5b6 isisd: fix issue with lsp queueing logic in lsp_tick 2017-10-05 16:02:33 +02:00
Christian Franke
58e1623702 isisd: optimize per interface lsp send-queue creation
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-10-03 14:20:30 +02:00
Christian Franke
8f5dbe1864 isisd: always link fragments to fragment #0, even when learned by CSNP
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-11 15:53:07 +02:00
Christian Franke
164066e4d9 isisd: purge LSP correctly on confusion
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
Christian Franke
17c9dcd5f1 isisd: send/receive *SNPs with new parser
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-03 11:34:04 +02:00
Christian Franke
0c1bd7588b isisd: send/receive IIHs with new parser
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-08-03 11:34:04 +02:00
Christian Franke
88f9d9112a isisd: Don't use structs to encode/decode PDU header
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
Quentin Young
c5f119c06d *: do not take address of packed member
May result in alignment errors on certain platforms

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-26 15:22:23 +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
Hung-Weic Chiu
c16b6d31ed Address the error "Dead assignment" of static analysif
- 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>
2017-05-10 16:02:48 -04: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
481f148419 isisd: support unnumbered operation
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-05-06 15:50:47 +02:00
Christian Franke
d8fba7d974 isisd: track intersecting set of supported MTs for each adj
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-04-28 12:03:23 +02:00
Christian Franke
99894f9a17 isisd: announce MT capabilities in IIH and LSP
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2017-04-28 12:03:23 +02:00
Donald Sharp
3f3169a2e6 Merge remote-tracking branch 'origin/stable/2.0' 2017-02-24 09:32:47 -05:00
Christian Franke
f75352362c isisd: address coverity findings 2017-02-13 19:27:54 +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
David Lamparter
d987f2339d Merge branch '-isisd-simpl' into stable/2.0
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-08 12:52:45 +01:00
Renato Westphal
5904f19fdf isisd: create the isis_circuit_prepare() helper function
This reduces code duplication and the likelihood of a bug like 186534
("isisd: fix loss of packets after circuit is brought up") to happen
again.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 18:59:51 -02:00
Renato Westphal
0649629483 isisd: use a smaller #ifdef for isis_receive()
There's no need to provide two definitions of the isis_receive()
function (one for GNU_LINUX and the other for !GNU_LINUX). Both differ
only slightly so it makes more sense to define isis_receive() just once
and use a smaller #ifdef to account for these differences. This improves
code readability.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-11-28 18:59:13 -02:00
David Lamparter
095f8fae64 isisd: remove topology generator
Licensing is unclear and the tool is a testbed-only half-broken pile of
goo.  Remove.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-14 11:28:04 +09:00
David Lamparter
3c3877cd7d *: fix some licensing SNAFUs
bgpd/bgpd.c had a typo
zebra/zebra_mpls_netlink.c was derived from rt_netlink.c
isisd/include-netbsd/* are not needed (2 constants moved over)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-14 11:27:08 +09:00
Olivier Dugeon
f8c06e2c52 Add support of Traffic Engineering to IS-IS
These patches is an implementation of RFC5305 that enable the
support of Traffic Engineering in IS-IS

* isisd/Makefile.am: Add new files isis_te.c and isis_te.h
* isisd/isis_circuit.[c,h]: Add new mpls_te_circuit structure to isis_circuit
structure to handle new Traffic Engineering TLVs
* isisd/isis_lsp.c: Update LSP handler to mux/demux Traffic Engineering TLVs
* isisd/isis_main.c: Add initialisation of ISIS TE
* isisd/isis_pdu.c: Update function process_p2p_hello() to retrieve remote IP
address to populate Traffic Engineering TLV.
* isisd/isis_te.[c,]: Implementation of RFC5305
* isisd/isis_tlv.[c,h]: Update TLV definition and function to handle
Traffic Engineering ones
* isisd/isis_zebra.c: Add new function isis_zebra_link_params() to retrieve
the link parameters of interfaces from ZBus to populate the Traffic Engineering
TLVs
* isisd/isisd.[c,h]: Add Traffic Engineering support with new debug command

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2016-09-03 11:05:50 -04:00
David Lamparter
7b7a77a601 isisd: fix size_t confusions
isisd had a few places that mixed up size_t vs. unsigned long, and %zd
vs. %ld.  Clean out.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 01da6176b88fe59b3c6ceaf3630df88046c83159)
2016-06-07 09:13:23 -04:00
David Lamparter
f2bce9a5b3 *: fix signedness mix-ups
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 21401f3215be26dcb0f787105f5907745498e966)
2016-06-07 08:47:49 -04:00
Amritha Nambiar
a2d2c0d226 isisd: Add new adjacency to LSP neighbor list
isis_pdu.c :
New adjacency did not always get added to LSP neighbor list.

The adjacencies that were created once minimum time allowed before LSP
retransmission had surpassed, instantly got their LSP regenerated, but
the adjacency circuit type was not set to IIH PDU circuit type before
the LSP was regenerated , hence didn't pass the check for adjacency
circuit type in lsp_build(), and the adjacency was not added to neighbor list.

When a new adjacency is up, to build LSP with neighbor entry corresponding
to the adjacency, set adjacency circuit type to circuit type from hello PDU
header before new LSP is regenerated/built. This will result in the new
adjacency entry getting added to the LSP neighbor list TLV.

Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
(cherry picked from commit 06cc655c0345d610eb946bd41968caa03dc118ed)
2016-05-26 15:33:31 +00:00
Amritha Nambiar
0908a2fdd3 isisd: fix crash on processing own p2p hello
isis_pdu.c :
isisd crashes if router's own p2p hello packets get processed
thereby creating an adjacecncy with itself. Asserts at
isis_find_vertex. So discard own p2p IIH PDU and avoid
creating adjacency with self. This would also fix duplicate
systemID on an interface. These checks already exists for IS-IS
LAN Level 1/2 Hello PDU in process_lan_hello, but not for
point-to-point IIH PDUs.

Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 491417ac6383e2ea557951b24eb7bd3fffb69394)
2016-05-26 15:33:30 +00:00
Amritha Nambiar
793ec4733d isisd: match adjacency with source of hellos
isis_pdu.c: match adjacency with source of hellos,
check for source ID on receiving hello

If an adjacency exists, check the adjacency is with the
same router as the source of the hellos. In case a mismatch
is detected, bring down the adjacency and let the next
hellos trigger creating the new adjacency.

Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 3c28aaf437d8d473adb89c5e74574a61a9ea7cc6)
2016-05-26 15:24:51 +00:00
Stephen Hemminger
bdcf8f59a4 make some structures constant.
These pre-initialized arrays are not modified.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Feng Lu <lu.feng@6wind.com>
(cherry picked from commit 88d37b902bc8127379d3293b9671aa6a11479c23)
2016-05-26 01:16:33 +00:00
Christian Franke
cfd1f27b71 isisd: make send_lsp more robust
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Tested-by: NetDEF CI System <cisystem@netdef.org>
2016-03-29 20:26:34 -04:00
Christian Franke
0232bb7233 isisd: fix misleading wording in log
The changed messages are actually located before transmission is
attempted. Therefore, the tense is somewhat misleading, especially
since transmission may not always succeed.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-29 20:26:33 -04:00
Christian Franke
0250758d15 isisd: handle lsp confusion (ISO/IEC 10589:2002 7.3.16.2)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-29 20:26:32 -04:00
Christian Franke
17baea9c4e isisd: purge on correct level
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-29 20:26:21 -04:00
Christian Franke
b20ccb3aa9 isisd: allow to adjust lsp-mtu
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-29 20:26:20 -04:00
Christian Franke
ddfdbd32b4 isisd: initialize circuit to match area is_type
New circuits should be initialized to match the is_type
of their area. Also add an additional check to make sure
that no IIHs are sent for levels which are not enabled.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-29 20:26:17 -04:00
Christian Franke
ac7d316959 isisd: fix a typo in a log message
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-29 20:26:14 -04:00
Christian Franke
02e33d3ed5 isisd: annotate some function arguments with const
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-03-29 20:26:12 -04:00
Donald Sharp
ee046671d3 Fixup compiler warnings for powerpc
The turn-on of -Werror was never run fully against powerpc.
there were some powerpc specific issues that turned up.
This commit fixes these issues.
2015-07-27 13:19:12 -07: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
David Lamparter
ad2f92b6b0 isisd: type mix-up in 28a8cfc "don't require IPv4"
Whoops, these are in6_addrs, not prefix_ipv6... funnily enough, it does the
right thing either way, if it compiles, which it only does on Linux because
IN6_IS_ADDR_LINKLOCAL contains a cast to the right type.  On BSD there is no
such cast, hence it explodes on trying to compile, trying to access struct
members of in6_addrs while operating on prefix_ipv6...

Fixes: 28a8cfc ("isisd: don't require IPv4 for adjacency")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-08-18 18:16:28 +02:00
David Lamparter
28a8cfcbc3 isisd: don't require IPv4 for adjacency
This was precluding isisd from IPv6-only operation; no adjacency would
come up unless there was IPv4 in parallel.

Reported-by: Martin Winter <mwinter@netdef.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2014-08-18 01:49:32 +02:00
David Lamparter
b72f345d2e isisd: drop hellos without supported protocol list
isisd should not form adjacencies on receiving an IS-IS Hello without a
list of supported protocols (cf. RFC 1195 s4.4 p32 "Maintaining Router
Adjacencies")  Also fixes memleaks in these error cases.

* isisd/isis_pdu.c: improve TLVFLAG_NLPID handling

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Tested-by: Martin Winter <mwinter@opensourcerouting.org>
2012-12-12 15:38:07 +01:00
David Lamparter
19f78cebd2 isisd: refuse adjacencies with our own system ID
isisd would form an adjacency with another router despite the system IDs
being identical.  This would later cause an assertion failure like this:

  assertion=0x555555596db8 "isis_find_vertex (spftree->paths, id, vtype) == ((void *)0)",
  file=0x555555596c60 "isis_spf.c", line=515, function=0x555555597900 "isis_spf_add2tent") at log.c:619

which is caused by trying to add a path expected to not exist, but
suddenly colliding due to the duplicate system ID.

* isis_pdu.c: check for system ID collision on receiving Hello

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-12-12 15:38:07 +01:00
David Lamparter
655071f44a isisd: don't overrun list of protocols
isisd currently has a list of supported protocols as a fixed array of
size 4.  this can be overran, leading to an overwrite of the ipv4_addrs
pointer.

  * isisd/isis_pdu.c: don't accept more protocols than there's space for

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2012-10-25 10:15:59 -07:00
Avneesh Sachdev
0fece074e8 isisd: fix null pointer dereference in send_lsp()
* isisd/isis_pdu.c: (send_lsp) Handle case where there are no LSPs
    on the LSP transmission queue. This can happen if, for instance,
    the queue is cleared because of protocol events before the
    send_lsp thread gets a chance to run.
2012-10-25 10:15:59 -07:00
Avneesh Sachdev
a22ab5a560 isisd: tighten checks on ISIS pdu length
* isisd/isis_pdu.c: Fix problem where isisd would crash if it
    received a LAN IIH with the 'pdu length' field set to zero.
    Similar problems can occur in parsing other ISIS PDUs as well --
    check that the PDU length in an ISIS hello, LSP or SNP packet is
    at least as big as the size of the respective fixed header.
2012-10-25 10:15:59 -07:00
Subbaiah Venkata
e38e0df01a isisd: couple of bug fixes 2012-04-07 13:54:37 -07:00
Josh Bailey
3f045a0881 isisd: add Google's changes to IS-IS 2012-04-07 13:54:37 -07:00