diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-01-25 20:21:18 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-01-26 16:30:59 +0100 |
commit | caa22aa644cb56e6fda77ff80c62d038653f3cf9 (patch) | |
tree | 07616ecc3704c24d235591e1efce6fb1031f49b2 /util.h | |
parent | 4c7304db85bd4e8ae641ab946a5b3832f24b6eca (diff) | |
download | passt-caa22aa644cb56e6fda77ff80c62d038653f3cf9.tar passt-caa22aa644cb56e6fda77ff80c62d038653f3cf9.tar.gz passt-caa22aa644cb56e6fda77ff80c62d038653f3cf9.tar.bz2 passt-caa22aa644cb56e6fda77ff80c62d038653f3cf9.tar.lz passt-caa22aa644cb56e6fda77ff80c62d038653f3cf9.tar.xz passt-caa22aa644cb56e6fda77ff80c62d038653f3cf9.tar.zst passt-caa22aa644cb56e6fda77ff80c62d038653f3cf9.zip |
tcp, udp, util: Fixes for bitmap handling on big-endian, casts
Bitmap manipulating functions would otherwise refer to inconsistent
sets of bits on big-endian architectures. While at it, fix up a
couple of casts.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -43,6 +43,8 @@ void debug(const char *format, ...); #define ROUND_DOWN(x, y) ((x) & ~((y) - 1)) #define ROUND_UP(x, y) (((x) + (y) - 1) & ~((y) - 1)) +#define BITMAP_BIT(n) (1UL << (n) % (sizeof(long) * 8)) +#define BITMAP_WORD(n) (n / (sizeof(long) * 8)) #define SWAP(a, b) \ do { \ |