ospfv3-code-refactor.patch.

Rearranging common defs and structures for use betweeen OSPFv2 and OSPFv3.

Created a new file called libospf.h under lib directory to hold defines that are
common between OSPFv2 and OSPFv3 code bases. Also removed all timer related routines
which were duplicated between thread.c, ospf_lsa.c and in ospfv3 code. Now, all
refer to the common code in thread.c. Name changes implied some updates to code as
well.
ospfv3-make-maxage-thread-periodic.patch

A million apologies for sending the previous email with the hellishly
long subject line. That was hopefully the last kink in the system, and
subsequent patch emails will be just that: patches.
ospf6: turn expensive debug off

OSPF6 has very expensive LSDB and route debug on by default. This needs to be
turned off for scaled performance.

Signed-off-by: James Li <jli@cumulusnetworks.com>
Reviewed-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospf6: add spf throttle timers

Schedule SPF to run on events rather than directly on each event.

OSPV3 SPF triggers on every SPF-able event instead of using timers the way
OSPFv2 does. This patch makes SPF be triggered/throttled similar to OSPFv2.
It adds a command to quagga identical to the OSPFv2 equivalent to configure
these timers.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospfv3-cleanup-before-premature-aging.patch

Remove older version of LSA from neigbor retx list before prematurely aging it.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospfv3-show-database-add-more-details.patch

Add more details to the show ipv6 ospf6 data internal command.

Specifically, it displays the flags, lock, retransmission count and
the expire/refresh thread fields.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospf6: check link operative status

Ensure OSPFv3 check's a link's operative status.

OSPFv3 checks only the administrative status of a link instead of its
operative status. This prevents it up from detecting a real link down
event and reacting appropriately. Only protocol timer timeouts make it
detect a link down eventually. This patch makes it look for the operative
status of a link instead of admin status.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
ospf6: fix incorrect install and flood lsa handling

Fix incorrect removal of older LSAs on receipt of new versions.

According to RFC2328, LSAs received from a neighbor should be
flooded before they're installed in the local database. OTOH,
self-generated LSAs are installed in the local database before
being flodded. In either case, older versions of the LSA MUST
be removed from neighbor's retransmission list.

Installing an LSA can potentially trigger an SPF recomputation
and routing table update. Flooding first ensures that LSAs are
not queued behind this potentially long operation. In our case,
install only triggers a timer event to run the SPF recomputation
and routing table update at a later time. The only other delay is
caused by running the incremental routing update of external LSAs.

The code as it stands now in v3 leads to redundant code to avoid
bugs especially during premature aging of LSAs. By installing the
LSA before flooding in all cases, we avoid redundant code and also
special casing to avoid bugs. I've seen no noticeable difference
in performance compared to OSPFv2 during stress tests including
external LSAs.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
ospf6: p2p interface support.

Add support for Point2Point interfaces to OSPFv3.

Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Signed-off-by: Ayan Banerjee <ayabaner@gmail.com>
Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Reviewed-by: James Li <jli@cumulusnetworks.com>
isisd,ospf6d: use bug-report information from autoconf

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
ospf6d: don't run DR election early on "ipv6 ospf6 priority"

On changing the router priority, DR election should only be run when it
was completed at least once before.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
ospf6d: fix refcounting in ospf6_asbr_lsa_remove

When iterating over a list, also the last node should be unlocked again.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
ospf6d: set cmsg size correctly

On both Linux and FreeBSD, msg_controllen should be set to
CMSG_LEN, not CMSG_SPACE. This avoids sending 4 bytes of
trailing garbage to the kernel.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
ospf6d: clear DR info on interface_down

This fixes an issue where ospf6d would send incorrect hellos and
perform wrong DR election when an interface went down and up
again.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
ospf6d: improve ordered shutdown

Improve the _disable/_enable infrastructure so it gets into
a more usable shape and make 'no router ospf6' actually work.
WIP: ospf6d: handle missing link local address more gracefully

ospf6 can't run on an interface without a link local address.
Don't start the state machine when an interface comes up without
such an ip and bring it up later, when a usable link local
address is added.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>