summaryrefslogtreecommitdiffstats
path: root/isisd/isis_flags.h
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2017-09-14 15:26:33 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-09-20 13:59:09 +0200
commit068c82222961320a57ef56488de5eb3c49b159da (patch)
tree32b2a23c8bc8af91ae3e20e95435ac60454ba655 /isisd/isis_flags.h
parentMerge pull request #1200 from opensourcerouting/bgpd-ecmp-fix (diff)
downloadfrr-068c82222961320a57ef56488de5eb3c49b159da.tar.xz
frr-068c82222961320a57ef56488de5eb3c49b159da.zip
isisd: generate unique circuit ids
Circuit IDs need to be unique, otherwise mayhem will ensue. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Diffstat (limited to 'isisd/isis_flags.h')
-rw-r--r--isisd/isis_flags.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/isisd/isis_flags.h b/isisd/isis_flags.h
index c57f77880..229b7ab33 100644
--- a/isisd/isis_flags.h
+++ b/isisd/isis_flags.h
@@ -41,17 +41,22 @@ long int flags_get_index(struct flags *flags);
void flags_free_index(struct flags *flags, long int index);
int flags_any_set(u_int32_t *flags);
-#define ISIS_SET_FLAG(F, C) \
- { \
- F[C->idx >> 5] |= (1 << (C->idx & 0x1F)); \
+#define _ISIS_SET_FLAG(F, C) \
+ { \
+ F[(C) >> 5] |= (1 << ((C) & 0x1F)); \
}
+#define ISIS_SET_FLAG(F, C) _ISIS_SET_FLAG(F, C->idx)
-#define ISIS_CLEAR_FLAG(F, C) \
- { \
- F[C->idx >> 5] &= ~(1 << (C->idx & 0x1F)); \
+
+#define _ISIS_CLEAR_FLAG(F, C) \
+ { \
+ F[(C) >> 5] &= ~(1 << ((C) & 0x1F)); \
}
+#define ISIS_CLEAR_FLAG(F, C) _ISIS_CLEAR_FLAG(F, C->idx)
+
-#define ISIS_CHECK_FLAG(F, C) (F[(C)->idx>>5] & (1<<(C->idx & 0x1F)))
+#define _ISIS_CHECK_FLAG(F, C) (F[(C)>>5] & (1<<((C) & 0x1F)))
+#define ISIS_CHECK_FLAG(F, C) _ISIS_CHECK_FLAG(F, C->idx)
/* sets all u_32int_t flags to 1 */
#define ISIS_FLAGS_SET_ALL(FLAGS) \