X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=blobdiff_plain;f=lib%2Fflow.h;h=36d453ae4a97d6cec2c96355eb17d001dc5f6485;hp=f0e3a3481d334cf3ef9c7e33798f4048130271d0;hb=d4570fd8ba5f36f21b9b631628e812de0189fa20;hpb=cabd4c43854275943792a8b1bb4c7b719e210259 diff --git a/lib/flow.h b/lib/flow.h index f0e3a3481..36d453ae4 100644 --- a/lib/flow.h +++ b/lib/flow.h @@ -484,7 +484,17 @@ static inline ovs_be64 minimask_get_metadata_mask(const struct minimask *); bool minimask_equal(const struct minimask *a, const struct minimask *b); bool minimask_has_extra(const struct minimask *, const struct minimask *); -bool minimask_is_catchall(const struct minimask *); + +/* Returns true if 'mask' matches every packet, false if 'mask' fixes any bits + * or fields. */ +static inline bool +minimask_is_catchall(const struct minimask *mask) +{ + /* For every 1-bit in mask's map, the corresponding value is non-zero, + * so the only way the mask can not fix any bits or fields is for the + * map the be zero. */ + return mask->masks.map == 0; +}