summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_lsdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_lsdb.c')
-rw-r--r--ospf6d/ospf6_lsdb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ospf6d/ospf6_lsdb.c b/ospf6d/ospf6_lsdb.c
index ea387e3d..d2e3e04c 100644
--- a/ospf6d/ospf6_lsdb.c
+++ b/ospf6d/ospf6_lsdb.c
@@ -258,9 +258,6 @@ ospf6_lsdb_lookup (u_int16_t type, u_int32_t id, u_int32_t adv_router,
return (struct ospf6_lsa *) node->info;
}
-/* Macro version of check_bit (). */
-#define CHECK_BIT(X,P) ((((u_char *)(X))[(P) / 8]) >> (7 - ((P) % 8)) & 1)
-
struct ospf6_lsa *
ospf6_lsdb_lookup_next (u_int16_t type, u_int32_t id, u_int32_t adv_router,
struct ospf6_lsdb *lsdb)
@@ -291,7 +288,7 @@ ospf6_lsdb_lookup_next (u_int16_t type, u_int32_t id, u_int32_t adv_router,
prefix_match (&node->p, p))
{
matched = node;
- node = node->link[CHECK_BIT(&p->u.prefix, node->p.prefixlen)];
+ node = node->link[prefix_bit(&p->u.prefix, node->p.prefixlen)];
}
if (matched)
@@ -384,7 +381,7 @@ ospf6_lsdb_type_router_head (u_int16_t type, u_int32_t adv_router,
/* Walk down tree. */
while (node && node->p.prefixlen <= key.prefixlen &&
prefix_match (&node->p, (struct prefix *) &key))
- node = node->link[CHECK_BIT(&key.prefix, node->p.prefixlen)];
+ node = node->link[prefix_bit(&key.prefix, node->p.prefixlen)];
if (node)
route_lock_node (node);
@@ -438,7 +435,7 @@ ospf6_lsdb_type_head (u_int16_t type, struct ospf6_lsdb *lsdb)
node = lsdb->table->top;
while (node && node->p.prefixlen <= key.prefixlen &&
prefix_match (&node->p, (struct prefix *) &key))
- node = node->link[CHECK_BIT(&key.prefix, node->p.prefixlen)];
+ node = node->link[prefix_bit(&key.prefix, node->p.prefixlen)];
if (node)
route_lock_node (node);