From 2e88be5becd0566cc5245f256b4ad4180942fefe Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Fri, 15 Aug 2014 10:33:15 +0000 Subject: [PATCH] Fixed bug in get header flags: changed % to &. FossilOrigin-Name: d8f1de257f6956e036d989a71af972376729906a16c0671ed0eb87c09ee41eb8 --- src/capwap/capwap.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/capwap/capwap.h b/src/capwap/capwap.h index 002fbe9f..77f60743 100644 --- a/src/capwap/capwap.h +++ b/src/capwap/capwap.h @@ -48,16 +48,16 @@ #define CWTH_FLAGS_T 0x100 /* bit 8 type of payload frame */ -#define CWTH_GET_FLAG_R1(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_R1 ) ? 1:0) -#define CWTH_GET_FLAG_R2(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_R2 ) ? 1:0) -#define CWTH_GET_FLAG_R3(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_R3 ) ? 1:0) +#define CWTH_GET_FLAG_R1(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_R1 ) ? 1:0) +#define CWTH_GET_FLAG_R2(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_R2 ) ? 1:0) +#define CWTH_GET_FLAG_R3(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_R3 ) ? 1:0) -#define CWTH_GET_FLAG_K(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_K ) ? 1:0) -#define CWTH_GET_FLAG_M(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_M ) ? 1:0) -#define CWTH_GET_FLAG_W(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_W ) ? 1:0) -#define CWTH_GET_FLAG_L(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_L ) ? 1:0) -#define CWTH_GET_FLAG_F(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_F ) ? 1:0) -#define CWTH_GET_FLAG_T(th) ((ntohl( *((uint32_t*)th)) % CWTH_FLAGS_T ) ? 1:0) +#define CWTH_GET_FLAG_K(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_K ) ? 1:0) +#define CWTH_GET_FLAG_M(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_M ) ? 1:0) +#define CWTH_GET_FLAG_W(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_W ) ? 1:0) +#define CWTH_GET_FLAG_L(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_L ) ? 1:0) +#define CWTH_GET_FLAG_F(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_F ) ? 1:0) +#define CWTH_GET_FLAG_T(th) ((ntohl( *((uint32_t*)th)) & CWTH_FLAGS_T ) ? 1:0) /* wireless binding ids */ #define CWTH_WBID_RESERVED1 0