summaryrefslogtreecommitdiffstats
path: root/lib/table.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-08-22 15:27:08 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-08-22 15:27:08 +0200
commitacf3a851b97209cbb922c279ae8ae9493a786686 (patch)
treeac1e06367d166f8fc60ddf270448f6cba12a4ec1 /lib/table.h
parentMerge pull request #939 from jbonor/optimization (diff)
downloadfrr-acf3a851b97209cbb922c279ae8ae9493a786686.tar.xz
frr-acf3a851b97209cbb922c279ae8ae9493a786686.zip
lib: fix const-check in route_node
route_node->lock is "const" if --enable-dev-build is used. This is done to deter people from messing with internals of the route_table... unfortunately, the inline'd route_[un]lock_node runs into this. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to '')
-rw-r--r--lib/table.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/table.h b/lib/table.h
index ece40d86b..9637fec14 100644
--- a/lib/table.h
+++ b/lib/table.h
@@ -227,7 +227,7 @@ extern void route_table_iter_cleanup(route_table_iter_t *iter);
/* Lock node. */
static inline struct route_node *route_lock_node(struct route_node *node)
{
- node->lock++;
+ (*(unsigned *)&node->lock)++;
return node;
}
@@ -235,7 +235,7 @@ static inline struct route_node *route_lock_node(struct route_node *node)
static inline void route_unlock_node(struct route_node *node)
{
assert(node->lock > 0);
- node->lock--;
+ (*(unsigned *)&node->lock)--;
if (node->lock == 0)
route_node_delete(node);