summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_lsdb.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:03:39 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-20 03:03:39 +0200
commitc3c0ac8395502d7e84e94e0281cb72fa37a236c4 (patch)
tree7975560428f010d143f48ad83f7b1099fa471d39 /ospf6d/ospf6_lsdb.c
parentIncrease SO_SNDBUF and SO_RCVBUF to 8MB to avoid drops in large networks. (diff)
downloadfrr-c3c0ac8395502d7e84e94e0281cb72fa37a236c4.tar.xz
frr-c3c0ac8395502d7e84e94e0281cb72fa37a236c4.zip
ospf6d: ospfv3-abr-ecmp-support.patch
OSPFv3: Add ABR support and make ECMP > 4. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com>
Diffstat (limited to 'ospf6d/ospf6_lsdb.c')
-rw-r--r--ospf6d/ospf6_lsdb.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/ospf6d/ospf6_lsdb.c b/ospf6d/ospf6_lsdb.c
index 707afc67e..37259d6c7 100644
--- a/ospf6d/ospf6_lsdb.c
+++ b/ospf6d/ospf6_lsdb.c
@@ -31,7 +31,9 @@
#include "ospf6_proto.h"
#include "ospf6_lsa.h"
#include "ospf6_lsdb.h"
+#include "ospf6_route.h"
#include "ospf6d.h"
+#include "bitfield.h"
struct ospf6_lsdb *
ospf6_lsdb_create (void *data)
@@ -538,21 +540,42 @@ ospf6_lsdb_show (struct vty *vty, int level,
}
}
-/* Decide new Link State ID to originate.
- note return value is network byte order */
+/* Decide new Link State ID to originate for the range. */
+u_int32_t
+ospf6_new_range_ls_id (struct ospf6_route_table *range_table)
+{
+ u_int32_t id;
+
+ bf_assign_index(range_table->idspace, id);
+ return (id);
+}
+
+/* Release the LS ID back to the ID pool */
+void
+ospf6_release_range_ls_id (struct ospf6_route_table *range_table,
+ u_int32_t id)
+{
+ bf_release_index(range_table->idspace, id);
+}
+
u_int32_t
ospf6_new_ls_id (u_int16_t type, u_int32_t adv_router,
struct ospf6_lsdb *lsdb)
{
struct ospf6_lsa *lsa;
- u_int32_t id = 1;
+ u_int32_t id = 1, tmp_id;
+ /* This routine is curently invoked only for Inter-Prefix LSAs for
+ * non-summarized routes (no area/range).
+ */
for (lsa = ospf6_lsdb_type_router_head (type, adv_router, lsdb); lsa;
lsa = ospf6_lsdb_type_router_next (type, adv_router, lsa))
{
- if (ntohl (lsa->header->id) < id)
- continue;
- if (ntohl (lsa->header->id) > id)
+ tmp_id = ntohl (lsa->header->id);
+ if (tmp_id < id)
+ continue;
+
+ if (tmp_id > id)
{
ospf6_lsdb_lsa_unlock (lsa);
break;