network: fix issue found by UBSan

This commit is contained in:
Yu Watanabe
2019-07-05 16:37:34 +09:00
parent 412ac780ac
commit 3a1df8c4cb
+2 -2
View File
@@ -19,12 +19,12 @@
static bool is_bit_set(unsigned bit, uint32_t scope) {
assert(bit < sizeof(scope)*8);
return scope & (1 << bit);
return scope & (UINT32_C(1) << bit);
}
static void set_bit(unsigned nr, uint32_t *addr) {
if (nr < BRIDGE_VLAN_BITMAP_MAX)
addr[nr / 32] |= (((uint32_t) 1) << (nr % 32));
addr[nr / 32] |= (UINT32_C(1) << (nr % 32));
}
static int find_next_bit(int i, uint32_t x) {