Skip to content

Commit c455644

Browse files
committed
lib: matcher: widen matcher type bitmask assert to 64 bits
With 30 matcher types defined, the uint32_t bitmask guard only has 2 slots remaining. Widen the static_assert to uint64_t to allow the enum to grow beyond 32 values. BF_FLAG() already uses 1ULL, so no other changes are needed. Closes: #443
1 parent 2bd4147 commit c455644

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/libbpfilter/include/bpfilter/matcher.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ enum bf_matcher_type
113113
_BF_MATCHER_TYPE_MAX,
114114
};
115115

116-
/// @todo Change `bf_matcher_type` bitmasks to 64 bits.
117-
static_assert(_BF_MATCHER_TYPE_MAX <= 8 * sizeof(uint32_t),
118-
"too many matcher types for uint32_t bitmask");
116+
static_assert(_BF_MATCHER_TYPE_MAX <= 8 * sizeof(uint64_t),
117+
"too many matcher types for uint64_t bitmask");
119118

120119
/**
121120
* Defines the structure of the payload for bf_matcher's

0 commit comments

Comments
 (0)